mpvQC

Export Templates

mpvQC allows for customizing report exports using the Jinja template engine. To begin, follow these steps:

  1. Create a new file in the export-template directory with the .jinja extension (e.g., MyTemplate.jinja). The location of the export-template directory varies depending on your operating system:
    • On Windows: appdata/export-templates
    • On Linux: ~/.var/app/io.github.mpvqc.mpvQC/config/mpvQC/export-templates
  2. Edit the template
  3. Restart mpvQC

Afterward, the file menu will include a new option to export reports using the newly customized template.

Documentation

Alongside default Jinja expressions, mpvQC introduces the following Properties and Filters:

Properties

NameTypeDescription
 
write_dateboolIndicates whether the current date and time should be included in reports.
datestrDate and time formatted according to the user’s selected language (QLocale.FormatType.LongFormat).
 
write_generatorboolIndicates whether the report should include the generator name and version (e.g., “mpvQC 0.9.0”).
generatorstrThe name and version of mpvQC being used.
 
write_video_pathboolIndicates whether the path of the video should be included in reports.
video_pathstrThe absolute path of the video file, or an empty string if no video is present.
video_namestrThe name and extension of the video file, or an empty string if no video is present.
 
write_nicknameboolIndicates whether the user’s nickname should be included in reports.
nicknamestrThe nickname of the person creating the report.
 
commentslist[object]A list of comment objects, each with the following properties:
time: int: Time in seconds.
commentType: str Type of comment.
comment: str The actual comment.

Filters

NameDescription
 
as_timeConverts an int representing time in seconds into an HH:mm:ss formatted string.
Example: [{{ comment['time'] | as_time }}] will output [00:00:00] for a time value of 0 while iterating over comments.
as_comment_typeTranslates the comment type into the user’s currently selected language.
Example: [{{ comment['commentType'] | as_comment_type }}] will output [Ausdruck] for a commentType value of Phrasing while iterating over comments.

Example Template

Internally, mpvQC utilizes the following template to save Quality Control (QC) documents:

[FILE]
{{ 'date      : ' + date + '\n' if write_date else '' -}}
{{ 'generator : ' + generator + '\n' if write_generator else '' -}}
{{ 'nick      : ' + nickname + '\n' if write_nickname else '' -}}
{{ 'path      : ' + video_path + '\n' if write_video_path else '' -}}

{{ '\n' }}[DATA]
{% for comment in comments -%}
[{{ comment['time'] | as_time }}] [{{ comment['commentType'] | as_comment_type }}] {{ comment['comment'] | trim }}
{% endfor -%}

# total lines: {{ comments | count }}