kalkih / mini-media-player

Minimalistic media card for Home Assistant Lovelace UI
MIT License
1.53k stars 207 forks source link

Do not increment progress if player isn't playing #521

Closed BoOmka closed 3 years ago

BoOmka commented 3 years ago

Fixes #346

I'm not sure why nobody made this fix before, maybe I'm missing something?

Tested with yandex_station (custom component) and cast (official from hass/core). Entities from these integrations have their media_position_updated_at attribute frozen after pausing, don't know about others.

Freezing this attribute makes player position increase indefinitely. Checking if the player actually playing eliminates the problem.

kalkih commented 3 years ago

Thanks for the PR,

The media position reporting behaviour is not really consistent between media player integrations, I think this change is fine and I don't think it should cause issues for other intergrations, let's try it. 🤞🏼

nagyrobi commented 3 years ago

Thank you for this. There's no consensus in the dev docs if the media_position_updated_at should be updated or not while the position does not change. That's why the inconsistent behavior - logically if position doesn't change, you don't need to update position...