Only return the cached value if it uses a valid source

This commit is contained in:
toasted-nutbread 2020-04-10 16:35:43 -04:00
parent e1ebfb02f7
commit f50aee1021

View File

@ -85,9 +85,11 @@ class AudioSystem {
const cacheValue = this._cache.get(key);
if (typeof cacheValue !== 'undefined') {
const {audio, uri, source} = cacheValue;
if (sources.includes(source)) {
return {audio, uri, source};
}
}
}
for (const source of sources) {
const uri = await this._getAudioUri(definition, source, details);