mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 11:59:18 +02:00
Removed errored sounds from cache
This commit is contained in:
parent
3b06cd25ee
commit
2c92825a08
1 changed files with 12 additions and 0 deletions
|
@ -391,6 +391,7 @@ export default {
|
|||
self.$store.commit('player/duration', this.duration())
|
||||
},
|
||||
onloaderror: function (sound, error) {
|
||||
self.removeFromCache(this)
|
||||
if (this != self.currentSound) {
|
||||
return
|
||||
}
|
||||
|
@ -544,6 +545,17 @@ export default {
|
|||
})
|
||||
this.soundsCache = _.reverse(toKeep)
|
||||
},
|
||||
removeFromCache (sound) {
|
||||
let toKeep = []
|
||||
this.soundsCache.forEach((e) => {
|
||||
if (e.sound === sound) {
|
||||
e.sound.unload()
|
||||
} else {
|
||||
toKeep.push(e)
|
||||
}
|
||||
})
|
||||
this.soundsCache = toKeep
|
||||
},
|
||||
async loadSound (newValue, oldValue) {
|
||||
let trackData = newValue
|
||||
let oldSound = this.currentSound
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue