sok.core.series
What a TV series needs to be organized: its season folders and the titles of its episodes.
The module has no Qt dependency, so the desktop app and S.O.K Server share it.
Functions
fetch_episode_titlesasync
async def fetch_episode_titles( api: Any, series_id: str, number_of_seasons: int, language: str,) -> Dict[str, str]:The title of every episode of a series, season by season.
A season that fails is left out (and logged): the episodes of the others still get their titles.
Parameters
| Name | Type | Description |
|---|---|---|
api | Any | The video API of the series; it needs get_tv_episodes (TMDB). |
series_id | str | The id of the series in that API. |
number_of_seasons | int | From the details of the series. |
language | str | Language of the titles, such as "fr-FR". |
Returns
Dict[str, str]Episode code ("S01E01") → title; empty if the API has no episodes.
season_folders
def season_folders(details: Dict[str, Any], season_word: str) -> Dict[str, int]:The folder name of each season, from the details of the series.
"Season 2", or "Season 2 - The Name" when the season has a name of its own ("Season 2" or "Saison 2" in the details is no name).
Parameters
| Name | Type | Description |
|---|---|---|
details | Dict[str, Any] | Details of the series, with number_of_seasons and seasons. |
season_word | str | "Season" in the language of the interface. |
Returns
Dict[str, int]Folder name → season number, for seasons 1 to number_of_seasons.
Attributes
| Name | Value |
|---|---|
logger | logging.getLogger(__name__) |