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

Function findTrackBySource

static/js/catalog.js:155–163  ·  view source on GitHub ↗
(sourceUrl, exceptId)

Source from the content-addressed store, hash-verified

153}
154
155function findTrackBySource(sourceUrl, exceptId) {
156 const source = normalizeSource(sourceUrl);
157 if (!source) return null;
158 for (const [id, track] of Object.entries(tracks)) {
159 if (id === exceptId) continue;
160 if (normalizeSource(track.sourceUrl) === source) return id;
161 }
162 return null;
163}
164
165function replaceTrackId(oldId, newId) {
166 if (!oldId || !newId || oldId === newId || !tracks[oldId]) return;

Callers 1

addTrackToLibraryFunction · 0.85

Calls 1

normalizeSourceFunction · 0.85

Tested by

no test coverage detected