Skip to content

Commit ea5b59b

Browse files
committed
feat(integration): search for SRD-renamed Midi SRD docs
1 parent 358c28f commit ea5b59b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

module/js/integrations/MidiSrd.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,21 @@ export class IntegrationMidiSrd extends StartupHookMixin(IntegrationBase) {
5858

5959
await (this.constructor._PS_CACHE_PACK[packId] ||= this.constructor._pDoCachePack({packId}));
6060

61-
const cacheDoc = this.constructor._PACK_CACHE[packId]?.[this.constructor._getCacheLookupName(ent)];
61+
const cacheDoc = this.constructor._getCacheLookupNames({ent})
62+
.map(lookupName => this.constructor._PACK_CACHE[packId]?.[lookupName])
63+
.find(Boolean);
6264
if (!cacheDoc) return null;
6365

6466
return this._getAddonData({doc: cacheDoc});
6567
}
6668

69+
static _getCacheLookupNames ({ent}) {
70+
return [
71+
this._getCacheLookupName(ent),
72+
(typeof ent.srd !== "string") ? null : this._getCacheLookupName({name: ent.srd, source: ent.source}),
73+
].filter(Boolean);
74+
}
75+
6776
static _getCacheLookupName ({name, source}) {
6877
return [name, source].map(str => str.slugify({strict: true})).join("__");
6978
}

0 commit comments

Comments
 (0)