mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-02 05:55:08 +00:00
refactor(api): move the server CDM licence cap into one module that measures tracks by the -q rule
This commit is contained in:
@@ -77,6 +77,11 @@ class APIErrorCode(str, Enum):
|
||||
E = TypeVar("E", bound=BaseException)
|
||||
|
||||
|
||||
def cap_note(cap: int) -> str:
|
||||
"""The sentence that names a ``server_cdm_max_height`` cap, on the server and on the client."""
|
||||
return f"The server CDM licenses up to {cap}p for this API key"
|
||||
|
||||
|
||||
def coded(exc: E, code: APIErrorCode) -> E:
|
||||
"""``exc`` with the API error code that ``categorize_exception`` reports for it, whatever its message says."""
|
||||
exc.error_code = code # type: ignore[attr-defined]
|
||||
|
||||
Reference in New Issue
Block a user