seriesmarker.persistence.factory.banner_factory module¶
Bases:
seriesmarker.persistence.factory.base_factory.BaseFactory
Factory to create banner objects from TheTVDB data.
Creates a persistable banner object from TheTVDB data.
Parameters: - pytvdb_banner (
pytvdbapi.banner.Banner
) – The data to create the banner from. - update (
Banner
) – The banner to replace with the created one.
Returns: The newly created
Banner
instance.- pytvdb_banner (
Picks a banner from a list of pytvdbapi-banners and creates a persistable object of it.
Parameters: - banner_type (string) – The type of banner to pick, possible options are: ‘series’ (landscape), ‘poster’ and ‘season’.
- banners (list) – The banners related to a series or season, retrieved by pytvdbapi.
- update (
Banner
) – The banner object to replace with a new banner. - season (
int
) – Parameter can be omitted unless ‘season’ is given as banner type. Describes the number of the season to pick a banner for.
Returns: The picked
Banner
, or None if no one matched.Todo
Convert banner_type to Enum, as soon as Python supports it (probably 3.4).