mirror of
https://github.com/RustyRaptor/doge_cogs.git
synced 2026-12-03 15:55:21 -07:00
`[p]watch <title>` asks the home lab's media-preload service to cache a movie, a season, some episodes or the next N unwatched episodes, and keeps a progress message (with a Cancel button) updated until done. `link`/`unlink` store a Jellyfin user name for "next"; `status` and `cancel` work on request ids. The API client in clients/media-preload-client is generated from the service's OpenAPI spec with openapi-python-client (`mise run generate-client`); the cog installs it from this repo via info.json. Also: ruff target py311 (Red 3.5's Python), a dev group with the client, pytest, ruff and ty, and mise tasks. Lint and type checks cover the new cog; doge_alignment is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GUebqhE8dK19vyn4Ct5g1L
17 lines
546 B
Python
17 lines
546 B
Python
"""Contains shared errors types that can be raised from API functions"""
|
|
|
|
|
|
class UnexpectedStatus(Exception):
|
|
"""Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""
|
|
|
|
def __init__(self, status_code: int, content: bytes):
|
|
self.status_code = status_code
|
|
self.content = content
|
|
|
|
super().__init__(
|
|
f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}"
|
|
)
|
|
|
|
|
|
__all__ = ["UnexpectedStatus"]
|