diff --git a/changes/changelog.d/1312.bugfix b/changes/changelog.d/1312.bugfix new file mode 100644 index 000000000..d1c9fbbb1 --- /dev/null +++ b/changes/changelog.d/1312.bugfix @@ -0,0 +1 @@ +Fixed single listening submission when repeating a song (#1312) diff --git a/front/src/components/audio/Player.vue b/front/src/components/audio/Player.vue index 0c940deef..a7c2ec322 100644 --- a/front/src/components/audio/Player.vue +++ b/front/src/components/audio/Player.vue @@ -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 } } }