* * @param {string} uri * @param {string} type * @returns {boolean}
(uri, type)
| 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 | * |
no outgoing calls
no test coverage detected