"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,
|
||||
preloadDelay: 15,
|
||||
listenDelay: 15,
|
||||
listeningRecorded: null,
|
||||
listeningIsSubmitted: false,
|
||||
soundsCache: [],
|
||||
soundId: null,
|
||||
playTimeout: null,
|
||||
|
@ -617,6 +617,11 @@ export default {
|
|||
this.stop()
|
||||
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/resetErrorCount')
|
||||
self.$store.commit('player/errored', false)
|
||||
|
@ -723,9 +728,9 @@ export default {
|
|||
this.nextTrackPreloaded = true
|
||||
}
|
||||
if (t > (d / 2)) {
|
||||
if (this.listeningRecorded !== this.currentTrack) {
|
||||
this.listeningRecorded = this.currentTrack
|
||||
if (!this.listeningIsSubmitted) {
|
||||
this.$store.dispatch('player/trackListened', this.currentTrack)
|
||||
this.listeningIsSubmitted = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue