Verified Commit c53f03c4 authored by Agate's avatar Agate 💬

Fix #457: Fixed crash on artist pages when no cover is available

parent 75852e53
Fixed crash on artist pages when no cover is available (#457)
<template> <template>
<div> <div v-title="labels.title">
<div v-if="isLoading" class="ui vertical segment" v-title="labels.title"> <div v-if="isLoading" class="ui vertical segment">
<div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div>
</div> </div>
<template v-if="artist"> <template v-if="artist">
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
self.artist = response.data self.artist = response.data
self.isLoading = false self.isLoading = false
self.isLoadingAlbums = true self.isLoadingAlbums = true
axios.get('albums/', {params: {artist: this.id, ordering: '-release_date'}}).then((response) => { axios.get('albums/', {params: {artist: self.id, ordering: '-release_date'}}).then((response) => {
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.map((album) => {
return backend.Album.clean(album) return backend.Album.clean(album)
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
})[0] })[0]
}, },
headerStyle () { headerStyle () {
if (!this.cover.original) { if (!this.cover || !this.cover.original) {
return '' return ''
} }
return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.cover.original) + ')' return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.cover.original) + ')'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment