mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 21:49:48 -05:00
[web-src] Always show cover artwork in album dialog
If no artwork is available or not yet loaded, falls back to the generated cover artwork. Avoids jumping of dialog after loading of remote image finished.
This commit is contained in:
@@ -2,19 +2,11 @@
|
||||
<section>
|
||||
<div v-if="now_playing.id > 0" class="fd-is-fullheight">
|
||||
<div class="fd-is-expanded">
|
||||
<figure @click="open_dialog(now_playing)" class="fd-cover-image">
|
||||
<img
|
||||
v-show="artwork_visible"
|
||||
:src="artwork_url"
|
||||
class="fd-has-action"
|
||||
@load="artwork_loaded"
|
||||
@error="artwork_error">
|
||||
<cover-placeholder
|
||||
v-show="!artwork_visible"
|
||||
:artist="now_playing.artist"
|
||||
:album="now_playing.album"
|
||||
class="fd-has-action" />
|
||||
</figure>
|
||||
<cover-artwork @click="open_dialog(now_playing)"
|
||||
:artwork_url="now_playing.artwork_url"
|
||||
:artist="now_playing.artist"
|
||||
:album="now_playing.album"
|
||||
class="fd-cover-image fd-has-action" />
|
||||
</div>
|
||||
<div class="fd-has-padding-left-right">
|
||||
<div class="container has-text-centered">
|
||||
@@ -68,19 +60,18 @@
|
||||
<script>
|
||||
import ModalDialogQueueItem from '@/components/ModalDialogQueueItem'
|
||||
import RangeSlider from 'vue-range-slider'
|
||||
import CoverPlaceholder from '@/components/CoverPlaceholder'
|
||||
import CoverArtwork from '@/components/CoverArtwork'
|
||||
import webapi from '@/webapi'
|
||||
import * as types from '@/store/mutation_types'
|
||||
|
||||
export default {
|
||||
name: 'PageNowPlaying',
|
||||
components: { ModalDialogQueueItem, RangeSlider, CoverPlaceholder },
|
||||
components: { ModalDialogQueueItem, RangeSlider, CoverArtwork },
|
||||
|
||||
data () {
|
||||
return {
|
||||
item_progress_ms: 0,
|
||||
interval_id: 0,
|
||||
artwork_visible: false,
|
||||
|
||||
show_details_modal: false,
|
||||
selected_item: {}
|
||||
@@ -113,10 +104,6 @@ export default {
|
||||
return this.$store.getters.now_playing
|
||||
},
|
||||
|
||||
artwork_url: function () {
|
||||
return webapi.artwork_url_append_size_params(this.now_playing.artwork_url)
|
||||
},
|
||||
|
||||
settings_option_show_composer_now_playing () {
|
||||
return this.$store.getters.settings_option_show_composer_now_playing
|
||||
},
|
||||
@@ -150,14 +137,6 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
artwork_loaded: function () {
|
||||
this.artwork_visible = true
|
||||
},
|
||||
|
||||
artwork_error: function () {
|
||||
this.artwork_visible = false
|
||||
},
|
||||
|
||||
open_dialog: function (item) {
|
||||
this.selected_item = item
|
||||
this.show_details_modal = true
|
||||
|
||||
Reference in New Issue
Block a user