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

Snapcast fix lost state when stop #1764

Merged
merged 2 commits into from
Nov 2, 2024
Merged

Snapcast fix lost state when stop #1764

merged 2 commits into from
Nov 2, 2024

Conversation

SantiagoSotoC
Copy link
Member

No description provided.

@@ -432,6 +432,7 @@ async def cmd_volume_set(self, player_id: str, volume_level: int) -> None:
async def cmd_stop(self, player_id: str) -> None:
"""Send STOP command to given player."""
player = self.mass.players.get(player_id, raise_unavailable=False)
player.elapsed_time = time.time()
Copy link
Member

Choose a reason for hiding this comment

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

this doesnt make any sense

Copy link
Member Author

Choose a reason for hiding this comment

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

Well then there is a bug somewhere else.
With this it works as it should.
The problem is that when pausing, it goes back to the first song in the queue.
It also clears the list of songs already played.
Do you have any idea what it could be ?

@SantiagoSotoC
Copy link
Member Author

I understand that the code does not make sense, but I leave a video showing the error and the “solution”.

Current status in branch dev:

current_dev_branch.mp4

With the change in the pr:

fix.mp4

@SantiagoSotoC
Copy link
Member Author

Does this make more sense?

Copy link
Member

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

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

Yes, this fix makes more sense

@marcelveldt marcelveldt merged commit dc493ce into dev Nov 2, 2024
5 checks passed
@marcelveldt marcelveldt deleted the snapcast_fix_queue branch November 2, 2024 16:15
@SantiagoSotoC SantiagoSotoC restored the snapcast_fix_queue branch November 3, 2024 03:10
@SantiagoSotoC
Copy link
Member Author

I have been trying this a little more and it does not solve the error, the first solution does, the second does not, it is strange because it certainly does not make sense.

@SantiagoSotoC
Copy link
Member Author

Move the change to cmd_stop if it seems to fix it. It shouldn't make a difference though.

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.

2 participants