Skip to content

Commit

Permalink
add support for progress in unmanic ui
Browse files Browse the repository at this point in the history
  • Loading branch information
mmenanno committed Jun 17, 2024
1 parent ed2d1c2 commit 833427f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/mkvpropedit/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import logging
import os
import re
import subprocess
import xml.etree.cElementTree as ET

Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -166,4 +178,6 @@ def process_file():
else:
process_file()

data['command_progress_parser'] = parse_progress

return data

0 comments on commit 833427f

Please sign in to comment.