Skip to content
Snippets Groups Projects
Commit e44a9c43 authored by Agate's avatar Agate :speech_balloon:
Browse files

Fix #1080: broken artist and album pages

parent 8b0ce6ad
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,8 @@ export default {
return this.artist.albums.filter((a) => {
return a.is_playable === true
}).length > 0
} else if (this.album) {
return this.album.is_playable
} else if (this.tracks) {
return this.tracks.filter((t) => {
return t.uploads && t.uploads.length > 0
......@@ -229,6 +231,7 @@ export default {
jQuery(self.$el).find('.ui.dropdown').dropdown('hide')
},
addNext (next) {
console.log('CLICKED')
let self = this
let wasEmpty = this.$store.state.queue.tracks.length === 0
this.getPlayableTracks().then((tracks) => {
......@@ -253,7 +256,6 @@ export default {
},
watch: {
clicked () {
let self = this
this.$nextTick(() => {
jQuery(this.$el).find('.ui.dropdown').dropdown({
......
......@@ -169,13 +169,16 @@ export default {
methods: {
async fetchData() {
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 artistResponse = await axios.get(`artists/${albumResponse.data.artist.id}/`)
this.artist = artistResponse.data
if (this.artist.channel) {
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.isLoading = false
......
......@@ -195,9 +195,7 @@ export default {
self.nextAlbumsUrl = response.data.next
self.totalAlbums = response.data.count
let parsed = JSON.parse(JSON.stringify(response.data.results))
self.albums = parsed.map(album => {
return backend.Album.clean(album)
})
self.albums = parsed
})
await trackPromise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment