[web-src] Add buttons to mark podcast track as new/played
This commit is contained in:
parent
78ca795814
commit
52d685d6be
|
@ -132,13 +132,17 @@ export default {
|
|||
},
|
||||
|
||||
mark_new: function () {
|
||||
this.$emit('close')
|
||||
// TODO
|
||||
webapi.library_track_update(this.track.id, { 'play_count': 'reset' }).then(() => {
|
||||
this.$emit('play_count_changed')
|
||||
this.$emit('close')
|
||||
})
|
||||
},
|
||||
|
||||
mark_played: function () {
|
||||
this.$emit('close')
|
||||
// TODO
|
||||
webapi.library_track_update(this.track.id, { 'play_count': 'increment' }).then(() => {
|
||||
this.$emit('play_count_changed')
|
||||
this.$emit('close')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</a>
|
||||
</template>
|
||||
</list-item-track>
|
||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" @play_count_changed="reload_tracks" />
|
||||
</template>
|
||||
</content-with-heading>
|
||||
</template>
|
||||
|
@ -73,6 +73,12 @@ export default {
|
|||
open_dialog: function (track) {
|
||||
this.selected_track = track
|
||||
this.show_details_modal = true
|
||||
},
|
||||
|
||||
reload_tracks: function () {
|
||||
webapi.library_podcast_episodes(this.album.id).then(({ data }) => {
|
||||
this.tracks = data.tracks.items
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</a>
|
||||
</template>
|
||||
</list-item-track>
|
||||
<modal-dialog-track :show="show_track_details_modal" :track="selected_track" @close="show_track_details_modal = false" />
|
||||
<modal-dialog-track :show="show_track_details_modal" :track="selected_track" @close="show_track_details_modal = false" @play_count_changed="reload_new_episodes" />
|
||||
</template>
|
||||
</content-with-heading>
|
||||
|
||||
|
@ -93,6 +93,12 @@ export default {
|
|||
open_album_dialog: function (album) {
|
||||
this.selected_album = album
|
||||
this.show_album_details_modal = true
|
||||
},
|
||||
|
||||
reload_new_episodes: function () {
|
||||
webapi.library_podcasts_new_episodes().then(({ data }) => {
|
||||
this.new_episodes = data.tracks
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,6 +238,14 @@ export default {
|
|||
return axios.get('/api/library/playlists/' + playlistId + '/tracks')
|
||||
},
|
||||
|
||||
library_track (trackId) {
|
||||
return axios.get('/api/library/tracks/' + trackId)
|
||||
},
|
||||
|
||||
library_track_update (trackId, attributes = {}) {
|
||||
return axios.put('/api/library/tracks/' + trackId, undefined, { params: attributes })
|
||||
},
|
||||
|
||||
library_files (directory = undefined) {
|
||||
var filesParams = { 'directory': directory }
|
||||
return axios.get('/api/library/files', {
|
||||
|
|
Loading…
Reference in New Issue