davicorreiajr / spotify-now-playing

Spotify now playing information and control popup for macOS menu bar
MIT License
216 stars 11 forks source link

Noticeable delay in play/pause icon #5

Closed joaogolias closed 5 years ago

joaogolias commented 5 years ago

What are you reporting?

In which context are you running the app?

I running the app in a MacBook Air, Majove, version 10.14.1

Description

I was using your app to manage my playing songs, and I noticed that if I click the 'play'('pause') button the song starts playing(stops) immediately, but the icon does not change at the same time. It has taken about 1 second to change effectively. My suggestion is: whenever the user clicks the button, you change the state of the icon (from play icon to pause icon and vice versa); and if the Spotify API throws an error, you change back. I guess that it is how youtube, google play music and even the Spotify handles this strange behavior!

davicorreiajr commented 5 years ago

Hi Golias, thanks for your suggestion!

I've been thinking more about this and the problem is that my app is not the source of true. What do I mean? I need to show what I receive from the request of the currently playback.

I tried to implement what you said, but it turns out that when I toggle the icon in the view regardless it was successful or not, the next response I get from the current playback still indicates that music is playing, so the icon kinds of "blink" in the screen.

So, since I couldn't think in a solution that was safe and without a "code smell" at the same time, I'm gonna close the issue.