Fix plex.tv DNS blips blocking array restore, clarify locked admin toggles - #198
Merged
StudioNirin merged 2 commits intoJul 26, 2026
Conversation
The first plex.tv call of a run, `myPlexAccount()` in `_get_main_account()`, was the only plex.tv call not wrapped in `_retry_plextv_call`. A transient DNS failure or connection reset there marked plex.tv unreachable for the whole run, where the existing helper's 3 attempts with 2s/4s backoff would have recovered. A plex.tv failure also set `_watchlist_data_complete = False` unconditionally, which gates array restore in `_process_media()`. With watchlist caching disabled, no cached file is held by the watchlist, so a plex.tv outage was blocking the restore of watched files for a feature the user wasn't running. `PlexManager` now takes `watchlist_enabled` and only flags watchlist data when watchlist caching is on; `_process_media()` checks `watchlist_toggle` alongside the completeness flag. Refs StudioNirin#197
The admin row's OnDeck and Watchlist toggles are disabled by design, but nothing said so or pointed at the global switch. Adds a tooltip to each and a hint linking to Settings > Cache > Enable Watchlist Caching, which is the control that turns watchlist caching off for every user including admin. Refs StudioNirin#197
StudioNirin
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #197
What's happening
A user reported this during a scheduled run:
Two problems fell out of it, plus a UI gap.
1. The first plex.tv call of a run had no retry
_get_main_account()calledmyPlexAccount()bare. It was the only plex.tv call incore/plex_api.pynot going through_retry_plextv_call, which already retriesrequests.ConnectionErrorthree times with 2s/4s backoff. ANameResolutionErrorsurfaces as exactly that exception, so a brief DNS hiccup took out the whole run when a retry would have gone straight through.Now wrapped in the existing helper. Non-transient errors (auth, parse) still fail fast on the first attempt.
2. A plex.tv outage blocked array restore even with watchlist disabled
The failure path set
_watchlist_data_complete = Falseunconditionally, and_process_media()uses that flag to skip moving watched files back to the array. With watchlist caching turned off, no cached file is held by the watchlist, so there was nothing incomplete to guard against. Users who don't use the feature at all were still losing their array restore whenever plex.tv had a moment.PlexManagernow takeswatchlist_enabledand only flags watchlist data when watchlist caching is actually on._process_media()checkswatchlist_togglealongside the flag as a second gate. The OnDeck guard is unchanged, and behaviour with watchlist enabled is identical to before.3. The locked admin toggles didn't explain themselves
The admin row's OnDeck and Watchlist toggles are disabled by design, but nothing said why or where to go instead, so the reporter thought they'd hit a bug. Added a tooltip on each, and a hint under the table linking to the global switch at Settings > Cache > Enable Watchlist Caching, which is what actually turns watchlist caching off for everyone.
Testing
New
tests/test_plextv_main_account_resilience.py, 7 tests:PLEXTV_MAX_RETRIESand reports plex.tv unreachablewatchlist_enabled=Truefor existing callersFull suite: 1207 passed.
Manual verification