(uriObj)
| 469 | } |
| 470 | |
| 471 | async function fetchCollection(uriObj) { |
| 472 | const { category, type } = uriObj; |
| 473 | const { pathname } = Spicetify.Platform.History.location; |
| 474 | |
| 475 | switch (type) { |
| 476 | case Type.TRACK: |
| 477 | case Type.LOCAL_TRACK: |
| 478 | switch (pathname) { |
| 479 | case "/collection/tracks": |
| 480 | return await fetchLikedTracks(); |
| 481 | case "/collection/local-files": |
| 482 | return await fetchLocalTracks(); |
| 483 | } |
| 484 | break; |
| 485 | case Type.COLLECTION: |
| 486 | switch (category) { |
| 487 | case "tracks": |
| 488 | return await fetchLikedTracks(); |
| 489 | case "local-files": |
| 490 | return await fetchLocalTracks(); |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | async function fetchShows(uri) { |
| 496 | const res = await Spicetify.CosmosAsync.get(`sp://core-show/v1/shows/${uri}?responseFormat=protobufJson`); |
no test coverage detected