flexget.components.series.db module#
- class flexget.components.series.db.AlternateNames(name)[source]#
Bases:
VersionedBaseSimilar to Series. Name is handled case insensitively transparently.
- _alt_name#
- _alt_name_normalized#
- _sa_class_manager = {'_alt_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, '_alt_name_normalized': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'series_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- alt_name#
- id#
- property name_normalized#
- series_id#
- class flexget.components.series.db.Episode(**kwargs)[source]#
Bases:
VersionedBase- _sa_class_manager = {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'identified_by': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'identifier': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'releases': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'season': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'series_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- property age#
Return Pretty string representing age of episode.
Example: “23d 12h” or “No releases seen”
- property age_timedelta#
- Returns:
Timedelta or None if episode is never seen
- property downloaded_releases#
- first_seen#
- id#
- identified_by#
- identifier#
- property is_premiere#
- is_season = False#
- property latest_release#
- Returns:
Latest downloaded Release or None
- number#
- releases#
- season#
- series_id#
- class flexget.components.series.db.EpisodeRelease[source]#
Bases:
VersionedBase- _quality#
- _sa_class_manager = {'_quality': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'downloaded': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'episode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'first_seen': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'proper_count': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'title': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- downloaded#
- episode_id#
- first_seen#
- id#
- property proper#
- proper_count#
- quality#
- title#
- class flexget.components.series.db.NormalizedComparator(expression)[source]#
Bases:
Comparator- Parameters:
expression (Union[_HasClauseElement[_T], SQLColumnExpression[_T]])
- operate(op, other)[source]#
Operate on an argument.
This is the lowest level of operation, raises
NotImplementedErrorby default.Overriding this on a subclass can allow common behavior to be applied to all operations. For example, overriding
ColumnOperatorsto applyfunc.lower()to the left and right side:class MyComparator(ColumnOperators): def operate(self, op, other, **kwargs): return op(func.lower(self), func.lower(other), **kwargs)
- Parameters:
op – Operator callable.
*other – the ‘other’ side of the operation. Will be a single scalar for most operations.
**kwargs – modifiers. These may be passed by special operators such as
ColumnOperators.contains().
- _adapt_to_entity#
- _parententity#
- prop#
- class flexget.components.series.db.Season(**kwargs)[source]#
Bases:
VersionedBase- _sa_class_manager = {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'identified_by': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'identifier': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'releases': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'season': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'series_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- property age#
Return Pretty string representing age of episode.
Example: “23d 12h” or “No releases seen”
- property age_timedelta#
- Returns:
Timedelta or None if seasons is never seen
- property completed#
Return True if the season has any released marked as downloaded.
- property downloaded_releases#
- first_seen#
- id#
- identified_by#
- identifier#
- property is_premiere#
- is_season = True#
- property latest_release#
- Returns:
Latest downloaded Release or None
- releases#
- season#
- series_id#
- class flexget.components.series.db.SeasonRelease[source]#
Bases:
VersionedBase- _quality#
- _sa_class_manager = {'_quality': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'downloaded': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'first_seen': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'proper_count': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'season_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'title': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- downloaded#
- first_seen#
- id#
- property proper#
- proper_count#
- quality#
- season_id#
- title#
- class flexget.components.series.db.Series(**kwargs)[source]#
Bases:
VersionedBaseName is handled case insensitively transparently.
- _name#
- _name_normalized#
- _sa_class_manager = {'_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, '_name_normalized': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'alternate_names': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'begin': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'begin_episode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'episodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'identified_by': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'in_tasks': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'seasons': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- alternate_names#
- begin#
- begin_episode_id#
- property completed_seasons#
- episodes#
- id#
- identified_by#
- in_tasks#
- name#
- property name_normalized#
- seasons#
- class flexget.components.series.db.SeriesTask(name)[source]#
Bases:
VersionedBase- _sa_class_manager = {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'series_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
- id#
- name#
- series_id#
- flexget.components.series.db.add_series_entity(session, series, identifier, quality=None)[source]#
Add entity identified by identifier to series name in database.
- flexget.components.series.db.auto_identified_by(series)[source]#
Determine if series name should be considered identified by episode or id format.
Returns ‘ep’, ‘sequence’, ‘date’ or ‘id’ if enough history is present to identify the series’ id type. Returns ‘auto’ if there is not enough history to determine the format yet
- flexget.components.series.db.db_cleanup(manager, session)[source]#
- Parameters:
session (sessionmaker(class_='ContextSession', bind=None, autoflush=True, expire_on_commit=True))
- Return type:
None
- flexget.components.series.db.delete_episode_release_by_id(release_id)[source]#
- Parameters:
release_id (int)
- Return type:
None
- flexget.components.series.db.delete_season_release_by_id(release_id)[source]#
- Parameters:
release_id (int)
- Return type:
None
- flexget.components.series.db.episode_by_id(episode_id, session=None)[source]#
Return an instance of an episode by querying its ID.
- flexget.components.series.db.episode_in_show(series_id, episode_id)[source]#
Return True if episode_id is part of show with series_id, else return False.
- flexget.components.series.db.episode_release_by_id(release_id, session=None)[source]#
Return an instance of an episode release by querying its ID.
- Parameters:
release_id (int)
session (sessionmaker(class_='ContextSession', bind=None, autoflush=True, expire_on_commit=True))
- Return type:
- flexget.components.series.db.get_all_entities(series, session, sort_by='age', reverse=False)[source]#
- flexget.components.series.db.get_episode_releases(episode, downloaded=None, start=None, stop=None, count=False, descending=False, sort_by=None, session=None)[source]#
Return all releases for a given episode.
- flexget.components.series.db.get_latest_episode_release(series, downloaded=True, season=None)[source]#
Return instance of Episode or None if not found.
- flexget.components.series.db.get_latest_release(series, downloaded=True, season=None)[source]#
Return the latest downloaded entity of a series, either season pack or episode.
- Parameters:
- Returns:
- Return type:
EpisodeRelease | SeasonRelease | None
- flexget.components.series.db.get_latest_season_pack_release(series, downloaded=True, season=None)[source]#
Return the latest season pack release for a series.
- flexget.components.series.db.get_season_releases(season, downloaded=None, start=None, stop=None, count=False, descending=False, sort_by=None, session=None)[source]#
Return all releases for a given season.
- flexget.components.series.db.new_eps_after(series, since_ep, session)[source]#
Return number of episodes since then.
- flexget.components.series.db.release_in_episode(episode_id, release_id)[source]#
Return True if release_id is part of episode with episode_id, else return False.
- flexget.components.series.db.release_in_season(season_id, release_id)[source]#
Return True if release_id is part of episode with episode_id, else return False.
- flexget.components.series.db.remove_series(name, forget=False)[source]#
Remove a whole series name from database.
- flexget.components.series.db.remove_series_entity(name, identifier, forget=False)[source]#
Remove all entities by identifier from series name from database.
- flexget.components.series.db.season_by_id(season_id, session=None)[source]#
Return an instance of an season by querying its ID.
- flexget.components.series.db.season_in_show(series_id, season_id)[source]#
Return True if episode_id is part of show with series_id, else return False.
- flexget.components.series.db.season_release_by_id(release_id, session=None)[source]#
Return an instance of an episode release by querying its ID.
- Parameters:
release_id (int)
session (sessionmaker(class_='ContextSession', bind=None, autoflush=True, expire_on_commit=True))
- Return type:
- flexget.components.series.db.show_by_id(show_id, session=None)[source]#
Return an instance of a show by querying its ID.
- flexget.components.series.db.show_episodes(series, start=None, stop=None, count=False, descending=False, session=None)[source]#
Return all episodes of a given series.
- flexget.components.series.db.show_seasons(series, start=None, stop=None, count=False, descending=False, session=None)[source]#
Return all seasons of a given series.
- flexget.components.series.db.shows_by_exact_name(normalized_name, session=None)[source]#
Return all series matching normalized_name.
- flexget.components.series.db.shows_by_name(normalized_name, session=None)[source]#
Return all series matching normalized_name.
- flexget.components.series.db.store_parser(session, parser, series=None, quality=None)[source]#
Push series information into database. Returns added/existing release.
- Parameters:
session (Session) – Database session to use
parser (SeriesParseResult) – parser for release that should be added to database
series (Series) – Series in database to add release to. Will be looked up if not provided.
quality (Quality) – If supplied, this will override the quality from the series parser
- Returns:
List of Releases
- Return type: