MCPcopy
hub / github.com/stemdeckapp/stemdeck / trackMatchesSearch

Function trackMatchesSearch

static/js/catalog.js:138–153  ·  view source on GitHub ↗
(track)

Source from the content-addressed store, hash-verified

136}
137
138function trackMatchesSearch(track) {
139 const q = normalizeSearch(catalogSearchQuery);
140 if (!q) return true;
141 if (q.startsWith("#")) {
142 const tag = q.slice(1);
143 if (!tag) return true;
144 return (track?.tags ?? []).some((t) => String(t).toLowerCase().includes(tag));
145 }
146 return [
147 track?.title,
148 track?.channel,
149 track?.sourceUrl,
150 ...(track?.stems || []),
151 ...(track?.tags || []),
152 ].some((value) => String(value || "").toLowerCase().includes(q));
153}
154
155function findTrackBySource(sourceUrl, exceptId) {
156 const source = normalizeSource(sourceUrl);

Callers 2

renderFolderFunction · 0.85
renderFunction · 0.85

Calls 1

normalizeSearchFunction · 0.85

Tested by

no test coverage detected