fix(plex): the watch reconcile clears only what it walked, and doubts a mirrored 0

A library left out of the allowlist is never scanned, so its watch states were cleared on
every reconcile; clearing is now limited to the sections walked. A section we mirror items
from that says it holds 0 is not believed complete. The page size is no longer read as the
section total when totalSize is missing (measured: the server always sends totalSize on a
paged request, 0 for an empty one).
This commit is contained in:
2026-10-04 04:16:52 +02:00
parent 79704b0001
commit 12a39f5291
4 changed files with 85 additions and 14 deletions
+3 -1
View File
@@ -94,7 +94,9 @@ class PlexClient:
"X-Plex-Container-Size": size,
},
)
total = mc.get("totalSize", mc.get("size"))
# `totalSize` only: `size` is THIS page's count, and read as the total it made a single
# page look like the whole section — "complete" to a prune or a reconcile (E32 review).
total = mc.get("totalSize")
return mc.get("Metadata", []) or [], None if total is None else int(total)
def children(self, rating_key: str) -> list[dict]: