Finalize dev-1.3 upgrades and Seerr updates
This commit is contained in:
@@ -29,7 +29,7 @@ async def sync_jellyfin_users() -> int:
|
||||
if not isinstance(users, list):
|
||||
return 0
|
||||
save_jellyfin_users_cache(users)
|
||||
# Jellyfin is the canonical source for local user objects; Jellyseerr IDs are
|
||||
# Jellyfin is the canonical source for local user objects; Seerr IDs are
|
||||
# matched as enrichment when possible.
|
||||
jellyseerr_users = get_cached_jellyseerr_users()
|
||||
candidate_map = build_jellyseerr_candidate_map(jellyseerr_users or [])
|
||||
|
||||
@@ -242,14 +242,14 @@ async def build_snapshot(request_id: str) -> Snapshot:
|
||||
|
||||
allow_remote = mode == "always_js" and jellyseerr.configured()
|
||||
if not jellyseerr.configured() and not cached_request:
|
||||
timeline.append(TimelineHop(service="Jellyseerr", status="not_configured"))
|
||||
timeline.append(TimelineHop(service="Seerr", status="not_configured"))
|
||||
timeline.append(TimelineHop(service="Sonarr/Radarr", status="not_configured"))
|
||||
timeline.append(TimelineHop(service="Prowlarr", status="not_configured"))
|
||||
timeline.append(TimelineHop(service="qBittorrent", status="not_configured"))
|
||||
snapshot.timeline = timeline
|
||||
return snapshot
|
||||
if cached_request is None and not allow_remote:
|
||||
timeline.append(TimelineHop(service="Jellyseerr", status="cache_miss"))
|
||||
timeline.append(TimelineHop(service="Seerr", status="cache_miss"))
|
||||
snapshot.timeline = timeline
|
||||
snapshot.state = NormalizedState.unknown
|
||||
snapshot.state_reason = "Request not found in cache"
|
||||
@@ -260,20 +260,20 @@ async def build_snapshot(request_id: str) -> Snapshot:
|
||||
try:
|
||||
jelly_request = await jellyseerr.get_request(request_id)
|
||||
logging.getLogger(__name__).debug(
|
||||
"snapshot jellyseerr fetch: request_id=%s mode=%s", request_id, mode
|
||||
"snapshot Seerr fetch: request_id=%s mode=%s", request_id, mode
|
||||
)
|
||||
except Exception as exc:
|
||||
timeline.append(TimelineHop(service="Jellyseerr", status="error", details={"error": str(exc)}))
|
||||
timeline.append(TimelineHop(service="Seerr", status="error", details={"error": str(exc)}))
|
||||
snapshot.timeline = timeline
|
||||
snapshot.state = NormalizedState.failed
|
||||
snapshot.state_reason = "Failed to reach Jellyseerr"
|
||||
snapshot.state_reason = "Failed to reach Seerr"
|
||||
return snapshot
|
||||
|
||||
if not jelly_request:
|
||||
timeline.append(TimelineHop(service="Jellyseerr", status="not_found"))
|
||||
timeline.append(TimelineHop(service="Seerr", status="not_found"))
|
||||
snapshot.timeline = timeline
|
||||
snapshot.state = NormalizedState.unknown
|
||||
snapshot.state_reason = "Request not found in Jellyseerr"
|
||||
snapshot.state_reason = "Request not found in Seerr"
|
||||
return snapshot
|
||||
|
||||
jelly_status = jelly_request.get("status", "unknown")
|
||||
@@ -338,7 +338,7 @@ async def build_snapshot(request_id: str) -> Snapshot:
|
||||
|
||||
timeline.append(
|
||||
TimelineHop(
|
||||
service="Jellyseerr",
|
||||
service="Seerr",
|
||||
status=jelly_status_label,
|
||||
details={
|
||||
"requestedBy": jelly_request.get("requestedBy", {}).get("displayName")
|
||||
|
||||
@@ -114,7 +114,7 @@ def save_jellyseerr_users_cache(users: List[Dict[str, Any]]) -> List[Dict[str, A
|
||||
}
|
||||
)
|
||||
_save_cached_users(JELLYSEERR_CACHE_KEY, JELLYSEERR_CACHE_AT_KEY, normalized)
|
||||
logger.debug("Cached Jellyseerr users: %s", len(normalized))
|
||||
logger.debug("Cached Seerr users: %s", len(normalized))
|
||||
return normalized
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user