mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
The server sends catalog.changed only to phones with an open WebSocket,
and a phone closes its socket in the background. Before the skip of
unchanged catalogs the next desktop focus return pushed again and healed
such a phone within seconds; now a phone that was away when a real
change was pushed (an album downloaded on the desktop while the phone
was in a pocket) never rescanned until the next real change.
The host now remembers the phones each push reached: those connected
both before and after linkSetCatalog. When a phone connects without
having been reached, or connected during the push, the host sends
catalog.changed to that phone only ({"songs"}; phones read the type),
and remembers it. A phone that was reached and reconnects gets nothing,
so a phone going to the background and back rescans no more than once
per catalog change; one that connects after a server start rescans
once, as a focus return did before.