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

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

Setadokalo
Copy link
Contributor

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
Contributor 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
Contributor Author

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

Copy link
Member

@Alipoodle Alipoodle left a comment

Choose a reason for hiding this comment

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

Shocked as to how simple this is, but looks and feels effective :)
Interesting to see how people would integrate with this.

@NovusTheory NovusTheory modified the milestones: v2.1.0, 2.0.6 Oct 23, 2024
@NovusTheory NovusTheory changed the title Add change song command to API ✨ Add change song command to API Oct 26, 2024
@NovusTheory NovusTheory merged commit 81103d7 into ytmdesktop:development Oct 26, 2024
7 checks passed
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.

3 participants