49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
from typing import Any, Optional
|
|
|
|
from .base import ApiClient
|
|
|
|
|
|
class BazarrClient(ApiClient):
|
|
async def get_system_status(self) -> Optional[Any]:
|
|
return await self._request("GET", "/api/system/status")
|
|
|
|
async def search_movie_subtitles(
|
|
self,
|
|
radarr_id: int,
|
|
*,
|
|
language: str,
|
|
forced: bool = False,
|
|
) -> Optional[Any]:
|
|
return await self._request(
|
|
"PATCH",
|
|
"/api/movies/subtitles",
|
|
params={
|
|
"radarrid": radarr_id,
|
|
"language": language,
|
|
"forced": str(forced).lower(),
|
|
"hi": "false",
|
|
},
|
|
timeout_seconds=90.0,
|
|
)
|
|
|
|
async def search_episode_subtitles(
|
|
self,
|
|
series_id: int,
|
|
episode_id: int,
|
|
*,
|
|
language: str,
|
|
forced: bool = False,
|
|
) -> Optional[Any]:
|
|
return await self._request(
|
|
"PATCH",
|
|
"/api/episodes/subtitles",
|
|
params={
|
|
"seriesid": series_id,
|
|
"episodeid": episode_id,
|
|
"language": language,
|
|
"forced": str(forced).lower(),
|
|
"hi": "false",
|
|
},
|
|
timeout_seconds=90.0,
|
|
)
|