Re-pick Plex server address on network change, foreground, and stream failure (dev 36)
The address chosen at sign-in (LAN first) was kept forever, so away from home streams hit a dead LAN address (TLS error) or the relay (503). Store every address plex.tv lists, probe them all bypassing the offline cache, and keep the best one that answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f68aa588b
commit
e02428ab70
7 files changed
+100
-17
No files matched your search
@@ -45,6 +45,14 @@ final class AppGraph {
|
||||
mediaSession = URLSession(configuration: m)
|
||||
|
||||
plex = PlexClient(http: apiHttp, settings: settings)
|
||||
let plex = plex
|
||||
// Left home or joined Wi-Fi: the saved Plex address may be dead now. Give the new link a moment first.
|
||||
net.onChange {
|
||||
Task.detached {
|
||||
try? await Task.sleep(nanoseconds: 1_500_000_000)
|
||||
await plex.reroute("network changed")
|
||||
}
|
||||
}
|
||||
reach = HomeReach(settings: settings, net: net)
|
||||
let reach = reach
|
||||
carHttp.forceCache = { !reach.lastKnown }
|
||||
|
||||
Reference in new issue
Block a user