fow5040 / Flow.Launcher.Plugin.SpotifyPremium

Spotify Premium plug-in for Flow Launcher
MIT License
31 stars 2 forks source link

Add refresh music info after action #27

Closed jjw24 closed 1 year ago

jjw24 commented 1 year ago

Context: When using Spotify action results like next, back, pause and set volume, the music info is not updated after the action has completed. For example when selecting next track, after the action completes, triggering flow again you still see the old track that was playing.

Changes:

  1. Added API re-query call for normal functions (terms, not expensive ones)
  2. Needed to use wait on skip track API call so the updated music info can be returned, otherwise Spotify's API may not return the info in time.
  3. Added workaround for set volume call to sleep for a certain period, not sure why API is not able to get the updated volume even when set volume call has completed.
  4. Changed SingleResult method to SingleResultInList to be more clearer. Was mistakenly thinking the method would just return a single result.
  5. Added and updated build and publish actions.

Tested:

  1. Correct music info/status is shown by flow after each non-expensive commands
  2. Comands PlayNext, PlayLast, SetVolume, Mute, Shuffle, Resume/Pause
fow5040 commented 1 year ago

Thanks a ton!