MCPcopy
hub / github.com/spicetify/cli / shouldSkipCurrentTrack

Function shouldSkipCurrentTrack

Extensions/trashbin.js:284–305  ·  view source on GitHub ↗

* * @param {string} uri * @param {string} type * @returns {boolean}

(uri, type)

Source from the content-addressed store, hash-verified

282 * @returns {boolean}
283 */
284 function shouldSkipCurrentTrack(uri, type) {
285 const curTrack = Spicetify.Player.data.item;
286 if (type === Spicetify.URI.Type.TRACK) {
287 if (uri === curTrack.uri) {
288 return true;
289 }
290 }
291
292 if (type === Spicetify.URI.Type.ARTIST) {
293 let count = 1;
294 let artUri = curTrack.metadata.artist_uri;
295 while (artUri) {
296 if (uri === artUri) {
297 return true;
298 }
299 artUri = curTrack.metadata[`artist_uri:${count}`];
300 count++;
301 }
302 }
303
304 return false;
305 }
306
307 /**
308 *

Callers 2

trashbin.jsFile · 0.85
toggleThrowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected