Repository navigation
spotify-cli v0.1.4
Daemon and its spotify_player:
- The warm spotify_player re-reads playback every 20 s instead of every 3 s. The 3 s poll (10
GETs per 30-second window) kept the owner's own client ID rate-limited even while idle: a 429
about every 30 s, eachRetry-After(6–15 s) freezing spotify_player's view and stalling
commands for that long (spotify trackandqueue add --searchtook about 9 s,likerefused
a song the view had not caught up with). 20 s is 1–2 GETs per window, so commands keep most of
the quota. A positiveplayback_refresh_duration_in_msin yourapp.tomlis now kept when it
is slower, and raised to 10 s when faster.spotify daemon statusreads
"playback refresh every 20 s" (refresh_ms: 20000). The first daemon start after the update
replaces the 0.1.3 copy. - spotify_player's view can now be up to about 20 s behind a change made in Spotify.app. Commands
that depend on it already compare it with Spotify.app first. The queue's resume point, which
took the interrupted context from that view unchecked, now reads the Web API once when the view
names another item than the Web API's queue. A list started moments before the queue
interrupts it is now the one resumed, not the list before it.
Playback control:
- Relinked songs (Spotify plays the same recording from another release under another id, so
Spotify.app and the Web API name different ids) are recognised: by the Web API item's
linked_from, or by the same title, a length within 1 s and the same album name.
spotify status --fullcounts such a song as the current item:web.relinked: true(new,
present only when true), noweb.staleand noweb_state_stalewarning, served from
spotify_player's memory instead of a fresh Web API read on every call. Before, it was stale
forever, with a hint to retry in a few seconds. The checks before spotify_player's relative
seek,nextandprevious, and the context kept to restore after a failed start, also count
it as Spotify.app's song. likeandunlikeon a relinked song refuse at once, without the volume nudge and the wait,
withtrack_mismatchthat is now not retryable: spotify_player would save or remove the
substitute's id, not the one Spotify.app shows.detailsaddrelinked: trueandmatched_by
(linked_fromortitle_length_album); the hint points to the heart in Spotify.app.- The
web_state_stalehint for another item now says the Web API usually catches up within
seconds, and that if it keeps reporting another item,webdescribes that item. play --likedwithout--randomplays Liked Songs in list order from its first song. A
shuffle Spotify kept for Liked Songs (from an earlier--random, or set in Spotify.app) is
turned off, and stays off, and the list is started again; before, it played shuffled and
always from the same song.play --liked --randomswitches Liked Songs' shuffle off and on, so Spotify draws a new order,
then skips once, so it starts at a random song every time; before, a kept shuffle started on
the same song again and again.- Each of those steps is checked in Spotify.app: one that does not show is a retryable
verification_failednaming the step (Liked Songs keeps playing), never a success. A Liked
Songs start that does not show within 2.5 s fails then (with--randomit took about 5 s, and
a start that showed late counted as a success without its shuffle step).
Queue:
- Queued episodes get their name, show and length more reliably. What the caller knows (the
search hit ofqueue add --search) is kept field by field and the rest is looked up, so an
episode picked with--searchgets its show; an empty name or show counts as missing. - Facts a lookup did not get are looked up again: after a rate limit, in the background once
Retry-Afterhas passed (for up to 10 minutes), and after other failures up to 3 tries per
item;spotify queuealso looks them up itself for up to 2.5 s. Before, an episode queued
while Spotify was rate-limiting stayedepisode <id>for good. When a lookup is left to the
background, thequeue addreply carriesmetadata_pending(the queued item ids) and a
note. - The
spotify queuenote on repeats of the item playing now names its kind ("the track
playing now") and gives a cause (repeat-one, no context, or nothing else up next in its album
or playlist) only when spotify_player's view of that item shows it and Spotify.app's repeat flag
agrees; otherwise it names none. Before, it blamed an episode without a context or repeat-one,
also for a track at the end of its album with repeat off.