upsies.jobs.scene

Scene release search and check

Classes

class upsies.jobs.scene.SceneCheckJob(*, home_directory=None, cache_directory=None, cache_id='', ignore_cache=False, no_output_is_ok=False, hidden=False, autostart=True, guaranteed=False, precondition=None, prejobs=(), callbacks={}, **kwargs)[source]

Bases: JobBase

Verify scene release name and content

This job adds the following signals to signal:

ask_release_name

Emitted if the user must pick a release name from multiple search results. Registered callbacks get a sequence of release names as positional argument.

ask_is_scene_release

Emitted after we made our best guess and the user must approve or override it. Registered callbacks get a SceneCheckResult enum as a positional argument.

checked

Emitted after is_scene_release is set. Registered callbacks get a SceneCheckResult enum as a positional argument.

cache_id = None
property content_stem

Final segment of content_path without the file extension

property is_scene_release

SceneCheckResult enum or None before job is finished

initialize(*, content_path, predb=None, force=None)[source]

Set internal state

Parameters:
  • predbPredbApiBase or MultiPredbApi

  • content_path – Path to video file or directory that contains a video file or release name

  • force (bool) – Predetermined check result; True (is scene), False (is not scene) or None (autodetect)

async run()[source]

Do the work

This method is called by start(). Its coroutine is passed to add_task().

Any keyword arguments passed to initialize() are available via kwargs.

The job is_finished when all added tasks are done or cancelled. (See also finalize() and finalization().)

This method may call add_task() if more tasks are required.

user_selected_release_name(release_name)[source]

Must be called by the UI when the user picked a release name from search results

Parameters:

release_name – Scene release name as str or any falsy value for a non-scene release

set_result(is_scene_release)[source]

Make the final decision of whether this is a scene release or not and finish this job

Must be called by the UI in the handler of the signal ask_is_scene_release.

Parameters:

is_scene_releaseSceneCheckResult enum

stop_checking()[source]

Cancel any ongoing checking tasks

This method should be called by the UI if the user makes a decision while we are trying to autodetect.

class upsies.jobs.scene.SceneSearchJob(*, home_directory=None, cache_directory=None, cache_id='', ignore_cache=False, no_output_is_ok=False, hidden=False, autostart=True, guaranteed=False, precondition=None, prejobs=(), callbacks={}, **kwargs)[source]

Bases: JobBase

Search for scene release

This job adds the following signals to signal:

search_results

Emitted after new search results are available. Registered callbacks get a sequence of release names (str) as a positional argument.

cache_id = None
initialize(*, content_path, predb=None)[source]

Set internal state

Parameters:
  • predbPredbApiBase or MultiPredbApi

  • content_path – Path to video file or directory that contains a video file or release name

async run()[source]

Do the work

This method is called by start(). Its coroutine is passed to add_task().

Any keyword arguments passed to initialize() are available via kwargs.

The job is_finished when all added tasks are done or cancelled. (See also finalize() and finalization().)

This method may call add_task() if more tasks are required.