forked from kenzuya/unshackle
style: turn on ruff UP and B rules and fix every finding
This commit is contained in:
@@ -4,14 +4,14 @@ Keep this allowlist separate from title.data: that dict can contain credentials,
|
||||
playback URLs and other private service state which must never cross the API.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any
|
||||
|
||||
|
||||
def availability_metadata(value: Any) -> Optional[Dict[str, Any]]:
|
||||
def availability_metadata(value: Any) -> dict[str, Any] | None:
|
||||
"""Return only well-typed display fields; absent metadata remains absent."""
|
||||
if not isinstance(value, dict):
|
||||
return None
|
||||
result: Dict[str, Any] = {}
|
||||
result: dict[str, Any] = {}
|
||||
if isinstance(value.get("paid"), bool):
|
||||
result["paid"] = value["paid"]
|
||||
access = value.get("access")
|
||||
|
||||
Reference in New Issue
Block a user