mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-07 04:42:58 -05:00
[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:
@@ -39,23 +39,17 @@ export default {
|
||||
methods: {
|
||||
play: function () {
|
||||
this.$emit('close')
|
||||
webapi.search({ 'type': 'tracks', 'expression': 'path starts with "' + this.directory.path + '" 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.directory.path + '" order by path asc', false)
|
||||
},
|
||||
|
||||
queue_add: function () {
|
||||
this.$emit('close')
|
||||
webapi.search({ 'type': 'tracks', 'expression': 'path starts with "' + this.directory.path + '" order by path asc' }).then(({ data }) => {
|
||||
webapi.queue_add(data.tracks.items.map(a => a.uri).join(','))
|
||||
})
|
||||
webapi.queue_expression_add('path starts with "' + this.directory.path + '" order by path asc')
|
||||
},
|
||||
|
||||
queue_add_next: function () {
|
||||
this.$emit('close')
|
||||
webapi.search({ 'type': 'tracks', 'expression': 'path starts with "' + this.directory.path + '" order by path asc' }).then(({ data }) => {
|
||||
webapi.queue_add_next(data.tracks.items.map(a => a.uri).join(','))
|
||||
})
|
||||
webapi.queue_expression_add_next('path starts with "' + this.directory.path + '" order by path asc')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,23 +39,17 @@ export default {
|
||||
methods: {
|
||||
play: function () {
|
||||
this.$emit('close')
|
||||
webapi.library_genre_tracks(this.genre.name).then(({ data }) =>
|
||||
webapi.player_play_uri(data.tracks.items.map(a => a.uri).join(','), false)
|
||||
)
|
||||
webapi.player_play_expression('genre is "' + this.genre.name + '" and media_kind is music', false)
|
||||
},
|
||||
|
||||
queue_add: function () {
|
||||
this.$emit('close')
|
||||
webapi.library_genre_tracks(this.genre.name).then(({ data }) =>
|
||||
webapi.queue_add(data.tracks.items.map(a => a.uri).join(','))
|
||||
)
|
||||
webapi.queue_expression_add('genre is "' + this.genre.name + '" and media_kind is music')
|
||||
},
|
||||
|
||||
queue_add_next: function () {
|
||||
this.$emit('close')
|
||||
webapi.library_genre_tracks(this.genre.name).then(({ data }) =>
|
||||
webapi.queue_add_next(data.tracks.items.map(a => a.uri).join(','))
|
||||
)
|
||||
webapi.queue_expression_add_next('genre is "' + this.genre.name + '" and media_kind is music')
|
||||
},
|
||||
|
||||
open_genre: function () {
|
||||
|
||||
Reference in New Issue
Block a user