Skip to main content

Module episodes

Module episodes 

Source
Expand description

Episode discovery, dropdown labels, the Episodes table and stem listing.

Constantsยง

EPISODES_TTL
How long Episodes-table rows stay memoised (_EPISODES_TTL_S).

Staticsยง

EP_TAG_RE ๐Ÿ”’
NEW_CAST_RE ๐Ÿ”’
SEQ_RE ๐Ÿ”’
SLUG_TAG_RE ๐Ÿ”’
TAG_RE ๐Ÿ”’

Functionsยง

child_dirs ๐Ÿ”’
Subdirectories of dir, sorted, hidden ones skipped (glob("dir/*")).
ep_choice
_ep_choice(slug, tag): the dropdown label.
ep_meta
_ep_meta(slug, tag) โ†’ (title, season_title) from the cast config.
episode_choices
_episode_choices().
find_episodes
_find_episodes(): (slug, tag) pairs from both cast layouts, plus (slug, "") stubs for shows with a project.json and no episode yet.
is_legacy_cast_name
Legacy cast file names: cast_{slug}_{tag}.json in the workspace root.
is_safe_slug_or_tag
_is_safe_slug_or_tag(value): a bare path component, checked before any path is built from request data.
load_stems
_load_stems(slug, tag, filter_type): [(label, path)] for the stem dropdown, sorted by file name, labelled from the parsed script.
looks_like_tag
True for a raw episode tag such as S04E04.
parse_choice
_parse_choice(choice): a dropdown label back to (slug, tag). An unsafe slug yields ("", "").
read_json ๐Ÿ”’
refresh_episodes
_refresh_episodes(force): Episodes-table rows, memoised for EPISODES_TTL per workspace root. The staleness scan stats every stem, so rows are evaluated on up to eight threads.
str_field ๐Ÿ”’