[web-src] Make use of extended queue/item/add endpoint

Should speed up starting playback from the web ui (reduces number of web 
api requests)
This commit is contained in:
chme
2019-02-22 13:20:04 +01:00
parent d931385886
commit df455ce069
6 changed files with 55 additions and 37 deletions

View File

@@ -153,9 +153,7 @@ export default {
},
play: function () {
webapi.search({ 'type': 'tracks', 'expression': 'path starts with "' + this.current_directory + '" order by path asc' }).then(({ data }) => {
webapi.player_play_uri(data.tracks.items.map(a => a.uri).join(','), false)
})
webapi.player_play_expression('path starts with "' + this.current_directory + '" order by path asc', false)
},
play_track: function (position) {

View File

@@ -85,9 +85,7 @@ export default {
},
play: function () {
webapi.library_genre_tracks(this.name).then(({ data }) =>
webapi.player_play_uri(data.tracks.items.map(a => a.uri).join(','), true)
)
webapi.player_play_expression('genre is "' + this.name + '" and media_kind is music', true)
},
open_album: function (album) {

View File

@@ -84,11 +84,11 @@ export default {
},
play: function () {
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), true)
webapi.player_play_expression('genre is "' + this.genre + '" and media_kind is music', true)
},
play_track: function (position) {
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), false, position)
webapi.player_play_expression('genre is "' + this.genre + '" and media_kind is music', false, position)
},
open_dialog: function (track) {