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
| Name | Type | Description |
|---|---|---|
details | Optional[Dict[str, Any]] |
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
| Name | Type | Description |
|---|---|---|
details | Optional[Dict[str, Any]] |
poster_path
def poster_path(row: Any) -> Optional[str]:The poster of the search result picked for a row.
Parameters
| Name | Type | Description |
|---|---|---|
row | Any |
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
| Name | Type | Default | Description |
|---|---|---|---|
row | Any | The row of the video (rows table). | |
source | str | Its path before the rename: its name gives an episode's season and number. | |
details | Optional[Dict[str, Any]] | None | A movie's details with its credits (Searcher.movie_details). |
episode_of | Optional[Any] | None | Reads the season and episode of a file name (VideoFileOperations.extract_info_from_filename). |