Skip to content

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

NameTypeDescription
apiAnyThe video API of the series; it needs get_tv_episodes (TMDB).
series_idstrThe id of the series in that API.
number_of_seasonsintFrom the details of the series.
languagestrLanguage of the titles, such as "fr-FR".

Returns

  • Dict[str, str]Episode code ("S01E01") → title; empty if the API has no episodes.
Source

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

NameTypeDescription
detailsDict[str, Any]Details of the series, with number_of_seasons and seasons.
season_wordstr"Season" in the language of the interface.

Returns

  • Dict[str, int]Folder name → season number, for seasons 1 to number_of_seasons.
Source

Attributes

NameValue
loggerlogging.getLogger(__name__)
Built with Kiln