fix for "Music" genre in different languages
This commit is contained in:
parent
44eaa5ee8d
commit
f636524dab
1 changed files with 6 additions and 2 deletions
|
@ -91,7 +91,8 @@
|
||||||
years: [],
|
years: [],
|
||||||
loaded: {
|
loaded: {
|
||||||
id: -1
|
id: -1
|
||||||
}
|
},
|
||||||
|
musicTypeGenre: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
@ -101,9 +102,12 @@
|
||||||
this.years.reverse()
|
this.years.reverse()
|
||||||
localStorage.setItem("seenReplay", true)
|
localStorage.setItem("seenReplay", true)
|
||||||
this.getReplayYear();
|
this.getReplayYear();
|
||||||
|
const musicGenre = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/genres/34`)
|
||||||
|
this.musicTypeGenre = musicGenre.data.data[0].attributes.name
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
songsToArray(songsData) {
|
songsToArray(songsData) {
|
||||||
|
let self = this
|
||||||
let songs = []
|
let songs = []
|
||||||
let topGenres = {}
|
let topGenres = {}
|
||||||
let genrePlayCount = 0;
|
let genrePlayCount = 0;
|
||||||
|
@ -113,7 +117,7 @@
|
||||||
songs.push(song)
|
songs.push(song)
|
||||||
genrePlayCount += song.attributes.playCount
|
genrePlayCount += song.attributes.playCount
|
||||||
song.attributes.genreNames.forEach(function (genre) {
|
song.attributes.genreNames.forEach(function (genre) {
|
||||||
if (genre != "Music") {
|
if (genre != self.musicTypeGenre) {
|
||||||
if (topGenres[genre] == undefined) {
|
if (topGenres[genre] == undefined) {
|
||||||
topGenres[genre] = song.attributes.playCount
|
topGenres[genre] = song.attributes.playCount
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue