From 4ce721921462db23d0d93766dd4badf01a703cb6 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Sun, 2 Aug 2026 20:21:55 +0000 Subject: [PATCH] fix: Skip ambigious configs during source parsing if configureAs is not present --- src/backend/sources/ScrobbleSources.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/sources/ScrobbleSources.ts b/src/backend/sources/ScrobbleSources.ts index c331b359..153ab7c4 100644 --- a/src/backend/sources/ScrobbleSources.ts +++ b/src/backend/sources/ScrobbleSources.ts @@ -2,7 +2,7 @@ import { childLogger, type Logger } from '@foxxmd/logging'; import type EventEmitter from "events"; import type {InternalConfig, InternalConfigOptional} from "../common/infrastructure/Atomic.ts"; -import { isSourceType } from "../../core/Atomic.ts"; +import { clientTypes, isSourceType } from "../../core/Atomic.ts"; import { sourceTypes } from "../../core/Atomic.ts"; import type {SourceType} from "../../core/Atomic.ts"; import {aioSourceRelaxedConfigSchema, type AIOSourceRelaxedConfig, type SourceDefaults} from "../common/infrastructure/config/aioConfig.ts"; @@ -238,8 +238,10 @@ export default class ScrobbleSources { } break; case 'file': case 'aio': { - if ('configureAs' in entry.config && entry.config.configureAs === 'client') { - this.logger.debug(`Skipping ${configType} Config ${entry.source} ${entry.pos} because it is configured as a Source`); + if (('configureAs' in entry.config && entry.config.configureAs === 'client') + // @ts-expect-error could be a client type + || (clientTypes.includes(entry.type) && entry.config.configureAs !== 'source')) { + this.logger.debug(`Skipping ${configType} Config ${entry.source} ${entry.pos} because it is configured as a Client`); continue; } const parsed = entry.source === 'file' ? (await validateSourceJson(entry.type, entry.config)) : (await validateSourceAIOJson(entry.type, entry.config)); -- 2.51.2