From de2cfc18f7356ee6ad263224d85bc9c2d77abc38 Mon Sep 17 00:00:00 2001 From: Arthur Jamet Date: Sun, 22 Dec 2024 11:28:11 +0000 Subject: [PATCH] Server: Remove Dead code about settings --- server/src/album/album.controller.spec.ts | 2 - server/src/artist/artist.controller.spec.ts | 2 - .../illustration.controller.spec.ts | 4 +- server/src/playlist/playlist.service.spec.ts | 2 - .../search/search-history.controller.spec.ts | 2 - server/src/settings/models/settings.ts | 198 +----------------- .../src/settings/settings.controller.spec.ts | 15 -- server/src/settings/settings.controller.ts | 11 +- server/src/settings/settings.service.spec.ts | 113 +--------- server/src/settings/settings.service.ts | 25 +-- server/src/song/song-group.controller.spec.ts | 2 - server/src/song/song.controller.spec.ts | 5 +- server/src/video/video.controller.spec.ts | 2 - server/test/assets/settings-empty-file.json | 0 server/test/assets/settings-empty-regex.json | 7 - server/test/assets/settings-fake-regex.json | 16 -- server/test/assets/settings-invalid.json | 5 - .../settings-missing-metadata-order.json | 9 - .../settings-missing-metadata-source.json | 9 - .../assets/settings-missing-metadata.json | 6 - .../assets/settings-missing-nested-value.json | 15 -- .../test/assets/settings-missing-regex.json | 6 - .../assets/settings-provider-disabled.json | 18 -- .../settings-wrong-type-metadata-source.json | 10 - .../settings-wrong-type-metadata-type.json | 6 - server/test/assets/settings-wrong-type.json | 6 - server/test/assets/settings.json | 19 -- server/test/assets/settings2.json | 16 -- 28 files changed, 12 insertions(+), 519 deletions(-) delete mode 100644 server/test/assets/settings-empty-file.json delete mode 100644 server/test/assets/settings-empty-regex.json delete mode 100644 server/test/assets/settings-fake-regex.json delete mode 100644 server/test/assets/settings-invalid.json delete mode 100644 server/test/assets/settings-missing-metadata-order.json delete mode 100644 server/test/assets/settings-missing-metadata-source.json delete mode 100644 server/test/assets/settings-missing-metadata.json delete mode 100644 server/test/assets/settings-missing-nested-value.json delete mode 100644 server/test/assets/settings-missing-regex.json delete mode 100644 server/test/assets/settings-provider-disabled.json delete mode 100644 server/test/assets/settings-wrong-type-metadata-source.json delete mode 100644 server/test/assets/settings-wrong-type-metadata-type.json delete mode 100644 server/test/assets/settings-wrong-type.json delete mode 100644 server/test/assets/settings.json delete mode 100644 server/test/assets/settings2.json diff --git a/server/src/album/album.controller.spec.ts b/server/src/album/album.controller.spec.ts index a59642362..94eccdacf 100644 --- a/server/src/album/album.controller.spec.ts +++ b/server/src/album/album.controller.spec.ts @@ -22,7 +22,6 @@ import { expectedAlbumResponse, expectedArtistResponse, } from "test/expected-responses"; -import SettingsService from "src/settings/settings.service"; import { Genre, IllustrationType } from "@prisma/client"; jest.setTimeout(60000); @@ -53,7 +52,6 @@ describe("Album Controller", () => { app = await SetupApp(module); dummyRepository = module.get(PrismaService); await dummyRepository.onModuleInit(); - module.get(SettingsService).loadFromFile(); }); afterAll(async () => { diff --git a/server/src/artist/artist.controller.spec.ts b/server/src/artist/artist.controller.spec.ts index c2a02c36a..8c5789fe0 100644 --- a/server/src/artist/artist.controller.spec.ts +++ b/server/src/artist/artist.controller.spec.ts @@ -24,7 +24,6 @@ import { LyricsModule } from "src/lyrics/lyrics.module"; import FileModule from "src/file/file.module"; import { expectedArtistResponse } from "test/expected-responses"; import SettingsModule from "src/settings/settings.module"; -import SettingsService from "src/settings/settings.service"; import { IllustrationType } from "@prisma/client"; describe("Artist Controller", () => { @@ -61,7 +60,6 @@ describe("Artist Controller", () => { app = await SetupApp(module); dummyRepository = module.get(PrismaService); await dummyRepository.onModuleInit(); - module.get(SettingsService).loadFromFile(); }); afterAll(async () => { diff --git a/server/src/illustration/illustration.controller.spec.ts b/server/src/illustration/illustration.controller.spec.ts index e8d77ebe9..f13443381 100644 --- a/server/src/illustration/illustration.controller.spec.ts +++ b/server/src/illustration/illustration.controller.spec.ts @@ -75,8 +75,8 @@ describe("Illustration Controller", () => { }); const getDummyIllustrationStream = () => - fs.createReadStream("test/assets/settings.json"); - const dummyIllustrationBytes = fs.readFileSync("test/assets/settings.json"); + fs.createReadStream("test/sequencer.ts"); + const dummyIllustrationBytes = fs.readFileSync("test/sequencer.ts"); const illustrationUrlExample = "https://sample-videos.com/img/Sample-jpg-image-50kb.jpg"; diff --git a/server/src/playlist/playlist.service.spec.ts b/server/src/playlist/playlist.service.spec.ts index 1b5fd8c50..b5b3f6d0d 100644 --- a/server/src/playlist/playlist.service.spec.ts +++ b/server/src/playlist/playlist.service.spec.ts @@ -4,7 +4,6 @@ import TestPrismaService from "test/test-prisma.service"; import PlaylistModule from "./playlist.module"; import PlaylistService from "./playlist.service"; import SettingsModule from "src/settings/settings.module"; -import SettingsService from "src/settings/settings.service"; import PrismaService from "src/prisma/prisma.service"; import Slug from "src/slug/slug"; import { @@ -28,7 +27,6 @@ describe("Playlist Service", () => { .compile(); dummyRepository = module.get(PrismaService); playlistService = module.get(PlaylistService); - module.get(SettingsService).loadFromFile(); await dummyRepository.onModuleInit(); }); diff --git a/server/src/search/search-history.controller.spec.ts b/server/src/search/search-history.controller.spec.ts index 866b9efb9..88fc9fbec 100644 --- a/server/src/search/search-history.controller.spec.ts +++ b/server/src/search/search-history.controller.spec.ts @@ -6,7 +6,6 @@ import { INestApplication } from "@nestjs/common"; import SongModule from "src/song/song.module"; import TestPrismaService from "test/test-prisma.service"; import SetupApp from "test/setup-app"; -import SettingsService from "src/settings/settings.service"; import * as Plugins from "../app.plugins"; import ArtistModule from "src/artist/artist.module"; import AlbumModule from "src/album/album.module"; @@ -45,7 +44,6 @@ describe("Search History Controller", () => { app = await SetupApp(module); dummyRepository = module.get(PrismaService); const userService = module.get(UserService); - module.get(SettingsService).loadFromFile(); await dummyRepository.onModuleInit(); await userService.create({ name: "admin", diff --git a/server/src/settings/models/settings.ts b/server/src/settings/models/settings.ts index 59aadc0c4..0ce9a6b1c 100644 --- a/server/src/settings/models/settings.ts +++ b/server/src/settings/models/settings.ts @@ -16,167 +16,13 @@ * along with this program. If not, see . */ -import { ApiHideProperty, ApiProperty } from "@nestjs/swagger"; -import { Exclude, Type } from "class-transformer"; -import { - ArrayNotEmpty, - IsBoolean, - IsDefined, - IsIn, - IsNotEmpty, - IsOptional, - IsString, - ValidateNested, -} from "class-validator"; +import { ApiProperty } from "@nestjs/swagger"; +import { Exclude } from "class-transformer"; +import { IsBoolean, IsString } from "class-validator"; export const metadataSourceValue = ["path", "embedded"] as const; export const metadataOrderValue = ["only", "preferred"] as const; -class BaseProviderSettings { - @ApiProperty() - @IsOptional() - @IsBoolean() - @ApiProperty({ type: Boolean }) - enabled = true; -} - -//TODO Delete Provider Settings after Matcher Microservice - -class AllMusicSettings extends BaseProviderSettings {} - -class DiscogsSettings extends BaseProviderSettings { - @ApiHideProperty() - @IsDefined() - @IsString() - @Exclude({ toPlainOnly: true }) - apiKey: string; -} - -class GeniusSettings extends BaseProviderSettings { - @ApiHideProperty() - @IsDefined() - @IsString() - @Exclude({ toPlainOnly: true }) - apiKey: string; -} -class MetacriticSettings extends BaseProviderSettings {} - -class MusicBrainzSettings extends BaseProviderSettings {} - -class WikipediaSettings extends BaseProviderSettings {} - -/** - * Settings for the Providers - */ -export class ProvidersSettings { - /** - * Settings for the Genius provider - */ - @ApiProperty({ - type: GeniusSettings, - required: false, - }) - @Type(() => GeniusSettings) - @ValidateNested() - @IsOptional() - genius: GeniusSettings; - - /** - * Settings for the Musicbrainz provider - */ - @ApiProperty({ - type: MusicBrainzSettings, - required: false, - }) - @Type(() => MusicBrainzSettings) - @ValidateNested() - @IsOptional() - musicbrainz: MusicBrainzSettings; - - /** - * Settings for the Discogs provider - */ - @ApiProperty({ - type: DiscogsSettings, - required: false, - }) - @Type(() => DiscogsSettings) - @ValidateNested() - @IsOptional() - discogs: DiscogsSettings; - - /** - * Settings for the Wikipedia provider - */ - @ApiProperty({ - type: WikipediaSettings, - required: false, - }) - @Type(() => WikipediaSettings) - @ValidateNested() - @IsOptional() - wikipedia: WikipediaSettings; - - /** - * Settings for the Metacritic provider - */ - @ApiProperty({ - type: MetacriticSettings, - required: false, - }) - @Type(() => MetacriticSettings) - @ValidateNested() - @IsOptional() - metacritic: MetacriticSettings; - - /** - * Settings for the AllMusic provider - */ - @ApiProperty({ - type: AllMusicSettings, - required: false, - }) - @Type(() => AllMusicSettings) - @ValidateNested() - @IsOptional() - allMusic: AllMusicSettings; -} - -class CompilationSettings { - @ApiProperty() - @IsNotEmpty({ each: true }) - @IsString({ each: true }) - @IsOptional() - artists?: string[]; - - @ApiProperty() - @IsDefined() - @IsBoolean() - useID3CompTag: boolean; -} - -class MetadataSettings { - /** - * Use the path or the embedded metadata as main metadata source - */ - @ApiProperty({ enum: metadataSourceValue }) - @IsIn(metadataSourceValue) - source: typeof metadataSourceValue[number]; - - /** - * Exclude the other source, or use is as a fallback - */ - @ApiProperty({ enum: metadataOrderValue }) - @IsIn(metadataOrderValue) - order: typeof metadataOrderValue[number]; - - /** - * Enable the use of genres from (enabled) external providers - */ - @ApiProperty() - @IsBoolean() - useExternalProviderGenres: boolean; -} /** * Global settings of the Meelo server */ @@ -202,42 +48,4 @@ export default class Settings { @IsString() @Exclude({ toPlainOnly: true }) dataFolder: string; - - /** - * Array of RegExp string, used to match track files - */ - @ApiProperty() - @IsString({ each: true }) - @ArrayNotEmpty() - trackRegex: string[]; - - /** - * Defines the metadata parsing policy - */ - @ApiProperty({ - type: MetadataSettings, - }) - @Type(() => MetadataSettings) - @ValidateNested() - @IsDefined() - metadata: MetadataSettings; - - /** - * Settings for the providers - */ - @ApiProperty({ - type: ProvidersSettings, - }) - @Type(() => ProvidersSettings) - @ValidateNested() - @IsDefined() - providers: ProvidersSettings; - - @ApiProperty({ - type: CompilationSettings, - }) - @Type(() => CompilationSettings) - @ValidateNested() - @IsDefined() - compilations: CompilationSettings; } diff --git a/server/src/settings/settings.controller.spec.ts b/server/src/settings/settings.controller.spec.ts index bc0ff2489..ed72cdaaf 100644 --- a/server/src/settings/settings.controller.spec.ts +++ b/server/src/settings/settings.controller.spec.ts @@ -27,7 +27,6 @@ describe("Settings Controller", () => { jest.spyOn(fileService, "getFileContent").mockImplementationOnce(() => fs.readFileSync("test/assets/settings.json").toString(), ); - controller.reload(); }); afterAll(async () => { @@ -44,21 +43,7 @@ describe("Settings Controller", () => { .get("/settings") .expect(200) .expect({ - ...JSON.parse( - fs.readFileSync("test/assets/settings.json").toString(), - ), allowAnonymous: false, - providers: { - genius: { enabled: true }, - musicbrainz: { enabled: true }, - }, }); }); - - it("/GET /settings/reload", () => { - jest.spyOn(fileService, "getFileContent").mockImplementation(() => - fs.readFileSync("test/assets/settings2.json").toString(), - ); - return request(app.getHttpServer()).get("/settings/reload").expect(302); - }); }); diff --git a/server/src/settings/settings.controller.ts b/server/src/settings/settings.controller.ts index ce5cd9555..a92fad672 100644 --- a/server/src/settings/settings.controller.ts +++ b/server/src/settings/settings.controller.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { Controller, Get, HttpStatus, Redirect } from "@nestjs/common"; +import { Controller, Get } from "@nestjs/common"; import type Settings from "./models/settings"; import SettingsService from "./settings.service"; import { ApiOperation, ApiTags } from "@nestjs/swagger"; @@ -35,13 +35,4 @@ export default class SettingsController { getSettings(): Settings { return this.settingsService.settingsValues; } - - @Get("reload") - @ApiOperation({ - summary: "Reload settings", - }) - @Redirect("/settings", HttpStatus.FOUND) - reload() { - this.settingsService.loadFromFile(); - } } diff --git a/server/src/settings/settings.service.spec.ts b/server/src/settings/settings.service.spec.ts index 40f720ee0..8cc753eaf 100644 --- a/server/src/settings/settings.service.spec.ts +++ b/server/src/settings/settings.service.spec.ts @@ -14,29 +14,6 @@ import { TestingModule } from "@nestjs/testing"; describe("Settings Service", () => { let settingsService: SettingsService; let fileManagerService: FileManagerService; - - /** - * Runs a tests where settings are loaded from an invalid file, and an error is expected - * The test will fail if no error were thrown - * @param settingFileName the name of the setting file (not the full path, from test/assets) - * @param errorType the type of expected error - */ - function expectExceptionWhenParsing( - settingFileName: string, - errorType: any, - ) { - const testBody = () => { - jest.spyOn(fileManagerService, "getFileContent").mockImplementation( - () => - fs - .readFileSync(`test/assets/${settingFileName}`) - .toString(), - ); - settingsService.loadFromFile(); - }; - expect(testBody).toThrow(errorType); - } - let moduleRef: TestingModule; beforeAll(async () => { moduleRef = await createTestingModule({ @@ -50,99 +27,13 @@ describe("Settings Service", () => { await moduleRef.close(); }); - describe("loadFromFile", () => { + describe("Load Env", () => { it("should sets all values if valid setting file", async () => { - jest.spyOn(fileManagerService, "getFileContent").mockImplementation( - () => - fs - .readFileSync("test/assets/settings-fake-regex.json") - .toString(), - ); - settingsService.loadFromFile(); expect(settingsService.settingsValues).toMatchObject({ dataFolder: "test/assets/", meeloFolder: "test/assets/", - trackRegex: ["regex1", "regex2"], - metadata: { - source: "embedded", - order: "only", - useExternalProviderGenres: true, - }, + allowAnonymous: false, }); }); - - it("should throw because the file is not a valid JSON", async () => { - expectExceptionWhenParsing( - "settings-invalid.json", - InvalidSettingsFileException, - ); - }); - - it("should throw because the file can not be found", async () => { - expectExceptionWhenParsing( - "settings-non-existant.json.json", - SettingsFileNotFoundException, - ); - }); - - it("should throw because the file is empty", async () => { - expectExceptionWhenParsing( - "settings-empty-file.json", - InvalidSettingsFileException, - ); - }); - - it("should throw because the file is missing the regex field", async () => { - expectExceptionWhenParsing( - "settings-missing-regex.json", - MissingSettingsException, - ); - }); - - it("should throw because the file is missing the metadata", async () => { - expectExceptionWhenParsing( - "settings-missing-metadata.json", - MissingSettingsException, - ); - }); - - it("should throw because the file is missing the metadata order", async () => { - expectExceptionWhenParsing( - "settings-missing-metadata-order.json", - MissingSettingsException, - ); - }); - - it("should throw because the file is missing the metadata source", async () => { - expectExceptionWhenParsing( - "settings-missing-metadata-source.json", - MissingSettingsException, - ); - }); - - it("should throw because a nested field is missing", async () => { - expectExceptionWhenParsing( - "settings-missing-nested-value.json", - MissingSettingsException, - ); - }); - - it("should throw because the RegExp array is empty", async () => { - expectExceptionWhenParsing( - "settings-empty-regex.json", - InvalidSettingsFileException, - ); - }); - - it("should throw because a field data type is incorrect", async () => { - expectExceptionWhenParsing( - "settings-wrong-type.json", - InvalidSettingsFileException, - ); - expectExceptionWhenParsing( - "settings-wrong-type-metadata-source.json", - InvalidSettingsFileException, - ); - }); }); }); diff --git a/server/src/settings/settings.service.ts b/server/src/settings/settings.service.ts index a92f3a6b7..9ee93bd37 100644 --- a/server/src/settings/settings.service.ts +++ b/server/src/settings/settings.service.ts @@ -23,16 +23,13 @@ import { InvalidMeeloDirVarException, InvalidSettingsFileException, MissingSettingsException, - SettingsFileNotFoundException, } from "./settings.exception"; -import { join } from "path"; import { plainToClass } from "class-transformer"; import { validateSync } from "class-validator"; @Injectable() export default class SettingsService { protected settings: Settings; - private readonly configPath: string; constructor( @Inject(forwardRef(() => FileManagerService)) @@ -46,30 +43,14 @@ export default class SettingsService { ) { throw new InvalidMeeloDirVarException(meeloDir); } - this.configPath = join(meeloDir, "settings.json"); - this.loadFromFile(); + this.load(); } /** - * Loading Settings configuration from a JSON file + * Loading Settings configuration */ - loadFromFile(): void { - let object: any = {}; - - try { - object = JSON.parse( - this.fileManagerService - .getFileContent(this.configPath) - .toString(), - ); - } catch (error) { - if (error instanceof SyntaxError) { - throw new InvalidSettingsFileException(); - } - throw new SettingsFileNotFoundException(); - } + private load(): void { const uncheckedSettings = plainToClass(Settings, { - ...object, meeloFolder: process.env.INTERNAL_CONFIG_DIR!, dataFolder: process.env.INTERNAL_DATA_DIR!, allowAnonymous: process.env.ALLOW_ANONYMOUS === "1", diff --git a/server/src/song/song-group.controller.spec.ts b/server/src/song/song-group.controller.spec.ts index 2e4cef459..260aeeaa2 100644 --- a/server/src/song/song-group.controller.spec.ts +++ b/server/src/song/song-group.controller.spec.ts @@ -11,7 +11,6 @@ import { expectedArtistResponse, expectedSongGroupResponse, } from "test/expected-responses"; -import SettingsService from "src/settings/settings.service"; import { SongGroupResponse } from "./models/song-group.response"; describe("Song Group Controller", () => { @@ -28,7 +27,6 @@ describe("Song Group Controller", () => { .compile(); app = await SetupApp(module); dummyRepository = module.get(PrismaService); - module.get(SettingsService).loadFromFile(); await dummyRepository.onModuleInit(); }); diff --git a/server/src/song/song.controller.spec.ts b/server/src/song/song.controller.spec.ts index aa20f1548..ebb87dc2f 100644 --- a/server/src/song/song.controller.spec.ts +++ b/server/src/song/song.controller.spec.ts @@ -1,6 +1,6 @@ import { createTestingModule } from "test/test-module"; import { TestingModule } from "@nestjs/testing"; -import type { Lyrics, Song, Track } from "src/prisma/models"; +import type { Lyrics, Song } from "src/prisma/models"; import PrismaService from "src/prisma/prisma.service"; import request from "supertest"; import { INestApplication } from "@nestjs/common"; @@ -12,9 +12,7 @@ import { expectedSongResponse, expectedArtistResponse, expectedTrackResponse, - expectedReleaseResponse, } from "test/expected-responses"; -import SettingsService from "src/settings/settings.service"; import { IllustrationType, SongType } from "@prisma/client"; import Slug from "src/slug/slug"; @@ -36,7 +34,6 @@ describe("Song Controller", () => { app = await SetupApp(module); dummyRepository = module.get(PrismaService); songService = module.get(SongService); - module.get(SettingsService).loadFromFile(); await dummyRepository.onModuleInit(); }); diff --git a/server/src/video/video.controller.spec.ts b/server/src/video/video.controller.spec.ts index 85cb39c59..3b7ce9ba4 100644 --- a/server/src/video/video.controller.spec.ts +++ b/server/src/video/video.controller.spec.ts @@ -11,7 +11,6 @@ import { expectedSongResponse, expectedTrackResponse, } from "test/expected-responses"; -import SettingsService from "src/settings/settings.service"; import VideoModule from "./video.module"; jest.setTimeout(60000); @@ -30,7 +29,6 @@ describe("Video Controller", () => { .compile(); app = await SetupApp(module); dummyRepository = module.get(PrismaService); - module.get(SettingsService).loadFromFile(); await dummyRepository.onModuleInit(); }); diff --git a/server/test/assets/settings-empty-file.json b/server/test/assets/settings-empty-file.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/server/test/assets/settings-empty-regex.json b/server/test/assets/settings-empty-regex.json deleted file mode 100644 index d9103dbac..000000000 --- a/server/test/assets/settings-empty-regex.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "trackRegex": [], - "metadata": { - "source": "embedded", - "order": "only" - } -} \ No newline at end of file diff --git a/server/test/assets/settings-fake-regex.json b/server/test/assets/settings-fake-regex.json deleted file mode 100644 index 8e0b4c83f..000000000 --- a/server/test/assets/settings-fake-regex.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "trackRegex": [ - "regex1", - "regex2" - ], - "metadata": { - "source": "embedded", - "order": "only", - "useExternalProviderGenres": true - }, - "providers": {}, - "compilations": { - "useID3CompTag": true, - "artists": [] - } -} \ No newline at end of file diff --git a/server/test/assets/settings-invalid.json b/server/test/assets/settings-invalid.json deleted file mode 100644 index e82516924..000000000 --- a/server/test/assets/settings-invalid.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "trackRegex": [ - "regex1", - -} \ No newline at end of file diff --git a/server/test/assets/settings-missing-metadata-order.json b/server/test/assets/settings-missing-metadata-order.json deleted file mode 100644 index fc94a2ef8..000000000 --- a/server/test/assets/settings-missing-metadata-order.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$", - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)(\\s*\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ], - "metadata": { - "source": "embedded" - } -} \ No newline at end of file diff --git a/server/test/assets/settings-missing-metadata-source.json b/server/test/assets/settings-missing-metadata-source.json deleted file mode 100644 index d6d046441..000000000 --- a/server/test/assets/settings-missing-metadata-source.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$", - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)(\\s*\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ], - "metadata": { - "order": "only" - } -} \ No newline at end of file diff --git a/server/test/assets/settings-missing-metadata.json b/server/test/assets/settings-missing-metadata.json deleted file mode 100644 index c9a84f2b0..000000000 --- a/server/test/assets/settings-missing-metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$", - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)(\\s*\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ] -} \ No newline at end of file diff --git a/server/test/assets/settings-missing-nested-value.json b/server/test/assets/settings-missing-nested-value.json deleted file mode 100644 index 47b35fdf2..000000000 --- a/server/test/assets/settings-missing-nested-value.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]+(?.+)[\\/\\\\]+(?.+)(\\s+\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\s+\\((?.*)\\)\\..*$", - "^([\\/\\\\]+.*)*[\\/\\\\]+(?.+)[\\/\\\\]+(?.+)(\\s+\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ], - "metadata": { - "source": "embedded", - "order": "only" - }, - "providers": { - "musixmatch": {}, - "genius": {}, - "musicbrainz": {} - } -} \ No newline at end of file diff --git a/server/test/assets/settings-missing-regex.json b/server/test/assets/settings-missing-regex.json deleted file mode 100644 index e7c34877a..000000000 --- a/server/test/assets/settings-missing-regex.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "metadata": { - "source": "embedded", - "order": "only" - } -} \ No newline at end of file diff --git a/server/test/assets/settings-provider-disabled.json b/server/test/assets/settings-provider-disabled.json deleted file mode 100644 index 96054eb18..000000000 --- a/server/test/assets/settings-provider-disabled.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]+(?.+)[\\/\\\\]+(?.+)(\\s+\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\s+\\((?.*)\\)\\..*$", - "^([\\/\\\\]+.*)*[\\/\\\\]+(?.+)[\\/\\\\]+(?.+)(\\s+\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ], - "metadata": { - "source": "embedded", - "order": "only", - "useExternalProviderGenres": true - }, - "providers": { - "musixmatch": {}, - "musicbrainz": { "enabled": false } - }, - "compilations": { - "useID3CompTag": true - } -} \ No newline at end of file diff --git a/server/test/assets/settings-wrong-type-metadata-source.json b/server/test/assets/settings-wrong-type-metadata-source.json deleted file mode 100644 index 429d76f7b..000000000 --- a/server/test/assets/settings-wrong-type-metadata-source.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "trackRegex": [ - "regex1" - ], - "metadata": { - "source": "lastfm", - "order": "only", - "useExternalProviderGenres": false - } -} \ No newline at end of file diff --git a/server/test/assets/settings-wrong-type-metadata-type.json b/server/test/assets/settings-wrong-type-metadata-type.json deleted file mode 100644 index eaeb32fc4..000000000 --- a/server/test/assets/settings-wrong-type-metadata-type.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trackRegex": [ - "regex1" - ], - "metadata": true -} \ No newline at end of file diff --git a/server/test/assets/settings-wrong-type.json b/server/test/assets/settings-wrong-type.json deleted file mode 100644 index eaeb32fc4..000000000 --- a/server/test/assets/settings-wrong-type.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trackRegex": [ - "regex1" - ], - "metadata": true -} \ No newline at end of file diff --git a/server/test/assets/settings.json b/server/test/assets/settings.json deleted file mode 100644 index 9e1dc24fe..000000000 --- a/server/test/assets/settings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]+(?.+)[\\/\\\\]+(?.+)(\\s+\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\s+\\((?.*)\\)\\..*$", - "^([\\/\\\\]+.*)*[\\/\\\\]+(?.+)[\\/\\\\]+(?.+)(\\s+\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ], - "metadata": { - "source": "embedded", - "order": "only", - "useExternalProviderGenres": false - }, - "providers": { - "genius": { "apiKey": "azerty" }, - "musicbrainz": {} - }, - "compilations": { - "useID3CompTag": true, - "artists": [] - } -} \ No newline at end of file diff --git a/server/test/assets/settings2.json b/server/test/assets/settings2.json deleted file mode 100644 index 5231f9a24..000000000 --- a/server/test/assets/settings2.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "trackRegex": [ - "^([\\/\\\\]+.*)*[\\/\\\\]*(?.+)[\\/\\\\]+(?.+)(\\s*\\((?\\d{4})\\))[\\/\\\\]+((?[0-9]+)-)?(?[0-9]+)\\s+(?.*)\\..*$" - ], - "metadata": { - "source": "path", - "order": "preferred", - "useExternalProviderGenres": true - }, - "providers": { - - }, - "compilations": { - "useID3CompTag": true - } -} \ No newline at end of file