Skip to content
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

Add change song command to API #1355

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Setadokalo
Copy link

This just adds a command to the API to change the current song/playlist, using logic copied from the existing implementation for the URI handler. There's still useful functionality that won't be covered, such as adding a song to the queue without replacing the queue entirely, but this at least covers a major use case.

There's no validation to ensure the video and playlist id are correct, which can cause some weirdness; invalid playlist ids will cause the bottom bar to disappear, for example.

Copy link
Member

@NovusTheory NovusTheory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just requesting that the command name be changed and it should be good.

Also please make sure to add the error code to the errorCodes array that was above otherwise the API will not properly return it https://github.com/ytmdesktop/ytmdesktop/pull/1355/files#diff-84b5d03309d58f0086ac6d2cb4cdce5f610a13d9f697edfb31974dd3a8c2c9b2R4-R17

@Setadokalo
Copy link
Author

Done, with the slight exception of changing song to id; given that either the playlist id or video id can be provided, it feels weird to me to give video id the 'default' name, so I changed it to videoId and playlistId. It looks like that's consistent with internal stuff as well.

Copy link
Member

@NovusTheory NovusTheory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NovusTheory NovusTheory added this to the v2.1.0 milestone May 21, 2024
@Setadokalo
Copy link
Author

Squashed the changes into a single commit to make it ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants