Ejemplo n.º 1
0
def set_episode(metadata, episode):
    metadata.title = join_list_or(episode.get("title"))
    metadata.content_rating = episode.get("content_rating")
    metadata.originally_available_at = convert_date(episode.get("aired"))
    metadata.summary = episode.get("summary")
    metadata.rating = episode.get("rating")
    set_metadata_list_name(metadata, "writers", episode.get("writers", []))
    set_metadata_list_name(metadata, "directors", episode.get("directors", []))
Ejemplo n.º 2
0
def set_show(metadata, media, show):
    metadata.title = show.get("title")
    metadata.title_sort = show.get("sort_title")
    metadata.original_title = show.get("original_title")
    metadata.content_rating = show.get("content_rating")
    metadata.studio = first_or(show.get("studio"))
    metadata.originally_available_at = convert_date(show.get("aired"))
    metadata.summary = show.get("summary")
    metadata.rating = show.get("rating")
    set_metadata_list(metadata, "genres", show.get("genres"))
    set_metadata_list(metadata, "collections", show.get("collections"))
    set_metadata_actors(metadata, show.get("actors"))

    original_title = show.get("original_title")
    tagline = join_list_or(show.get("tagline"))
    update_show(media.id, original_title, tagline)
Ejemplo n.º 3
0
def set_episode(metadata, episode):
    metadata.title = join_list_or(episode.get("title"))
    metadata.content_rating = episode.get("content_rating")
    metadata.originally_available_at = convert_date(episode.get("aired"))
    metadata.summary = episode.get("summary")
    metadata.rating = episode.get("rating")
    writers = [
        w.get("name") for w in episode.get("writers", [])
        if w.get("name") is not None
    ]
    directors = [
        d.get("name") for d in episode.get("directors", [])
        if d.get("name") is not None
    ]
    set_metadata_list_name(metadata, "writers", writers)
    set_metadata_list_name(metadata, "directors", directors)