Two things from #354 that belong together.
Mirroring: polls /me/player/currently-playing every 5s through raw requests.get, bypassing make_call, so it has no 429 handling at all. Given the API limits are now tight enough to 429 before a song downloads, this is worth deferring until the quota picture is clearer.
Discovery lifecycle: the service currently starts at app startup and runs indefinitely. It should start on pairing and be killed once pairing completes. Right now spotify_new_session also closes the shared session and deletes the shared credentials file, so a second "add account" click disconnects whoever is currently casting.
Related open question: #316 and #304 are users reporting the device never appears at all, both macOS. librespot advertises via gethostbyname(gethostname()), which on macOS usually gives 127.0.0.1 or raises, so the record points nowhere. _spotify_connect_interface() in #354 overrides that and may already fix both, except it only accepts 192.168.*, so a Mac on 10.x still gets nothing. Worth resolving alongside.
Two things from #354 that belong together.
Mirroring: polls
/me/player/currently-playingevery 5s through rawrequests.get, bypassingmake_call, so it has no 429 handling at all. Given the API limits are now tight enough to 429 before a song downloads, this is worth deferring until the quota picture is clearer.Discovery lifecycle: the service currently starts at app startup and runs indefinitely. It should start on pairing and be killed once pairing completes. Right now
spotify_new_sessionalso closes the shared session and deletes the shared credentials file, so a second "add account" click disconnects whoever is currently casting.Related open question: #316 and #304 are users reporting the device never appears at all, both macOS. librespot advertises via
gethostbyname(gethostname()), which on macOS usually gives 127.0.0.1 or raises, so the record points nowhere._spotify_connect_interface()in #354 overrides that and may already fix both, except it only accepts192.168.*, so a Mac on 10.x still gets nothing. Worth resolving alongside.