Improve calculation for transcode progress bar

This commit is contained in:
JonnyWong16 2022-02-13 11:59:06 -08:00
parent cfd1bf445f
commit 6d84d1b4c9
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 13 additions and 4 deletions

View file

@ -1734,6 +1734,8 @@ class PmsConnect(object):
transcode_progress = helpers.get_xml_attr(transcode_info, 'progress')
transcode_speed = helpers.get_xml_attr(transcode_info, 'speed')
transcode_min_offset = helpers.get_xml_attr(transcode_info, 'minOffsetAvailable')
transcode_max_offset = helpers.get_xml_attr(transcode_info, 'maxOffsetAvailable')
transcode_details = {'transcode_key': helpers.get_xml_attr(transcode_info, 'key'),
'transcode_throttled': int(helpers.get_xml_attr(transcode_info, 'throttled') == '1'),
@ -1746,6 +1748,8 @@ class PmsConnect(object):
'transcode_height': helpers.get_xml_attr(transcode_info, 'height'), # Blank but keep backwards compatibility
'transcode_container': helpers.get_xml_attr(transcode_info, 'container'),
'transcode_protocol': helpers.get_xml_attr(transcode_info, 'protocol'),
'transcode_min_offset_available': int(round(helpers.cast_to_float(transcode_min_offset), 0)),
'transcode_max_offset_available': int(round(helpers.cast_to_float(transcode_max_offset), 0)),
'transcode_hw_requested': int(helpers.get_xml_attr(transcode_info, 'transcodeHwRequested') == '1'),
'transcode_hw_decode': helpers.get_xml_attr(transcode_info, 'transcodeHwDecoding'),
'transcode_hw_decode_title': helpers.get_xml_attr(transcode_info, 'transcodeHwDecodingTitle'),
@ -1771,6 +1775,8 @@ class PmsConnect(object):
'transcode_height': '',
'transcode_container': '',
'transcode_protocol': '',
'transcode_min_offset_available': 0,
'transcode_max_offset_available': 0,
'transcode_hw_requested': 0,
'transcode_hw_decode': '',
'transcode_hw_decode_title': '',