upsies.utils.predbs.base
Abstract base class for scene release databases
Classes
- class upsies.utils.predbs.base.PredbApiBase(config=None)[source]
Bases:
ABCBase class for scene release database APIs
- abstract property name
Unique name of the scene release database
- abstract property label
User-facing name of the scene release database
- property config
User configuration
This is a deep copy of
default_configthat is updated with the config argument from initialization.
- abstract property default_config
Default user configuration as a dictionary
- async search(query, *, only_existing_releases=True)[source]
Search for scene release
If there are no results and query is a directory path that looks like a season pack, perform one search per video file in that directory or any subdirectory. This is necessary to find mixed season packs.
- Parameters:
query –
SceneQueryobject orstrto pass tofrom_string()orcollections.abc.Mappingto pass tofrom_release()only_existing_releases (bool) – If this is truthy, imaginary season pack releases are created and added to the search results.
- Returns:
- Raises:
RequestError – if the search request fails
- async release_files(release_name)[source]
Map release file names to file information
If this is not implemented by the subclass,
NotImplementedErroris raised.Each file information is a dictionary that contains at least the keys
release_name,file_nameandsize. More keys may be available depending on the subclass implementation.If release_name is a season pack, information the relevant episode releases is returned.
- Parameters:
release_name (str) – Exact name of the release
- Raises:
RequestError – if request fails or release_name is not found