Only return the cached value if it uses a valid source
This commit is contained in:
parent
e1ebfb02f7
commit
f50aee1021
@ -85,9 +85,11 @@ class AudioSystem {
|
|||||||
const cacheValue = this._cache.get(key);
|
const cacheValue = this._cache.get(key);
|
||||||
if (typeof cacheValue !== 'undefined') {
|
if (typeof cacheValue !== 'undefined') {
|
||||||
const {audio, uri, source} = cacheValue;
|
const {audio, uri, source} = cacheValue;
|
||||||
|
if (sources.includes(source)) {
|
||||||
return {audio, uri, source};
|
return {audio, uri, source};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const source of sources) {
|
for (const source of sources) {
|
||||||
const uri = await this._getAudioUri(definition, source, details);
|
const uri = await this._getAudioUri(definition, source, details);
|
||||||
|
Loading…
Reference in New Issue
Block a user