seriesmarker.persistence.factory.episode_factory module

class EpisodeFactory[source]

Bases: seriesmarker.persistence.factory.base_factory.BaseFactory

Factory to create episode objects from TheTVDB data.

new_episode(pytvdb_episode, update=None)[source]

Creates a persistable episode object from TheTVDB data.

This method will create a new Episode instance from a pytvdbapi episode. If a episode object is given, the existing one will be updated with the data instead.

Parameters:
  • pytvdb_episode (pytvdbapi.api.Episode) – The data to create the episode from.
  • update (Episode) – A episode to update with new data.
Returns:

The newly created or updated Episode instance.

Todo

Episode specials have additional attributes where regular ones do not. The pytvdbapi logs an exception if it is tried to access them on a regular episode. Either check existence beforehand, or see if pytvdbapi changes output.