Skip to content

Commit

Permalink
fix(mopidy): Fix album artist parsing #110
Browse files Browse the repository at this point in the history
Should be using mapped artist string name rather than model but cannot test due to mopidy being difficult. Hopefully this works?
  • Loading branch information
FoxxMD committed Nov 30, 2023
1 parent c77e435 commit 6b17bab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/sources/MopidySource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class MopidySource extends MemorySource {
performers = []
} = obj;

let artists = artistsVal === null ? [] : artistsVal;
let artists: models.Artist[] = artistsVal === null ? [] : artistsVal;
let album: models.Album = albumVal === null ? {} as models.Album : albumVal;
if (this.albumBlacklist.length > 0 && album.name !== undefined && this.albumBlacklist.some(x => album.name.toLocaleLowerCase().includes(x))) {
album = {} as models.Album;
Expand All @@ -145,7 +145,7 @@ export class MopidySource extends MemorySource {
artists: albumArtists = []
} = album as models.Album;

let actualAlbumArtists = [];
let actualAlbumArtists: models.Artist[] = [];
if ((artists.length === 0 || artists.every(x => x.name.toLocaleLowerCase().includes('various'))) && albumArtists.length > 0) {
artists = albumArtists;
} else {
Expand All @@ -162,7 +162,7 @@ export class MopidySource extends MemorySource {
data: {
track: name,
album: albumName,
albumArtists: actualAlbumArtists,
albumArtists: actualAlbumArtists.length > 0 ? actualAlbumArtists.map(x => x.name) : [],
artists: artists.length > 0 ? artists.map(x => x.name) : [],
duration: Math.round(length / 1000),
playDate: dayjs()
Expand Down

0 comments on commit 6b17bab

Please sign in to comment.