Fix Windows mpv logging and add log export (#88)

This commit is contained in:
2026-05-26 00:31:38 -07:00
committed by GitHub
parent 43ebc7d371
commit 11c196821d
150 changed files with 2748 additions and 582 deletions
+30
View File
@@ -100,6 +100,36 @@ export function applyCoreDomainConfig(context: ResolveContext): void {
'Expected debug, info, warn, or error.',
);
}
const logRotation = src.logging.rotation;
if (typeof logRotation === 'number' && Number.isInteger(logRotation) && logRotation > 0) {
resolved.logging.rotation = logRotation;
} else if (src.logging.rotation !== undefined) {
warn(
'logging.rotation',
src.logging.rotation,
resolved.logging.rotation,
'Expected a positive whole number of days.',
);
}
if (isObject(src.logging.files)) {
for (const key of ['app', 'launcher', 'mpv'] as const) {
const enabled = asBoolean(src.logging.files[key]);
if (enabled !== undefined) {
resolved.logging.files[key] = enabled;
} else if (src.logging.files[key] !== undefined) {
warn(
`logging.files.${key}`,
src.logging.files[key],
resolved.logging.files[key],
'Expected boolean.',
);
}
}
} else if (src.logging.files !== undefined) {
warn('logging.files', src.logging.files, resolved.logging.files, 'Expected object.');
}
}
applyControllerConfig(context);
-12
View File
@@ -81,18 +81,6 @@ export function applyIntegrationConfig(context: ResolveContext): void {
if (isObject(src.anilist.characterDictionary)) {
const characterDictionary = src.anilist.characterDictionary;
const dictionaryEnabled = asBoolean(characterDictionary.enabled);
if (dictionaryEnabled !== undefined) {
resolved.anilist.characterDictionary.enabled = dictionaryEnabled;
} else if (characterDictionary.enabled !== undefined) {
warn(
'anilist.characterDictionary.enabled',
characterDictionary.enabled,
resolved.anilist.characterDictionary.enabled,
'Expected boolean.',
);
}
const refreshTtlHours = asNumber(characterDictionary.refreshTtlHours);
if (refreshTtlHours !== undefined) {
const normalized = Math.min(24 * 365, Math.max(1, Math.floor(refreshTtlHours)));
-2
View File
@@ -97,7 +97,6 @@ test('anilist character dictionary fields are parsed, clamped, and enum-validate
const { context, warnings } = createResolveContext({
anilist: {
characterDictionary: {
enabled: true,
refreshTtlHours: 0,
maxLoaded: 99,
evictionPolicy: 'purge' as never,
@@ -113,7 +112,6 @@ test('anilist character dictionary fields are parsed, clamped, and enum-validate
applyIntegrationConfig(context);
assert.equal(context.resolved.anilist.characterDictionary.enabled, true);
assert.equal(context.resolved.anilist.characterDictionary.refreshTtlHours, 1);
assert.equal(context.resolved.anilist.characterDictionary.maxLoaded, 20);
assert.equal(context.resolved.anilist.characterDictionary.evictionPolicy, 'delete');