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 support for QUEUE_INSERT #404

Merged
merged 3 commits into from Sep 4, 2020
Merged

Conversation

bjesus
Copy link
Contributor

@bjesus bjesus commented Aug 16, 2020

This is aiming to solve issue #403 by allowing users to queue new items after the currently playing track.

I've added a queue_media() method that works just like play_media(), but instead of playing the media immediately it queues it. The Chromecast will automatically play it after the currently playing (and currently queued) media, and users can also skip to it using queue_next() etc.

I've also added an example.

@bjesus
Copy link
Contributor Author

bjesus commented Aug 16, 2020

I've fixed some formatting issues and rebased.

@emontnemery
Copy link
Collaborator

The new code is almost exactly the same as play_media + its helper functions.
Can you try refactoring to avoid duplicating so much?

@bjesus
Copy link
Contributor Author

bjesus commented Aug 16, 2020

Sure, I can try. Should there still be a queue_media() method, or should I just add an optional argument to play_media() (eg. queue=True) that makes the item queued instead of played?

@emontnemery
Copy link
Collaborator

An optional parameter enqueue sounds good!

@bjesus
Copy link
Contributor Author

bjesus commented Aug 23, 2020

Updated to have play_media(URL, enqueue=True)

@emontnemery
Copy link
Collaborator

Thanks, this looks good!
Are you happy with the PR, or do you plan additional changes?

@bjesus
Copy link
Contributor Author

bjesus commented Aug 24, 2020

I don't have any changes planned :) Thank you!

@bjesus
Copy link
Contributor Author

bjesus commented Sep 4, 2020

Is there anything I should fix to help this getting merged?

@emontnemery emontnemery merged commit fb7c8c9 into home-assistant-libs:master Sep 4, 2020
@emontnemery
Copy link
Collaborator

Thanks! Do you need a release with the QUEUE_INSERT functionality?

@bjesus
Copy link
Contributor Author

bjesus commented Sep 4, 2020

That would be great as I could then submit a patch to catt to support this functionality! Thank you!

@emontnemery
Copy link
Collaborator

OK, it's included in release 7.3.0

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