From a71f86b0006c35b36d12adb29743a2ddb2377d48 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Mon, 31 May 2021 22:30:16 +0200 Subject: [PATCH] Prefer PHYSICAL_RELEASE_DATE to DIGITAL_RELEASE_DATE --- deemix/itemgen.js | 1 + deemix/types/Album.js | 4 ++++ deemix/types/Track.js | 1 + 3 files changed, 6 insertions(+) diff --git a/deemix/itemgen.js b/deemix/itemgen.js index 7bf8db0..8886612 100644 --- a/deemix/itemgen.js +++ b/deemix/itemgen.js @@ -71,6 +71,7 @@ async function generateAlbumItem(dz, id, bitrate, rootArtist){ let albumAPI_gw = await dz.gw.get_album(id) albumAPI.nb_disk = albumAPI_gw.NUMBER_DISK albumAPI.copyright = albumAPI_gw.COPYRIGHT + albumAPI.release_date = albumAPI_gw.PHYSICAL_RELEASE_DATE albumAPI.root_artist = rootArtist // If the album is a single download as a track diff --git a/deemix/types/Album.js b/deemix/types/Album.js index 21d11ea..91c377b 100644 --- a/deemix/types/Album.js +++ b/deemix/types/Album.js @@ -128,6 +128,10 @@ class Album { let explicitLyricsStatus = albumAPI_gw.EXPLICIT_ALBUM_CONTENT.EXPLICIT_LYRICS_STATUS this.explicit = [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT].includes(explicitLyricsStatus) + this.addExtraAlbumGWData(albumAPI_gw) + } + + addExtraAlbumGWData(albumAPI_gw){ if (this.pic.md5 == ""){ this.pic.md5 = albumAPI_gw.ALB_PICTURE } diff --git a/deemix/types/Track.js b/deemix/types/Track.js index dc87d9a..ce6c4ab 100644 --- a/deemix/types/Track.js +++ b/deemix/types/Track.js @@ -157,6 +157,7 @@ class Track { } // Fill missing data + if (albumAPI_gw) this.album.addExtraAlbumGWData(albumAPI_gw) if (this.album.date && !this.date) this.date = this.album.date if (!this.album.discTotal) this.album.discTotal = albumAPI_gw.NUMBER_DISK || "1" if (!this.copyright) this.copyright = albumAPI_gw.COPYRIGHT