mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-29 16:53:43 -04:00
[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 () {
|
mark_new: function () {
|
||||||
this.$emit('close')
|
webapi.library_track_update(this.track.id, { 'play_count': 'reset' }).then(() => {
|
||||||
// TODO
|
this.$emit('play_count_changed')
|
||||||
|
this.$emit('close')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
mark_played: function () {
|
mark_played: function () {
|
||||||
this.$emit('close')
|
webapi.library_track_update(this.track.id, { 'play_count': 'increment' }).then(() => {
|
||||||
// TODO
|
this.$emit('play_count_changed')
|
||||||
|
this.$emit('close')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</list-item-track>
|
</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>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
</template>
|
</template>
|
||||||
@ -73,6 +73,12 @@ export default {
|
|||||||
open_dialog: function (track) {
|
open_dialog: function (track) {
|
||||||
this.selected_track = track
|
this.selected_track = track
|
||||||
this.show_details_modal = true
|
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>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</list-item-track>
|
</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>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
|
|
||||||
@ -93,6 +93,12 @@ export default {
|
|||||||
open_album_dialog: function (album) {
|
open_album_dialog: function (album) {
|
||||||
this.selected_album = album
|
this.selected_album = album
|
||||||
this.show_album_details_modal = true
|
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')
|
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) {
|
library_files (directory = undefined) {
|
||||||
var filesParams = { 'directory': directory }
|
var filesParams = { 'directory': directory }
|
||||||
return axios.get('/api/library/files', {
|
return axios.get('/api/library/files', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user