seriesmarker.persistence.factory.banner_factory module

class BannerFactory[source]

Bases: seriesmarker.persistence.factory.base_factory.BaseFactory

Factory to create banner objects from TheTVDB data.

static _new_banner(pytvdb_banner, update=None)[source]

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.

static new_banner(banner_type, banners, update=None, season=None)[source]

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).