Closed michaelwexler closed 9 months ago
Thank you for opening this issue!
๐ @mattisssa @peduarte @sxn @dillionverma @andreaselia @stuart @tonka3000 @dancannon @pernielsentikaer @stevensd2m you might want to have a look.
๐ก Tip: Once the issue is resolved, comment @raycastbot close this issue
to close it.
This is a limitation of the Spotify API. To my knowledge, there isn't any "fix" for this.
After a certain amount of time, responses from the Spotify API just don't contain data about the "currently playing" song, or rather, the song that was just played a few minutes ago.
That would be frustrating. I wonder, though: there appear to be two ways to get the currently playing track: /me/player/currently-playing and /me/player/queue. Even if it's not currently active, I'd expect the second to return some info every time. I totally get that the first one may just timeout. Or are you suggesting that, in fact, the API just stops returning "any" data of use?
I haven't tested any of this yet, just wondering if there's an alternate path to get to the info with some assumptions (like the top of the queue would be the same as the most recently played song; that may not be true).
Or are you suggesting that, in fact, the API just stops returning "any" data of use?
Yes. I just tested this. After exactly 10 minutes of music being paused, they all stop returning useful data.
/me/player/currently-playing
returns an empty response/me/player
returns an empty response/me/player/devices
returns the devices correctly/me/player/queue
returns: { "currently_playing" : null, "queue" : [ ] }
an alternate path to get to the info
I believe Applescript is an option. But, I won't be implementing it because I don't really use the Raycast commands to control Spotify.
top of the queue
Queue wouldn't work, as it returns no useful info. But, recently played tracks would work
I need to do some digging, but we've been having loads of issues with the API being rate-limited. I might have to rely on AppleScript more often, which is a shame. I liked the simplicity of relying on the API.
As you can probably tell, I've not had much time in the last couple of months to address the issues, but I'll put more effort in the next few days.
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean ๐
To avoid the stale indicator, just checking: has any progress been made on this one?
Just catching up with this. This is actually done on purpose ๐ This is the code
When I initially built this, I had it so it wouldn't clear. But then you'll permanently have the paused song there. However, I noticed that even the Spotify Client will clear paused songs after some time.
What we could do here though, is change from 10 mins to something longer. Thoughts?
IMO, ten minutes seems like a long time but really isn't. In the big scheme of things, I'll pause the music for a task (standup, meeting, 1:1) which will almost always be longer than 10 minutes, then desire to pick back up with the music from the taskbar.
So, if we feel this feature of "clearing the pause" is useful, the perfect ask is to let folks enter the number of minutes as a config or setting. And the default could be 2 hours, which accounts for a pause for a meeting or other experience, and then gives time to get back into the music.
I haven't seen a time frame for the Spotify Client to pause on MacOS, but I'll keep an eye out.
Yeah, makes sense. I think I'd prefer to avoid adding even more preferences, so happy to change the default to 2 hours and see how it feels. PR Created
Extension
https://www.raycast.com/mattisssa/spotify-player
Description
Using menu bar player, I pause the currently playing song. The Title and Artist still appear. Over some period of time, however, it reverts to the non-playing state: just the Spotify icon, only options are to "Open Spotify" and play, next, previous, etc are all missing. I see only "Nothing is playing right now". I have not yet established the length of time, but appears to be within 5 minutes or so of non-playing.
The Spotify app is still active and ready to play, and pressing play in the app "awakens" the menu bar within 10 seconds or so.
Is there a timeout in the extension?
Steps To Reproduce
With latest "everything" (MacOS, Raycast, Extension, Spotify): verify that the menu bar shows an artist and title while Spotify is playing.
Pause the song, and see that the artist and name are still present, as is the full menu.
Do other things on the computer, walk away and come back, whatever. Within 5 or so minutes, check again. Upon unlocking, you will see just the spotify logo and the reduced dropdown menu. (just Your Library, Search, Open Spotify)
Current Behaviour
Menu bar player reverts to "non-playing" status after the delay.
Expected Behaviour
While Spotify App is loaded, and a song is paused, the menu bar will always show the most recent song and the full controls dropdown. I would expect to be able to pop back in at any time and unpause or skip to the next track, etc.