[web] Remove button section when not present

This commit is contained in:
Alain Nussbaumer 2025-02-15 20:15:58 +01:00
parent b477121dda
commit 570c663178
3 changed files with 64 additions and 59 deletions

View File

@ -2,7 +2,7 @@
<modal-dialog :actions="actions" :show="show" @close="$emit('close')">
<template #content>
<list-properties :item="item">
<template #buttons>
<template v-if="buttons.length" #buttons>
<div class="buttons">
<a
v-for="button in buttons"
@ -27,7 +27,7 @@ export default {
name: 'ModalDialogPlayable',
components: { ListProperties, ModalDialog },
props: {
buttons: { default: null, type: Array },
buttons: { default: () => [], type: Array },
item: { required: true, type: Object },
show: Boolean
},

View File

@ -28,17 +28,12 @@ export default {
},
computed: {
buttons() {
if (this.item.media_kind === 'podcast') {
if (this.item.play_count > 0) {
return [{ label: 'dialog.track.mark-as-new', handler: this.mark_new }]
}
if (this.item.play_count === 0) {
return [
{ label: 'dialog.track.mark-as-played', handler: this.mark_played }
]
}
}
if (this.item.media_kind !== 'podcast') {
return []
}
return this.item.play_count > 0
? [{ label: 'dialog.track.mark-as-new', handler: this.mark_new }]
: [{ label: 'dialog.track.mark-as-played', handler: this.mark_played }]
},
playable() {
return {

View File

@ -10,6 +10,7 @@
class="content"
v-text="$t('page.settings.artwork.explanation-1')"
/>
<div class="content">
<control-setting-switch category="artwork" name="streamurl_ignore">
<template #label>
<span v-text="$t('page.settings.artwork.streaming')" />
@ -23,10 +24,12 @@
<span v-text="$t('page.settings.artwork.show-coverart')" />
</template>
</control-setting-switch>
</div>
<div
class="content"
v-text="$t('page.settings.artwork.explanation-2')"
/>
<div class="content">
<control-setting-switch
v-if="spotify.spotify_logged_in"
category="artwork"
@ -35,7 +38,9 @@
<template #label>
<span v-text="$t('page.settings.artwork.spotify')" />
<a href="https://www.spotify.com/" target="_blank">
<span class="icon"><mdicon name="open-in-new" size="16" /></span>
<span class="icon">
<mdicon name="open-in-new" size="16" />
</span>
</a>
</template>
</control-setting-switch>
@ -46,7 +51,9 @@
<template #label>
<span v-text="$t('page.settings.artwork.discogs')" />
<a href="https://www.discogs.com/" target="_blank">
<span class="icon"><mdicon name="open-in-new" size="16" /></span>
<span class="icon">
<mdicon name="open-in-new" size="16" />
</span>
</a>
</template>
</control-setting-switch>
@ -57,10 +64,13 @@
<template #label>
<span v-text="$t('page.settings.artwork.coverartarchive')" />
<a href="https://coverartarchive.org/" target="_blank">
<span class="icon"><mdicon name="open-in-new" size="16" /></span>
<span class="icon">
<mdicon name="open-in-new" size="16" />
</span>
</a>
</template>
</control-setting-switch>
</div>
</template>
</content-with-heading>
</div>