style: turn on ruff UP and B rules and fix every finding

This commit is contained in:
imSp4rky
2026-11-25 16:34:09 -07:00
parent 1a63076df2
commit d8058a3610
264 changed files with 2950 additions and 2966 deletions
+8 -8
View File
@@ -9,7 +9,7 @@ older peer.
from __future__ import annotations
from enum import Enum, StrEnum
from typing import Any, NotRequired, Optional, TypedDict, TypeVar
from typing import Any, NotRequired, TypedDict, TypeVar
HEALTH_ROUTE = "/api/health"
SERVICES_ROUTE = "/api/services"
@@ -109,7 +109,7 @@ class ClientInfo(TypedDict):
"""What a client tells the server about itself, for the server's logs."""
version: str
code_hash: Optional[str]
code_hash: str | None
platform: str
argv: str
@@ -125,7 +125,7 @@ class SessionCreate(ClientLogin, total=False):
episode: Any
part: Any
wanted: Any
proxy: Optional[str]
proxy: str | None
no_proxy: bool
client_region: str
proxy_region: str
@@ -153,7 +153,7 @@ class SessionCreated(TypedDict, total=False):
status: str
server_account: bool
server_cdm: bool
server_cdm_max_height: Optional[int]
server_cdm_max_height: int | None
server_vault: bool
server_device: bool
@@ -168,7 +168,7 @@ class TracksReply(TypedDict, total=False):
session_headers: dict[str, str]
session_cookies: dict[str, str]
session_cookie_jar: list[dict[str, Any]]
server_cdm: Optional[bool]
server_cdm: bool | None
server_cdm_type: str
sample_decrypt_tracks: list[str]
@@ -180,7 +180,7 @@ class SegmentFilterRequest(TypedDict):
class SegmentFilterReply(TypedDict):
"""The segment URIs to skip; None when the track has no segment filter."""
unwanted: Optional[list[str]]
unwanted: list[str] | None
class LicenseRequest(TypedDict, total=False):
@@ -203,7 +203,7 @@ class LicenseReply(TypedDict, total=False):
track gets no content keys: ``capped_tracks`` holds its refusal details, ``reason`` and ``max_height``.
"""
license: Optional[str]
license: str | None
keys: dict[str, Any]
vault_keys: list[str]
clear_tracks: list[str]
@@ -226,7 +226,7 @@ class PromptReply(TypedDict, total=False):
"""The login state of a remote session, and the prompt or CDM call that waits for the client."""
status: str
prompt: Optional[str]
prompt: str | None
cdm_call: dict[str, Any]
error: str