mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-22 12:11:27 -07:00
41 lines
1.8 KiB
TypeScript
41 lines
1.8 KiB
TypeScript
import type {
|
|
createLaunchBackgroundWarmupTaskHandler,
|
|
createStartBackgroundWarmupsHandler,
|
|
} from './startup-warmups';
|
|
|
|
type LaunchBackgroundWarmupTaskMainDeps = Parameters<
|
|
typeof createLaunchBackgroundWarmupTaskHandler
|
|
>[0];
|
|
type StartBackgroundWarmupsMainDeps = Parameters<typeof createStartBackgroundWarmupsHandler>[0];
|
|
|
|
export function createBuildLaunchBackgroundWarmupTaskMainDepsHandler(
|
|
deps: LaunchBackgroundWarmupTaskMainDeps,
|
|
) {
|
|
return (): LaunchBackgroundWarmupTaskMainDeps => ({
|
|
now: () => deps.now(),
|
|
logDebug: (message: string) => deps.logDebug(message),
|
|
logWarn: (message: string) => deps.logWarn(message),
|
|
});
|
|
}
|
|
|
|
export function createBuildStartBackgroundWarmupsMainDepsHandler(
|
|
deps: StartBackgroundWarmupsMainDeps,
|
|
) {
|
|
return (): StartBackgroundWarmupsMainDeps => ({
|
|
getStarted: () => deps.getStarted(),
|
|
setStarted: (started: boolean) => deps.setStarted(started),
|
|
isTexthookerOnlyMode: () => deps.isTexthookerOnlyMode(),
|
|
launchTask: (label: string, task: () => Promise<void>) => deps.launchTask(label, task),
|
|
createMecabTokenizerAndCheck: () => deps.createMecabTokenizerAndCheck(),
|
|
ensureYomitanExtensionLoaded: () => deps.ensureYomitanExtensionLoaded(),
|
|
prewarmSubtitleDictionaries: () => deps.prewarmSubtitleDictionaries(),
|
|
shouldWarmupMecab: () => deps.shouldWarmupMecab(),
|
|
shouldWarmupYomitanExtension: () => deps.shouldWarmupYomitanExtension(),
|
|
shouldWarmupSubtitleDictionaries: () => deps.shouldWarmupSubtitleDictionaries(),
|
|
shouldWarmupJellyfinRemoteSession: () => deps.shouldWarmupJellyfinRemoteSession(),
|
|
shouldAutoConnectJellyfinRemote: () => deps.shouldAutoConnectJellyfinRemote(),
|
|
startJellyfinRemoteSession: () => deps.startJellyfinRemoteSession(),
|
|
logDebug: deps.logDebug,
|
|
});
|
|
}
|