seriesmarker.persistence.factory.season_factory module

class SeasonFactory[source]

Bases: seriesmarker.persistence.factory.base_factory.BaseFactory

Factory to create season objects from TheTVDB data.

__init__()[source]

Creates a new factory instance.

new_season(series, pytvdb_season, update=None)[source]

Creates a persistable season object from TheTVDB data.

This method will create a new Season instance from pytvdbapi episode objects. If a season object is given, the existing one will be updated with the data instead. In both cases, it also traverses the episodes of a season, using EpisodeFactory, to populate it with data.

Parameters:
  • series (Series) – The series, the season to create belongs to.
  • pytvdb_season (pytvdbapi.api.Season) – The data to create the season instance from.
  • update (Season) – A season to update with new data.
Returns:

The newly created or updated Season instance.