-
Notifications
You must be signed in to change notification settings - Fork 153
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
move items in a playlist #224
move items in a playlist #224
Conversation
add track actions to move items up and down in the current playlist Closes: 197
Hi @cobbinma, thanks for the PR. I think the original issue wants to implement the feature as commands instead of actions. I can find it quite troublesome, let's say, to move an item up 5 times as you need to call It shouldn't be too difficult to change to command. |
use commands instead of track actions to move playlist items
Thanks @aome510 I agree, that is much easier 👍 |
.find(|playlist| &playlist.id == playlist_id) | ||
.is_some_and(|playlist| { | ||
Some(&playlist.owner.1) | ||
== data.user_data.user.as_ref().map(|user| &user.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This owner check can be moved inside the find
function right.
Edit: then you can use .any
instead of .find.is_some()
to make the code cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Only need a minor change
I just tried the feature but the ordering change does not persist after restart. It does change the ordering in the UI though, which I think mainly because we also update the cached. @cobbinma does it work for you? |
Oh right, also only persists moving upwards for me. Very interesting. Do you think you can investigate this behaviour? Otherwise, I think the PR is in a good state already. |
spotify reorder needs insert before instead of index
I misunderstood the difference between insert before and index when using update playlist items. Should be fixed now 👍 |
partial eq is no longer needed on track action
Thanks @cobbinma |
add track actions to move items up and down in the current playlist 🎵
closes #197