-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Tracks to Queue from Search Results #1607
Comments
Thanks for reporting this @cdlenfert. As I recall, queue handling especially when shuffled is surprisingly complicated, so I have a feeling it won't be an easy fix. |
My pleasure, and also sorry to be a pain. It may not be of any help, but I use an iOS shortcut to search for and add tracks into the current position in the queue. It honors (as far as I know) the shuffled queue while doing so. This is all via the API. https://www.icloud.com/shortcuts/69fa3815cf7d4b1ca1a5485a9785e748 |
I could reproduce this behaviour from the Spotify search page. This call works: axios.post('./api/queue/items/add?uris=library:track:335664&position=7') This one doesn't: axios.post('./api/queue/items/add?uris=spotify:track:7ESkZSRagu9qKszQxq7Qsl&position=7') How differently are treated Spotify tracks behind the scene? |
I think the queue handling is agnostic to source type. What does the debug log say for the one that doesn't work? |
Below, is an extract from the logs.
|
I looked into this, and it looks like the reason Spotify is different is actually that queue_tracks_add_byuris() distinguishes between library items and non-library items. When it's a library item db_queue_add_by_query() will be called, and even though it is called with reshuffle = true there is this logic. Non library items are added with library_queue_item_add() which doesn't have that logic. I need to think about how to fix this. Copying the logic to the non-library function doesn't feel super clean. |
This one is a little hard to explain but I think these are the steps to replicate the issue I'm seeing:
I have no problem when adding (next) tracks to the initial shuffled queue when browsing these tracks in my library, but when I do the same from search results, the shuffled queue gets reshuffled and the searched track is not next in the queue either.
The text was updated successfully, but these errors were encountered: