Skip to content

sok.server.metadata

What S.O.K Server writes into the videos it renames (write_metadata).

A movie gets the title, the date and the summary of its search result, with the director and the genres of its details: one more request to the video service per movie, made only while renaming. An episode gets the title of its series, the season and the number read from its name before the rename, and the title of the episode the analysis fetched. Both get the poster of their search result (file_operations/file_metadata.py).

Functions

directors_of

def directors_of(details: Optional[Dict[str, Any]]) -> List[str]:

The directors of a movie: TMDB credits, or the "Director" of OMDb.

Parameters

NameTypeDescription
detailsOptional[Dict[str, Any]]
Source

genres_of

def genres_of(details: Optional[Dict[str, Any]]) -> List[str]:

The genres of a movie: TMDB {"name"} objects, strings, or "A, B".

Parameters

NameTypeDescription
detailsOptional[Dict[str, Any]]
Source

poster_path

def poster_path(row: Any) -> Optional[str]:

The poster of the search result picked for a row.

Parameters

NameTypeDescription
rowAny
Source

video_info

def video_info(
row: Any,
source: str,
details: Optional[Dict[str, Any]] = None,
episode_of: Optional[Any] = None,
) -> Optional[VideoInfo]:

What to write into a video of a row, None before a match.

Parameters

NameTypeDefaultDescription
rowAnyThe row of the video (rows table).
sourcestrIts path before the rename: its name gives an episode's season and number.
detailsOptional[Dict[str, Any]]NoneA movie's details with its credits (Searcher.movie_details).
episode_ofOptional[Any]NoneReads the season and episode of a file name (VideoFileOperations.extract_info_from_filename).
Source
Built with Kiln