See #1060: register listening earlier, instead of at the end of the track

environments/review-front-list-6rg6z1/deployments/4496
Eliot Berriot 2020-03-25 19:19:29 +01:00
rodzic 464010f046
commit 056948a1ba
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6B501DFD73514E14
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -251,6 +251,8 @@ export default {
progressInterval: null,
maxPreloaded: 3,
preloadDelay: 15,
listenDelay: 15,
listeningRecorded: null,
soundsCache: [],
soundId: null,
playTimeout: null,
@ -477,6 +479,13 @@ export default {
this.getSound(toPreload)
this.nextTrackPreloaded = true
}
if (t > this.listenDelay || d - t < 30) {
let onlyTrack = this.$store.state.queue.tracks.length === 1
if (this.listeningRecorded != this.currentTrack) {
this.listeningRecorded = this.currentTrack
this.$store.dispatch('player/trackListened', this.currentTrack)
}
}
}
},
seek (step) {

Wyświetl plik

@ -127,7 +127,6 @@ export default {
})
},
trackEnded ({dispatch, rootState}, track) {
dispatch('trackListened', track)
let queueState = rootState.queue
if (queueState.currentIndex === queueState.tracks.length - 1) {
// we've reached last track of queue, trigger a reload