Skip to content

Titles API

Auto-generated reference for the title model: Movies, Series/Episodes, and Music/Albums/Songs. A service returns one of these collections from its title lookup. See Creating a Service.

Episode

Episode(
    id_,
    service,
    title,
    season,
    number,
    name=None,
    year=None,
    language=None,
    data=None,
    description=None,
    air_date=None,
    part=None,
    absolute=None,
)

Bases: Title

matches_wanted

matches_wanted(wanted)

Whether a parsed -w key set selects this episode.

A part-ful episode answers to both its base key and its part key, so -w s1e1 takes every part. A dated episode also answers to its ISO air date. ! keys are part-qualified exclusions resolved here.

part_suffix

part_suffix()

.Part.2 / Part 2 in the series template's own separator style.

build_template_context

build_template_context(
    media_info, show_service=True, include_part=True
)

Build template context dictionary from MediaInfo.

air_date_display

air_date_display()

Render air_date using the series template's own separator (dots or spaces).

folder_season

folder_season()

Season folder label: air year when the air date parsed to a date, else SxxExx-style season.

part_label

part_label()

.2 selection-syntax suffix for console output, empty when part-less.

Movie

Movie(
    id_,
    service,
    name,
    year=None,
    language=None,
    data=None,
    description=None,
)

Bases: Title

build_template_context

build_template_context(media_info, show_service=True)

Build template context dictionary from MediaInfo.

Album

Album(
    iterable=None,
    kind="album",
    title=None,
    artist=None,
    year=None,
    total_tracks=None,
    total_discs=None,
    artwork_url=None,
    total_duration=None,
    owner=None,
    description=None,
)

Bases: Music

Backward-compatible collection name for album-style music releases.

Music

Music(
    iterable=None,
    kind="album",
    title=None,
    artist=None,
    year=None,
    total_tracks=None,
    total_discs=None,
    artwork_url=None,
    total_duration=None,
    owner=None,
    description=None,
)

Bases: SortedKeyList, ABC

A grouped music release, such as an album, EP, single, compilation, or playlist.

Song

Song(
    id_,
    service,
    name,
    artist,
    album,
    track,
    disc=1,
    year=None,
    language=None,
    data=None,
    album_artist=None,
    release_type="album",
    total_tracks=None,
    total_discs=None,
    genre=None,
    explicit=None,
    isrc=None,
    upc=None,
    copyright=None,
    label=None,
    lyrics=None,
    artwork_url=None,
)

Bases: Title

matches_wanted

matches_wanted(wanted)

Whether a parsed -w key set selects this song.

A song shares the episode key space, its disc reading as the season and its track as the episode, so -w 1-5 takes tracks 1 to 5 and -w 2x3 takes disc 2 track 3. A song has no parts and no air date, so it answers to its disc-and-track key only.

build_template_context

build_template_context(media_info, show_service=True)

Build template context dictionary from MediaInfo.

remap_titles

remap_titles(titles, title_map)

Rewrite titles in-place using an exact-match title_map.

Some services name a title differently from how the user wants it stored, which can break library matching. title_map maps a source title string to the desired output title. Episodes are matched on their title (the show name), Movies and Songs on their name. Returns the same collection for convenient chaining.