mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
feat(launcher): pass through password-store for jellyfin flows
This commit is contained in:
@@ -134,6 +134,7 @@ export function createDefaultArgs(launcherConfig: LauncherYoutubeSubgenConfig):
|
||||
texthookerOnly: false,
|
||||
useRofi: false,
|
||||
logLevel: 'info',
|
||||
passwordStore: '',
|
||||
target: '',
|
||||
targetKind: '',
|
||||
};
|
||||
@@ -161,6 +162,7 @@ export function applyRootOptionsToArgs(
|
||||
if (typeof options.profile === 'string') parsed.profile = options.profile;
|
||||
if (options.start === true) parsed.startOverlay = true;
|
||||
if (typeof options.logLevel === 'string') parsed.logLevel = parseLogLevel(options.logLevel);
|
||||
if (typeof options.passwordStore === 'string') parsed.passwordStore = options.passwordStore;
|
||||
if (options.rofi === true) parsed.useRofi = true;
|
||||
if (options.startOverlay === true) parsed.autoStartOverlay = true;
|
||||
if (options.texthooker === false) parsed.useTexthooker = false;
|
||||
@@ -175,6 +177,9 @@ export function applyInvocationsToArgs(parsed: Args, invocations: CliInvocations
|
||||
if (invocations.jellyfinInvocation.logLevel) {
|
||||
parsed.logLevel = parseLogLevel(invocations.jellyfinInvocation.logLevel);
|
||||
}
|
||||
if (typeof invocations.jellyfinInvocation.passwordStore === 'string') {
|
||||
parsed.passwordStore = invocations.jellyfinInvocation.passwordStore;
|
||||
}
|
||||
const action = (invocations.jellyfinInvocation.action || '').toLowerCase();
|
||||
if (action && !['setup', 'discovery', 'play', 'login', 'logout'].includes(action)) {
|
||||
fail(`Unknown jellyfin action: ${invocations.jellyfinInvocation.action}`);
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface JellyfinInvocation {
|
||||
server?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
passwordStore?: string;
|
||||
logLevel?: string;
|
||||
}
|
||||
|
||||
@@ -168,6 +169,7 @@ export function parseCliPrograms(
|
||||
.option('-s, --server <url>', 'Jellyfin server URL')
|
||||
.option('-u, --username <name>', 'Jellyfin username')
|
||||
.option('-w, --password <pass>', 'Jellyfin password')
|
||||
.option('--password-store <backend>', 'Pass through Electron safeStorage backend')
|
||||
.option('--log-level <level>', 'Log level')
|
||||
.action((action: string | undefined, options: Record<string, unknown>) => {
|
||||
jellyfinInvocation = {
|
||||
@@ -180,6 +182,7 @@ export function parseCliPrograms(
|
||||
server: typeof options.server === 'string' ? options.server : undefined,
|
||||
username: typeof options.username === 'string' ? options.username : undefined,
|
||||
password: typeof options.password === 'string' ? options.password : undefined,
|
||||
passwordStore: typeof options.passwordStore === 'string' ? options.passwordStore : undefined,
|
||||
logLevel: typeof options.logLevel === 'string' ? options.logLevel : undefined,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user