Merge pull request #689 from chme/web_podcasts

Improve podcasts views in player web interface
This commit is contained in:
Christian Meffert
2019-02-13 15:47:22 +01:00
committed by GitHub
10 changed files with 164 additions and 19 deletions

View File

@@ -1,12 +1,13 @@
<template functional>
<div class="media" :id="'index_' + props.track.title_sort.charAt(0).toUpperCase()">
<div class="media" :id="'index_' + props.track.title_sort.charAt(0).toUpperCase()" :class="{ 'with-progress': slots().progress }">
<figure class="media-left fd-has-action" v-if="slots().icon" @click="listeners.click">
<slot name="icon"></slot>
</figure>
<div class="media-content fd-has-action is-clipped" @click="listeners.click">
<h1 class="title is-6">{{ props.track.title }}</h1>
<h1 class="title is-6" :class="{ 'has-text-grey': props.track.media_kind === 'podcast' && props.track.play_count > 0 }">{{ props.track.title }}</h1>
<h2 class="subtitle is-7 has-text-grey"><b>{{ props.track.artist }}</b></h2>
<h2 class="subtitle is-7 has-text-grey">{{ props.track.album }}</h2>
<slot name="progress"></slot>
</div>
<div class="media-right">
<slot name="actions"></slot>

View File

@@ -12,6 +12,10 @@
<p class="subtitle">
{{ track.artist }}
</p>
<div class="buttons" v-if="track.media_kind === 'podcast'">
<a class="button is-small" v-if="track.play_count > 0" @click="mark_new">Mark as new</a>
<a class="button is-small" v-if="track.play_count === 0" @click="mark_played">Mark as played</a>
</div>
<div class="content is-small">
<p>
<span class="heading">Album</span>
@@ -125,6 +129,20 @@ export default {
open_artist: function () {
this.$emit('close')
this.$router.push({ path: '/music/artists/' + this.track.album_artist_id })
},
mark_new: function () {
webapi.library_track_update(this.track.id, { 'play_count': 'reset' }).then(() => {
this.$emit('play_count_changed')
this.$emit('close')
})
},
mark_played: function () {
webapi.library_track_update(this.track.id, { 'play_count': 'increment' }).then(() => {
this.$emit('play_count_changed')
this.$emit('close')
})
}
}
}