refactor(tsukihime): swap Animetosho backend for TsukiHime API (#165)

This commit is contained in:
2026-07-13 22:03:35 -07:00
committed by GitHub
parent 49b926e08c
commit 2e2ee3f028
90 changed files with 2253 additions and 1695 deletions
+12 -5
View File
@@ -10,7 +10,7 @@ import type {
ImmersionTrackingConfig,
ImmersionTrackingRetentionMode,
ImmersionTrackingRetentionPreset,
AnimetoshoConfig,
TsukihimeConfig,
JellyfinConfig,
JimakuConfig,
JimakuLanguagePreference,
@@ -123,7 +123,7 @@ export interface ShortcutsConfig {
openCharacterDictionaryManager?: string | null;
openRuntimeOptions?: string | null;
openJimaku?: string | null;
openAnimetosho?: string | null;
openTsukihime?: string | null;
openSessionHelp?: string | null;
openControllerSelect?: string | null;
openControllerDebug?: string | null;
@@ -132,6 +132,11 @@ export interface ShortcutsConfig {
appendClipboardVideoToQueue?: string | null;
}
export interface RawShortcutsConfig extends ShortcutsConfig {
/** @deprecated Use openTsukihime. */
openAnimetosho?: string | null;
}
export interface Config {
subtitlePosition?: SubtitlePosition;
keybindings?: Keybinding[];
@@ -141,7 +146,7 @@ export interface Config {
mpv?: MpvConfig;
controller?: ControllerConfig;
ankiConnect?: AnkiConnectConfig;
shortcuts?: ShortcutsConfig;
shortcuts?: RawShortcutsConfig;
secondarySub?: SecondarySubConfig;
subsync?: SubsyncConfig;
startupWarmups?: StartupWarmupsConfig;
@@ -149,7 +154,9 @@ export interface Config {
subtitleSidebar?: SubtitleSidebarConfig;
auto_start_overlay?: boolean;
jimaku?: JimakuConfig;
animetosho?: AnimetoshoConfig;
/** @deprecated Use tsukihime. */
animetosho?: TsukihimeConfig;
tsukihime?: TsukihimeConfig;
anilist?: AnilistConfig;
yomitan?: YomitanConfig;
jellyfin?: JellyfinConfig;
@@ -306,7 +313,7 @@ export interface ResolvedConfig {
languagePreference: JimakuLanguagePreference;
maxEntryResults: number;
};
animetosho: AnimetoshoConfig & {
tsukihime: TsukihimeConfig & {
apiBaseUrl: string;
maxSearchResults: number;
};
+9 -8
View File
@@ -241,23 +241,24 @@ export type JimakuDownloadResult =
| { ok: true; path: string }
| { ok: false; error: JimakuApiError };
export interface AnimetoshoSearchQuery {
export interface TsukihimeSearchQuery {
query: string;
}
export interface AnimetoshoEntry {
export interface TsukihimeEntry {
id: number;
title: string;
timestamp: number | null;
totalSize: number | null;
numFiles: number | null;
sublangs: string[];
}
export interface AnimetoshoFilesQuery {
export interface TsukihimeFilesQuery {
entryId: number;
}
export interface AnimetoshoSubtitleFile {
export interface TsukihimeSubtitleFile {
attachmentId: number;
filename: string;
lang: string;
@@ -267,18 +268,18 @@ export interface AnimetoshoSubtitleFile {
sourceFilename: string;
}
export interface AnimetoshoDownloadQuery {
export interface TsukihimeDownloadQuery {
entryId: number;
url: string;
name: string;
lang?: string;
}
export type AnimetoshoApiResponse<T> = JimakuApiResponse<T>;
export type TsukihimeApiResponse<T> = JimakuApiResponse<T>;
export type AnimetoshoDownloadResult = JimakuDownloadResult;
export type TsukihimeDownloadResult = JimakuDownloadResult;
export interface AnimetoshoConfig {
export interface TsukihimeConfig {
apiBaseUrl?: string;
maxSearchResults?: number;
}
+18 -18
View File
@@ -12,13 +12,13 @@ import type {
SessionBindingWarning,
} from './session-bindings';
import type {
AnimetoshoApiResponse,
AnimetoshoDownloadQuery,
AnimetoshoDownloadResult,
AnimetoshoEntry,
AnimetoshoFilesQuery,
AnimetoshoSearchQuery,
AnimetoshoSubtitleFile,
TsukihimeApiResponse,
TsukihimeDownloadQuery,
TsukihimeDownloadResult,
TsukihimeEntry,
TsukihimeFilesQuery,
TsukihimeSearchQuery,
TsukihimeSubtitleFile,
JimakuApiResponse,
JimakuDownloadQuery,
JimakuDownloadResult,
@@ -461,14 +461,14 @@ export interface ElectronAPI {
jimakuSearchEntries: (query: JimakuSearchQuery) => Promise<JimakuApiResponse<JimakuEntry[]>>;
jimakuListFiles: (query: JimakuFilesQuery) => Promise<JimakuApiResponse<JimakuFileEntry[]>>;
jimakuDownloadFile: (query: JimakuDownloadQuery) => Promise<JimakuDownloadResult>;
animetoshoSearchEntries: (
query: AnimetoshoSearchQuery,
) => Promise<AnimetoshoApiResponse<AnimetoshoEntry[]>>;
animetoshoListFiles: (
query: AnimetoshoFilesQuery,
) => Promise<AnimetoshoApiResponse<AnimetoshoSubtitleFile[]>>;
animetoshoDownloadFile: (query: AnimetoshoDownloadQuery) => Promise<AnimetoshoDownloadResult>;
animetoshoGetSecondaryLanguages: () => Promise<string[]>;
tsukihimeSearchEntries: (
query: TsukihimeSearchQuery,
) => Promise<TsukihimeApiResponse<TsukihimeEntry[]>>;
tsukihimeListFiles: (
query: TsukihimeFilesQuery,
) => Promise<TsukihimeApiResponse<TsukihimeSubtitleFile[]>>;
tsukihimeDownloadFile: (query: TsukihimeDownloadQuery) => Promise<TsukihimeDownloadResult>;
tsukihimeGetSecondaryLanguages: () => Promise<string[]>;
quitApp: () => void;
toggleDevTools: () => void;
toggleOverlay: () => void;
@@ -501,7 +501,7 @@ export interface ElectronAPI {
onOpenControllerSelect: (callback: () => void) => void;
onOpenControllerDebug: (callback: () => void) => void;
onOpenJimaku: (callback: () => void) => void;
onOpenAnimetosho: (callback: () => void) => void;
onOpenTsukihime: (callback: () => void) => void;
onOpenYoutubeTrackPicker: (callback: (payload: YoutubePickerOpenPayload) => void) => void;
onOpenPlaylistBrowser: (callback: () => void) => void;
onOpenCharacterDictionaryManager: (callback: () => void) => void;
@@ -546,7 +546,7 @@ export interface ElectronAPI {
| 'runtime-options'
| 'subsync'
| 'jimaku'
| 'animetosho'
| 'tsukihime'
| 'youtube-track-picker'
| 'playlist-browser'
| 'kiku'
@@ -561,7 +561,7 @@ export interface ElectronAPI {
| 'runtime-options'
| 'subsync'
| 'jimaku'
| 'animetosho'
| 'tsukihime'
| 'youtube-track-picker'
| 'playlist-browser'
| 'kiku'
+1 -1
View File
@@ -22,7 +22,7 @@ export type SessionActionId =
| 'openControllerSelect'
| 'openControllerDebug'
| 'openJimaku'
| 'openAnimetosho'
| 'openTsukihime'
| 'openYoutubePicker'
| 'openPlaylistBrowser'
| 'replayCurrentSubtitle'