From cb62a6a65992712e68bf407b35a5752b7d81189c Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Sat, 24 Jan 2026 19:24:48 +0000 Subject: [PATCH] fix(musicbrainz): Check for undefined status #458 --- src/backend/common/transforms/MusicbrainzTransformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/common/transforms/MusicbrainzTransformer.ts b/src/backend/common/transforms/MusicbrainzTransformer.ts index abdcb016..beb202d7 100644 --- a/src/backend/common/transforms/MusicbrainzTransformer.ts +++ b/src/backend/common/transforms/MusicbrainzTransformer.ts @@ -914,7 +914,7 @@ export const rankReleasesByPriority = (list: IRecordingMatch[], stageConfig: Mus artistScore = artistRes[0] * (artistWeight + (artistRes[1] > 0 ? 0.05 : 0)); } const releases = (x.releases ?? []).map((a) => { - const statAScore = releaseStatusPriority.findIndex(x => x === a.status.toLocaleLowerCase()) + 1; + const statAScore = releaseStatusPriority.findIndex(x => a.status !== undefined && x === a.status.toLocaleLowerCase()) + 1; const grpPAScore = releaseGroupPrimaryTypePriority.findIndex(x => x === a["release-group"]?.["primary-type"]?.toLocaleLowerCase()) + 1; const grpSAScore = (a["release-group"]?.["secondary-types"] ?? []).reduce((acc: number, curr: MBReleaseGroupSecondaryType) => acc + releaseGroupSecondaryTypePriority.findIndex(x => x === (curr as MBReleaseGroupSecondaryType).toLocaleLowerCase()) + 1,0); const countryAScore = releaseCountryPriority.findIndex(x => a.country === undefined ? false : x === a.country.toLocaleLowerCase()) + 1; -- 2.51.2