mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 04:46:07 -08:00
refactor(ipc): remove dead preload methods and the ASS line broadcast (#293)
Drop 16 overlay preload methods with no caller (onSubtitleAss, getCurrentSubtitleAss, onVisibility, getOverlayVisibility, openYomitanSettings, quitApp, toggleOverlay, getMecabStatus, setMecabEnabled, getKeybindings, saveControllerPreference, getAnkiConnectStatus, setAnkiConnectEnabled, clearAnkiConnectHistory, cycleRuntimeOption, appendClipboardVideoToQueue) along with their IPC_CHANNELS keys, handlers, validators and dep plumbing. With both ASS consumers gone, stop observing sub-text/ass in mpv and remove the subtitle-ass-change event chain and appState.currentSubAssText. The main-process functions these wrapped stay; tray, CLI, shortcuts and session actions still use them.
This commit is contained in:
1 parent
8fc20b2499
commit
7909fcd2cf
32 files changed
+8
-876
No files matched your search
@@ -10,7 +10,6 @@ import type {
|
||||
} from '../../types/integrations';
|
||||
import type {
|
||||
ControllerConfigUpdate,
|
||||
ControllerPreferenceUpdate,
|
||||
SessionActionDispatchRequest,
|
||||
SubsyncManualRunRequest,
|
||||
} from '../../types/runtime';
|
||||
@@ -131,16 +130,6 @@ export function parseSubtitlePosition(value: unknown): SubtitlePosition | null {
|
||||
};
|
||||
}
|
||||
|
||||
export function parseControllerPreferenceUpdate(value: unknown): ControllerPreferenceUpdate | null {
|
||||
if (!isObject(value)) return null;
|
||||
if (typeof value.preferredGamepadId !== 'string') return null;
|
||||
if (typeof value.preferredGamepadLabel !== 'string') return null;
|
||||
return {
|
||||
preferredGamepadId: value.preferredGamepadId,
|
||||
preferredGamepadLabel: value.preferredGamepadLabel,
|
||||
};
|
||||
}
|
||||
|
||||
function parseDiscreteBinding(value: unknown) {
|
||||
if (!isObject(value) || typeof value.kind !== 'string') return null;
|
||||
if (value.kind === 'none') {
|
||||
@@ -328,10 +317,6 @@ export function parseRuntimeOptionId(value: unknown): RuntimeOptionId | null {
|
||||
return RUNTIME_OPTION_IDS.includes(value as RuntimeOptionId) ? (value as RuntimeOptionId) : null;
|
||||
}
|
||||
|
||||
export function parseRuntimeOptionDirection(value: unknown): 1 | -1 | null {
|
||||
return value === 1 || value === -1 ? value : null;
|
||||
}
|
||||
|
||||
export function parseRuntimeOptionValue(value: unknown): RuntimeOptionValue | null {
|
||||
return typeof value === 'boolean' || typeof value === 'string'
|
||||
? (value as RuntimeOptionValue)
|
||||
|
||||
Reference in new issue
Block a user