feat: Revert specific config requirement to be a top-level array

Wasn't really necessary and would cause breaking change for existing configs.
This commit is contained in:
FoxxMD
2023-02-21 12:27:27 -05:00
parent 93230c45c7
commit e960438968
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -137,8 +137,10 @@ export default class ScrobbleClients {
} else if(rawClientConfigs === null) {
this.logger.error(`${clientType}.json contained no data`);
continue;
} else if(typeof rawClientConfigs === 'object') {
clientConfigs = [rawClientConfigs];
} else {
this.logger.error(`All top level data from ${clientType}.json must be an array of objects, will not parse configs from file`);
this.logger.error(`All top level data from ${clientType}.json must be an object or an array of objects, will not parse configs from file`);
continue;
}
for(const [i,rawConf] of rawClientConfigs.entries()) {
+3 -1
View File
@@ -216,8 +216,10 @@ export default class ScrobbleSources {
} else if (rawSourceConfigs === null) {
this.logger.error(`${sourceType}.json contained no data`);
continue;
} else if (typeof rawSourceConfigs === 'object') {
sourceConfigs = [rawSourceConfigs];
} else {
this.logger.error(`All top level data from ${sourceType}.json must be an array of objects, will not parse configs from file`);
this.logger.error(`All top level data from ${sourceType}.json must be an object or an array of objects, will not parse configs from file`);
continue;
}
for (const [i,rawConf] of sourceConfigs.entries()) {