[web-src] Starting playback now explicitely turns shuffle mode on/off

Additionally some small refactoring to make starting playback for an uri
easier.
This commit is contained in:
chme
2018-11-06 21:44:01 +01:00
parent 42e04177af
commit c97f94fec2
20 changed files with 55 additions and 133 deletions

View File

@@ -67,11 +67,7 @@ export default {
methods: {
play: function () {
this.show_details_modal = false
webapi.queue_clear().then(() =>
webapi.queue_add(this.album.uri).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.album.uri, false)
},
queue_add: function () {

View File

@@ -62,11 +62,7 @@ export default {
methods: {
play: function () {
this.show_details_modal = false
webapi.queue_clear().then(() =>
webapi.queue_add(this.artist.uri).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.artist.uri, false)
},
queue_add: function () {

View File

@@ -64,29 +64,27 @@ export default {
methods: {
play: function () {
this.show_details_modal = false
webapi.queue_clear().then(() =>
webapi.library_genre(this.genre.name).then(({ data }) =>
webapi.queue_add(data.albums.items.map(a => a.uri).join(',')).then(() =>
webapi.player_play()
)
)
webapi.library_genre(this.genre.name).then(({ data }) =>
webapi.player_play_uri(data.albums.items.map(a => a.uri).join(','), false)
)
},
queue_add: function () {
this.show_details_modal = false
webapi.library_genre(this.genre.name).then(({ data }) =>
webapi.queue_add(data.albums.items.map(a => a.uri).join(','))
webapi.queue_add(data.albums.items.map(a => a.uri).join(',')).then(() =>
this.$store.dispatch('add_notification', { text: 'Genre albums appended to queue', type: 'info', timeout: 1500 })
)
)
this.$store.dispatch('add_notification', { text: 'Genre albums appended to queue', type: 'info', timeout: 1500 })
},
queue_add_next: function () {
this.show_details_modal = false
webapi.library_genre(this.genre.name).then(({ data }) =>
webapi.queue_add_next(data.albums.items.map(a => a.uri).join(','))
webapi.queue_add_next(data.albums.items.map(a => a.uri).join(',')).then(() =>
this.$store.dispatch('add_notification', { text: 'Genre albums playing next', type: 'info', timeout: 1500 })
)
)
this.$store.dispatch('add_notification', { text: 'Genre albums playing next', type: 'info', timeout: 1500 })
},
open_genre: function () {

View File

@@ -58,11 +58,7 @@ export default {
methods: {
play: function () {
this.show_details_modal = false
webapi.queue_clear().then(() =>
webapi.queue_add(this.playlist.uri).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.playlist.uri, false)
},
queue_add: function () {

View File

@@ -107,7 +107,7 @@ export default {
play: function () {
this.show_details_modal = false
webapi.player_playid(this.item.id)
webapi.player_play({ 'item_id': this.item.id })
}
}
}

View File

@@ -99,20 +99,12 @@ export default {
methods: {
play: function () {
this.show_details_modal = false
webapi.queue_clear().then(() =>
webapi.queue_add(this.context_uri).then(() =>
webapi.player_playpos(this.position)
)
)
webapi.player_play_uri(this.context_uri, false, this.position)
},
play_track: function () {
this.show_details_modal = false
webapi.queue_clear().then(() =>
webapi.queue_add(this.track.uri).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.track.uri, false)
},
queue_add: function () {

View File

@@ -68,12 +68,8 @@ export default {
methods: {
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.album.uri).then(() =>
webapi.player_play()
)
)
this.show_details_modal = false
webapi.player_play_uri(this.album.uri, false)
},
queue_add: function () {

View File

@@ -63,12 +63,8 @@ export default {
methods: {
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.artist.uri).then(() =>
webapi.player_play()
)
)
this.show_details_modal = false
webapi.player_play_uri(this.artist.uri, false)
},
queue_add: function () {

View File

@@ -68,12 +68,8 @@ export default {
methods: {
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.playlist.uri).then(() =>
webapi.player_play()
)
)
this.show_details_modal = false
webapi.player_play_uri(this.playlist.uri, false)
},
queue_add: function () {

View File

@@ -83,12 +83,8 @@ export default {
methods: {
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.context_uri).then(() =>
webapi.player_playpos(this.position)
)
)
this.show_details_modal = false
webapi.player_play_uri(this.context_uri, false, this.position)
},
queue_add: function () {