mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-02 07:21:33 -07:00
refactor(tsukihime): swap Animetosho backend for TsukiHime API (#165)
This commit is contained in:
@@ -5,7 +5,7 @@ export const OVERLAY_HOSTED_MODALS = [
|
||||
'runtime-options',
|
||||
'subsync',
|
||||
'jimaku',
|
||||
'animetosho',
|
||||
'tsukihime',
|
||||
'youtube-track-picker',
|
||||
'playlist-browser',
|
||||
'kiku',
|
||||
@@ -96,10 +96,10 @@ export const IPC_CHANNELS = {
|
||||
jimakuSearchEntries: 'jimaku:search-entries',
|
||||
jimakuListFiles: 'jimaku:list-files',
|
||||
jimakuDownloadFile: 'jimaku:download-file',
|
||||
animetoshoSearchEntries: 'animetosho:search-entries',
|
||||
animetoshoListFiles: 'animetosho:list-files',
|
||||
animetoshoDownloadFile: 'animetosho:download-file',
|
||||
animetoshoGetSecondaryLanguages: 'animetosho:get-secondary-languages',
|
||||
tsukihimeSearchEntries: 'tsukihime:search-entries',
|
||||
tsukihimeListFiles: 'tsukihime:list-files',
|
||||
tsukihimeDownloadFile: 'tsukihime:download-file',
|
||||
tsukihimeGetSecondaryLanguages: 'tsukihime:get-secondary-languages',
|
||||
kikuBuildMergePreview: 'kiku:build-merge-preview',
|
||||
getConfigSettingsSnapshot: 'config:get-settings-snapshot',
|
||||
saveConfigSettingsPatch: 'config:save-settings-patch',
|
||||
@@ -138,7 +138,7 @@ export const IPC_CHANNELS = {
|
||||
runtimeOptionsChanged: 'runtime-options:changed',
|
||||
runtimeOptionsOpen: 'runtime-options:open',
|
||||
jimakuOpen: 'jimaku:open',
|
||||
animetoshoOpen: 'animetosho:open',
|
||||
tsukihimeOpen: 'tsukihime:open',
|
||||
youtubePickerOpen: 'youtube:picker-open',
|
||||
youtubePickerCancel: 'youtube:picker-cancel',
|
||||
playlistBrowserOpen: 'playlist-browser:open',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { KikuFieldGroupingChoice, KikuMergePreviewRequest } from '../../types/anki';
|
||||
import type {
|
||||
AnimetoshoDownloadQuery,
|
||||
AnimetoshoFilesQuery,
|
||||
AnimetoshoSearchQuery,
|
||||
TsukihimeDownloadQuery,
|
||||
TsukihimeFilesQuery,
|
||||
TsukihimeSearchQuery,
|
||||
JimakuDownloadQuery,
|
||||
JimakuFilesQuery,
|
||||
JimakuSearchQuery,
|
||||
@@ -43,7 +43,7 @@ const SESSION_ACTION_IDS: SessionActionId[] = [
|
||||
'openControllerSelect',
|
||||
'openControllerDebug',
|
||||
'openJimaku',
|
||||
'openAnimetosho',
|
||||
'openTsukihime',
|
||||
'openYoutubePicker',
|
||||
'openPlaylistBrowser',
|
||||
'replayCurrentSubtitle',
|
||||
@@ -406,17 +406,17 @@ export function parseJimakuDownloadQuery(value: unknown): JimakuDownloadQuery |
|
||||
};
|
||||
}
|
||||
|
||||
export function parseAnimetoshoSearchQuery(value: unknown): AnimetoshoSearchQuery | null {
|
||||
export function parseTsukihimeSearchQuery(value: unknown): TsukihimeSearchQuery | null {
|
||||
if (!isObject(value) || typeof value.query !== 'string') return null;
|
||||
return { query: value.query };
|
||||
}
|
||||
|
||||
export function parseAnimetoshoFilesQuery(value: unknown): AnimetoshoFilesQuery | null {
|
||||
export function parseTsukihimeFilesQuery(value: unknown): TsukihimeFilesQuery | null {
|
||||
if (!isObject(value) || !isInteger(value.entryId)) return null;
|
||||
return { entryId: value.entryId };
|
||||
}
|
||||
|
||||
export function parseAnimetoshoDownloadQuery(value: unknown): AnimetoshoDownloadQuery | null {
|
||||
export function parseTsukihimeDownloadQuery(value: unknown): TsukihimeDownloadQuery | null {
|
||||
if (!isObject(value)) return null;
|
||||
if (
|
||||
!isInteger(value.entryId) ||
|
||||
|
||||
Reference in New Issue
Block a user