This commit is contained in:
UnbreakCode 2022-04-03 03:22:03 +02:00
parent c3e15b236e
commit e6796ba4ad
2 changed files with 4 additions and 6 deletions

View file

@ -288,9 +288,8 @@
getAlbumGenre: function () { getAlbumGenre: function () {
if (this.data.type.includes('albums')) { if (this.data.type.includes('albums')) {
let date = this.data.attributes.releaseDate; let date = this.data.attributes.releaseDate;
if (date == null || date === "") return ""; if (date == null || date === "") return "";
const releaseDate = new Date(date); return `${this.data.relationships.tracks.data[0].attributes.genreNames[0]} · ${new Date(date).getFullYear()}`
return `${this.data.relationships.tracks.data[0].attributes.genreNames[0]} · ${releaseDate.getFullYear()}`
} }
}, },
async isInLibrary() { async isInLibrary() {

View file

@ -312,9 +312,8 @@
getAlbumGenre: function () { getAlbumGenre: function () {
if (this.data.type.includes('albums')) { if (this.data.type.includes('albums')) {
let date = this.data.attributes.releaseDate; let date = this.data.attributes.releaseDate;
if (date == null || date === "") return ""; if (date == null || date === "") return "";
const releaseDate = new Date(date); return `${this.data.relationships.tracks.data[0].attributes.genreNames[0]} · ${new Date(date).getFullYear()}`
return `${this.data.relationships.tracks.data[0].attributes.genreNames[0]} · ${releaseDate.getFullYear()}`
} }
}, },
async isInLibrary() { async isInLibrary() {