upsies.jobs.mediainfo
Wrapper for mediainfo command
Classes
- class upsies.jobs.mediainfo.MediainfoJob(*, 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:
JobBaseGet output from
mediainfocommandThis job adds the following signals to
signal:generating_reportEmitted before mediainfo report generation begins. Registered callbacks get the video file path
mediainfowas called with.generated_reportEmitted after mediainfo report generation has finished. Registered callbacks get the video file path
mediainfowas called with and the report text.
- cache_id = None
- property content_path
Instantiation argument of the same name
- initialize(*, content_path, from_all_videos=False, exclude_files=(), format='{MEDIAINFO}')[source]
Set internal state
- Parameters:
content_path – Path to video file or directory that contains a video file
from_all_videos (bool) – Whether to get
mediainfooutput from each video file or only from the first videoexclude_files –
Sequence of glob patterns (
str) andre.Patternobjects (return value fromre.compile()) that are matched against each relative path beneath content_pathGlob patterns are matched case-insensitively.
Note
Non-video files and stuff like Sample.mkv are always excluded (see
fs.find_main_videos()).format –
String that contains the placeholder
"{MEDIAINFO}", which is replaced by the actual mediainfoAny other placeholders are ignored.
- async run()[source]
Do the work
This method is called by
start(). Its coroutine is passed toadd_task().Any keyword arguments passed to
initialize()are available viakwargs.The job
is_finishedwhen alladded tasksare done or cancelled. (See alsofinalize()andfinalization().)This method may call
add_task()if more tasks are required.
- terminate(reason=None)[source]
Cancel all
added tasksDo nothing if job
is_finishedoris_terminated.- Parameters:
reason – Why this job is terminated (only used for debugging)
- property reports_by_file
Map video file paths to
mediainfooutputs gathered so farNote
For VIDEO_TS releases, one mediainfo is made for an
.IFOfile and a second mediainfo is made for a.VOBfile.