From 833427fc235259fa093924338d6acfbacdcbb35e Mon Sep 17 00:00:00 2001 From: mmenanno <1358708+mmenanno@users.noreply.github.com> Date: Sun, 16 Jun 2024 23:08:20 -0400 Subject: [PATCH] add support for progress in unmanic ui --- source/mkvpropedit/plugin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/mkvpropedit/plugin.py b/source/mkvpropedit/plugin.py index ad118c9e0..936f5b0aa 100644 --- a/source/mkvpropedit/plugin.py +++ b/source/mkvpropedit/plugin.py @@ -24,6 +24,7 @@ import logging import os +import re import subprocess import xml.etree.cElementTree as ET @@ -62,6 +63,17 @@ def __init__(self, *args, **kwargs): }, } +def parse_progress(line_text): + match = re.search(r'Progress[^\d]+(\d+)%', line_text) + if match: + progress = match.group(1) + else: + progress = '0' + + return { + 'percent': progress + } + def on_worker_process(data): """ @@ -166,4 +178,6 @@ def process_file(): else: process_file() + data['command_progress_parser'] = parse_progress + return data