Merge branch '95-looping-one-track' into 'develop'

Fix #95: Now loop properly on queue when we only have one track

Closes #95

See merge request funkwhale/funkwhale!72
This commit is contained in:
Eliot Berriot 2018-02-28 17:46:51 +00:00
commit 3db2f380d7
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1 @@
Now loop properly on queue when we only have one track (#95)

View File

@ -102,9 +102,10 @@ export default {
if (this.$refs.audio) {
this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime)
}
}, 1000),
}, 250),
ended: function () {
if (this.looping === 1) {
let onlyTrack = this.$store.state.queue.tracks.length === 1
if (this.looping === 1 || (onlyTrack && this.looping === 2)) {
this.setCurrentTime(0)
this.$refs.audio.play()
} else {