MCPcopy Index your code
hub / github.com/spicetify/cli / getTrackMeta

Function getTrackMeta

Extensions/bookmark.js:289–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287 }
288
289 function getTrackMeta() {
290 const meta = {
291 title: Player.data.item.metadata.title,
292 imageUrl: Player.data.item.metadata.image_url,
293 };
294 meta.uri = Player.data.item.uri;
295 if (URI.isEpisode(meta.uri)) {
296 meta.description = Player.data.item.metadata.album_title;
297 } else {
298 meta.description = Player.data.item.metadata.artist_name;
299 }
300 const playerState = Spicetify.Player.data;
301 const contextUri = URI.fromString(playerState.context_uri ?? playerState.context.uri);
302 if (contextUri && (contextUri.type === URI.Type.PLAYLIST || contextUri.type === URI.Type.PLAYLIST_V2 || contextUri.type === URI.Type.ALBUM)) {
303 meta.context = `/${contextUri.toURLPath()}?uid=${Player.data.item.uid}`;
304 }
305
306 return meta;
307 }
308
309 function storeTrack() {
310 LIST.addToStorage(getTrackMeta());

Callers 2

storeTrackFunction · 0.85
storeTrackWithTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected