Skip to content

Cast: Fix next/previous track#22634

Merged
balloob merged 3 commits into
home-assistant:devfrom
emontnemery:cast_next_prev
Apr 3, 2019
Merged

Cast: Fix next/previous track#22634
balloob merged 3 commits into
home-assistant:devfrom
emontnemery:cast_next_prev

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

Description:

Use queue_next / queue_prev instead of seeking to end/beginning of track
Also only show next / previous UI controls if the currently playing playlist allows it.

Note: Depends on home-assistant-libs/pychromecast#286

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

@ghost ghost assigned emontnemery Apr 1, 2019
@ghost ghost added the in progress label Apr 1, 2019
"""Send previous track command."""
media_controller = self._media_controller()
media_controller.rewind()
media_controller.queue_next()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could consider seeking to beginning of track if more than a few seconds has been played.
But maybe that's something that should be handled in the frontend instead of by each integration?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that it's something that should be handled by each integration, preferably we even just forward the command and let the service/device itself figure it out.

if media_status.supports_queue_next:
support |= SUPPORT_NEXT_TRACK
if media_status.supports_seek:
support |= SUPPORT_SEEK
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Setting this doesn't seem to make any difference to the frontend, is it not implemented?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nope

@emontnemery emontnemery changed the title WIP - Cast: Fix next/previous track Cast: Fix next/previous track Apr 2, 2019
@balloob balloob merged commit 4f24351 into home-assistant:dev Apr 3, 2019
@ghost ghost removed the in progress label Apr 3, 2019
@emontnemery emontnemery deleted the cast_next_prev branch April 3, 2019 17:39
jonbeckman pushed a commit to jonbeckman/home-assistant that referenced this pull request Apr 7, 2019
* Fix next/previous track

* Bump pychromecast

* Update test, fixup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants