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

Function fetchTrack

Extensions/bookmark.js:525–539  ·  view source on GitHub ↗
(uri, uid, context)

Source from the content-addressed store, hash-verified

523 };
524
525 const fetchTrack = async (uri, uid, context) => {
526 const base62 = uri.split(":")[2];
527 const res = await CosmosAsync.get(`https://api.spotify.com/v1/tracks/${base62}`);
528 let newContext;
529 if (context && uid && Spicetify.URI.isPlaylistV1OrV2(context)) {
530 newContext = `${Spicetify.URI.fromString(context).toURLPath(true)}?uid=${uid}`;
531 }
532 return {
533 uri,
534 title: res.name,
535 description: res.artists[0].name,
536 imageUrl: res.album.images[0].url,
537 context: newContext ?? context,
538 };
539 };
540
541 const fetchEpisode = async (uri) => {
542 const base62 = uri.split(":")[2];

Callers 1

bookmark.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected