Mastermindzh / tidal-hifi

The web version of Tidal running in electron with hifi support thanks to widevine.
Other
1.01k stars 56 forks source link

Built-in web API reports incorrect playback status #370

Closed ungive closed 6 months ago

ungive commented 6 months ago

When I enable the built-in web API and navigate to localhost:47836/current, the status field rarely contains the right playing or paused value. E.g. after restarting the application it says "paused" even though I just continued my song, or when playing a different song and pausing it, it will say "playing" instead. This is likely related to #351. Everything else seems to work fine.

Built it from source (branch master).

Mastermindzh commented 6 months ago

Hey @jonasberge,

Could you confirm this only happens during startup? I've been playing music for most of this morning and haven't noticed any wrong statuses reported.

I just had a thought whilst writing this though.... you're probably using the actual buttons in the UI right? I just tried that and they don't update the status (and I know exactly why* too...).

Can you confirm it doesn't happen when you use the API's playpause but only happens if you use the built-in play/pause button?

The urls for play and pause are:

This most likely also is the underlying cause in other issues.

ungive commented 6 months ago

I can confirm, it only happens with the UI buttons, when I use /playpause, /play and /pause everything works as expected.

Mastermindzh commented 6 months ago

@jonasberge,

Thanks for confirming, that'll give me the right direction to fix this.

Mastermindzh commented 6 months ago

@jonasberge,

Just refactored the code and tested it, works again 😄. Gonna go have a bite to eat now and will continue working later today.

Will release a new version (5.10.0) later today!