Fix #1080: broken artist and album pages
This commit is contained in:
parent
8b0ce6ad33
commit
e44a9c4363
|
@ -111,6 +111,8 @@ export default {
|
||||||
return this.artist.albums.filter((a) => {
|
return this.artist.albums.filter((a) => {
|
||||||
return a.is_playable === true
|
return a.is_playable === true
|
||||||
}).length > 0
|
}).length > 0
|
||||||
|
} else if (this.album) {
|
||||||
|
return this.album.is_playable
|
||||||
} else if (this.tracks) {
|
} else if (this.tracks) {
|
||||||
return this.tracks.filter((t) => {
|
return this.tracks.filter((t) => {
|
||||||
return t.uploads && t.uploads.length > 0
|
return t.uploads && t.uploads.length > 0
|
||||||
|
@ -229,6 +231,7 @@ export default {
|
||||||
jQuery(self.$el).find('.ui.dropdown').dropdown('hide')
|
jQuery(self.$el).find('.ui.dropdown').dropdown('hide')
|
||||||
},
|
},
|
||||||
addNext (next) {
|
addNext (next) {
|
||||||
|
console.log('CLICKED')
|
||||||
let self = this
|
let self = this
|
||||||
let wasEmpty = this.$store.state.queue.tracks.length === 0
|
let wasEmpty = this.$store.state.queue.tracks.length === 0
|
||||||
this.getPlayableTracks().then((tracks) => {
|
this.getPlayableTracks().then((tracks) => {
|
||||||
|
@ -253,7 +256,6 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
clicked () {
|
clicked () {
|
||||||
|
|
||||||
let self = this
|
let self = this
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
jQuery(this.$el).find('.ui.dropdown').dropdown({
|
jQuery(this.$el).find('.ui.dropdown').dropdown({
|
||||||
|
|
|
@ -169,13 +169,16 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async fetchData() {
|
async fetchData() {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
let tracksResponse = axios.get(`tracks/`, {params: {ordering: 'disc_number,position', album: this.id, page_size: 100}})
|
||||||
let albumResponse = await axios.get(`albums/${this.id}/`, {params: {refresh: 'true'}})
|
let albumResponse = await axios.get(`albums/${this.id}/`, {params: {refresh: 'true'}})
|
||||||
let artistResponse = await axios.get(`artists/${albumResponse.data.artist.id}/`)
|
let artistResponse = await axios.get(`artists/${albumResponse.data.artist.id}/`)
|
||||||
this.artist = artistResponse.data
|
this.artist = artistResponse.data
|
||||||
if (this.artist.channel) {
|
if (this.artist.channel) {
|
||||||
this.artist.channel.artist = this.artist
|
this.artist.channel.artist = this.artist
|
||||||
}
|
}
|
||||||
this.object = backend.Album.clean(albumResponse.data)
|
tracksResponse = await tracksResponse
|
||||||
|
this.object = albumResponse.data
|
||||||
|
this.object.tracks = tracksResponse.data.results
|
||||||
this.discs = this.object.tracks.reduce(groupByDisc, [])
|
this.discs = this.object.tracks.reduce(groupByDisc, [])
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
||||||
|
|
|
@ -195,9 +195,7 @@ export default {
|
||||||
self.nextAlbumsUrl = response.data.next
|
self.nextAlbumsUrl = response.data.next
|
||||||
self.totalAlbums = response.data.count
|
self.totalAlbums = response.data.count
|
||||||
let parsed = JSON.parse(JSON.stringify(response.data.results))
|
let parsed = JSON.parse(JSON.stringify(response.data.results))
|
||||||
self.albums = parsed.map(album => {
|
self.albums = parsed
|
||||||
return backend.Album.clean(album)
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
})
|
||||||
await trackPromise
|
await trackPromise
|
||||||
|
|
Loading…
Reference in New Issue