"Repeatedly listening to a track submits a scrobble only the first time"
This commit is contained in:
parent
f3c286ba0e
commit
07e51bcfc4
|
@ -0,0 +1 @@
|
||||||
|
Fixed single listening submission when repeating a song (#1312)
|
|
@ -366,7 +366,7 @@ export default {
|
||||||
maxPreloaded: 3,
|
maxPreloaded: 3,
|
||||||
preloadDelay: 15,
|
preloadDelay: 15,
|
||||||
listenDelay: 15,
|
listenDelay: 15,
|
||||||
listeningRecorded: null,
|
listeningIsSubmitted: false,
|
||||||
soundsCache: [],
|
soundsCache: [],
|
||||||
soundId: null,
|
soundId: null,
|
||||||
playTimeout: null,
|
playTimeout: null,
|
||||||
|
@ -617,6 +617,11 @@ export default {
|
||||||
this.stop()
|
this.stop()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const t = self.currentSound.seek()
|
||||||
|
const d = self.currentSound.duration()
|
||||||
|
if (t <= (d / 2)) {
|
||||||
|
self.listeningIsSubmitted = false
|
||||||
|
}
|
||||||
self.$store.commit('player/isLoadingAudio', false)
|
self.$store.commit('player/isLoadingAudio', false)
|
||||||
self.$store.commit('player/resetErrorCount')
|
self.$store.commit('player/resetErrorCount')
|
||||||
self.$store.commit('player/errored', false)
|
self.$store.commit('player/errored', false)
|
||||||
|
@ -723,9 +728,9 @@ export default {
|
||||||
this.nextTrackPreloaded = true
|
this.nextTrackPreloaded = true
|
||||||
}
|
}
|
||||||
if (t > (d / 2)) {
|
if (t > (d / 2)) {
|
||||||
if (this.listeningRecorded !== this.currentTrack) {
|
if (!this.listeningIsSubmitted) {
|
||||||
this.listeningRecorded = this.currentTrack
|
|
||||||
this.$store.dispatch('player/trackListened', this.currentTrack)
|
this.$store.dispatch('player/trackListened', this.currentTrack)
|
||||||
|
this.listeningIsSubmitted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue