mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #162] Invalid track uri #104
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kevin7 on GitHub (Jul 2, 2019).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/162
Hi, thanks for this library, I'm having an issue that I don't know how to solve. I can't add track into playlist. I'm 100% sure the tracks are exist:
My code:
`$newplaylist = [
$data['audioTrackID'],
$data['track1'],
$data['track2'],
$data['track3'],
$data['track4'],
$data['track5'],
$data['track6'],
$data['track7'],
$data['track8'],
$data['track9'],
$data['track10']
];
$new_tracks = $api->addPlaylistTracks($new_playlist->id, $newplaylist);`
Output
This is the output I got - Invalid track uri
Array
(
[0] => spotify:track:7l1qvxWjxcKpB9PCtBuTbU
[1] => spotify:track:6CU0zWIWVTEnmWpSjVHM93
[2] => spotify:track:3SdTKo2uVsxFblQjpScoHy
[3] => spotify:track:3M8FzayQWtkvOhqMn2V4T2
[4] => spotify:track:3CEFDHJSiERlfwRujZ1CkJ
[5] => spotify:track:7CQXyFX44CXmnuq8Bi9Dyc
[6] => spotify:track:5ktLiFRny1waEnVkZNUa03
[7] => spotify:track:3bidbhpOYeV4knp8AIu8Xn
[8] => spotify:track:57RHMnLMQx8Qz5V6c0E8dF
[9] => spotify:track:0KOE1hat4SIer491XKk4Pa
[10] => spotify:track:5RdhBLmB4DyFHLglRrfx63
}
Fatal error: Uncaught exception 'SpotifyWebAPI\SpotifyWebAPIException' with message 'Invalid track uri: spotify:track:6CU0zWIWVTEnmWpSjVHM93
What puzzle me the most, this works:
$new_tracks = $api->addPlaylistTracks($new_playlist->id, [
$data['audioTrackID'],
'spotify:track:7l1qvxWjxcKpB9PCtBuTbU',
'spotify:track:6CU0zWIWVTEnmWpSjVHM93',
'spotify:track:3SdTKo2uVsxFblQjpScoHy',
'spotify:track:3M8FzayQWtkvOhqMn2V4T2',
'spotify:track:3CEFDHJSiERlfwRujZ1CkJ',
'spotify:track:7CQXyFX44CXmnuq8Bi9Dyc',
'spotify:track:5ktLiFRny1waEnVkZNUa03',
'spotify:track:3bidbhpOYeV4knp8AIu8Xn',
'spotify:track:57RHMnLMQx8Qz5V6c0E8dF',
'spotify:track:0KOE1hat4SIer491XKk4Pa',
'spotify:track:5RdhBLmB4DyFHLglRrfx63'
]);
Can anyone shed some light for me? Thanks
@kevin7 commented on GitHub (Jul 2, 2019):
Okay, issue is now fixed. I reloaded the tracks, it looks like my tracks did have issue with it.