mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-09 01:16:50 +08:00
fix(classification): satisfy policy cleanup type checks
This commit is contained in:
@@ -39,13 +39,13 @@ def discard_removed_source_fallbacks(value: Any) -> Any:
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
state = copy.deepcopy(dict(value))
|
state = copy.deepcopy(dict(value))
|
||||||
policies = []
|
policies: list[dict[str, Any]] = []
|
||||||
active = state.get("active")
|
active = state.get("active")
|
||||||
if isinstance(active, Mapping):
|
if isinstance(active, dict):
|
||||||
policies.append(active)
|
policies.append(active)
|
||||||
history = state.get("history")
|
history = state.get("history")
|
||||||
if isinstance(history, list):
|
if isinstance(history, list):
|
||||||
policies.extend(item for item in history if isinstance(item, Mapping))
|
policies.extend(item for item in history if isinstance(item, dict))
|
||||||
for policy in policies:
|
for policy in policies:
|
||||||
policy.pop("source_fallbacks", None)
|
policy.pop("source_fallbacks", None)
|
||||||
return state
|
return state
|
||||||
|
|||||||
Reference in New Issue
Block a user