[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

@@ -5,12 +5,16 @@
<a class="title is-4 has-text-link has-text-weight-normal" @click="open_artist">{{ album.artist }}</a>
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
</a>
<div class="buttons is-centered">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
<!--
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon"><i class="mdi mdi-play"></i></span> <span>Play</span>
</a>
-->
</div>
</template>
<template slot="content">
<p class="heading has-text-centered-mobile">{{ album.track_count }} tracks</p>
@@ -58,11 +62,7 @@ export default {
},
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.album.uri).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.album.uri, true)
}
}
}

View File

@@ -5,10 +5,7 @@
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
</template>
<template slot="content">
@@ -56,11 +53,7 @@ export default {
},
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.albums.items.map(a => a.uri).join(',')).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.albums.items.map(a => a.uri).join(','), true)
}
}
}

View File

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

View File

@@ -9,10 +9,7 @@
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
</template>
<template slot="content">
@@ -69,11 +66,7 @@ export default {
methods: {
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.genreAlbums.items.map(a => a.uri).join(',')).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.genreAlbums.items.map(a => a.uri).join(','), true)
}
}
}

View File

@@ -5,10 +5,7 @@
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
</template>
<template slot="content">
@@ -52,11 +49,7 @@ export default {
methods: {
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.playlist.uri).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.playlist.uri, true)
}
}
}

View File

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

View File

@@ -6,10 +6,7 @@
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
</template>
<template slot="content">
@@ -59,11 +56,7 @@ export default {
},
play: function () {
webapi.queue_clear().then(() =>
webapi.queue_add(this.tracks.items.map(a => a.uri).join(',')).then(() =>
webapi.player_play()
)
)
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), true)
}
}
}

View File

@@ -6,10 +6,7 @@
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
</template>
<template slot="content">
@@ -56,12 +53,8 @@ export default {
},
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, true)
}
}
}

View File

@@ -5,10 +5,7 @@
</template>
<template slot="heading-right">
<a class="button is-small is-dark is-rounded" @click="play">
<span class="icon">
<i class="mdi mdi-play"></i>
</span>
<span>Play</span>
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
</a>
</template>
<template slot="content">
@@ -84,12 +81,8 @@ export default {
},
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, true)
}
}
}