mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #601] Edge case in edit_playlist: moving a title to the end of the playlist #413
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#413
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 @AltoRetrato on GitHub (Jun 16, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/601
Hello, and thanks for the ytmusicapi! :D
The
edit_playlist()method currently includesACTION_MOVE_VIDEO_BEFORE,setVideoId, andmovedSetVideoIdSuccessorinbody["actions"]whenever themoveItemargument is defined. This mirrors the behavior of the YouTube Music client when a title is moved to a position above another one in a playlist.However, when moving a title to the end of a playlist, the YouTube Music client performs a similar action but omits the
movedSetVideoIdSuccessorfield.In order to allow ytmusicapi to do this as well, I suggest changing the
edit_playlist()function from:to:
This way,
moveItemcan be aTuple[str,str](as it is today), as well as a singlestror aTuple[str,], allowing to move a title to the end of the playlist.@sigma67 commented on GitHub (Jun 16, 2024):
Interesting that you're the first one to stumble upon this, I haven't looked at this function in ages. Will have a closer look the next few days.
You should definitely be able to move an item to the end, if not I'd consider that a bug.
@sigma67 commented on GitHub (Jun 16, 2024):
Contribution welcome.
@AltoRetrato commented on GitHub (Jun 16, 2024):
If I understand this correctly, without this change, you can only move an item
Aabove another item, so it can never be moved directly to the bottom of a playlist. You can do it with two steps, though - by first moving itemAto the position above the last item in the list (L), and then movingLaboveA.You can create a playlist with a few items and move one to the bottom to see the "action" parameters in the Javascript Console.
Anyway, I did pull request #602.