mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 09:42:57 -07:00
Fallback stream duration
This commit is contained in:
parent
3df31bb01b
commit
7f2e740bc0
1 changed files with 5 additions and 8 deletions
|
@ -1479,10 +1479,10 @@ class PmsConnect(object):
|
||||||
|
|
||||||
# Get the bif thumbnail
|
# Get the bif thumbnail
|
||||||
indexes = helpers.get_xml_attr(stream_media_parts_info, 'indexes')
|
indexes = helpers.get_xml_attr(stream_media_parts_info, 'indexes')
|
||||||
progress = helpers.get_xml_attr(session, 'viewOffset')
|
view_offset = helpers.get_xml_attr(session, 'viewOffset')
|
||||||
if indexes == 'sd':
|
if indexes == 'sd':
|
||||||
part_id = helpers.get_xml_attr(stream_media_parts_info, 'id')
|
part_id = helpers.get_xml_attr(stream_media_parts_info, 'id')
|
||||||
bif_thumb = '/library/parts/{part_id}/indexes/sd/{progress}'.format(part_id=part_id, progress=progress)
|
bif_thumb = '/library/parts/{part_id}/indexes/sd/{view_offset}'.format(part_id=part_id, view_offset=view_offset)
|
||||||
else:
|
else:
|
||||||
bif_thumb = ''
|
bif_thumb = ''
|
||||||
|
|
||||||
|
@ -1505,7 +1505,7 @@ class PmsConnect(object):
|
||||||
'stream_video_resolution': stream_video_resolution,
|
'stream_video_resolution': stream_video_resolution,
|
||||||
'stream_video_height': helpers.get_xml_attr(stream_media_info, 'height'),
|
'stream_video_height': helpers.get_xml_attr(stream_media_info, 'height'),
|
||||||
'stream_video_width': helpers.get_xml_attr(stream_media_info, 'width'),
|
'stream_video_width': helpers.get_xml_attr(stream_media_info, 'width'),
|
||||||
'stream_duration': helpers.get_xml_attr(stream_media_info, 'duration'),
|
'stream_duration': helpers.get_xml_attr(stream_media_info, 'duration') or helpers.get_xml_attr(session, 'duration'),
|
||||||
'stream_container_decision': helpers.get_xml_attr(stream_media_parts_info, 'decision').replace('directplay', 'direct play'),
|
'stream_container_decision': helpers.get_xml_attr(stream_media_parts_info, 'decision').replace('directplay', 'direct play'),
|
||||||
'transcode_decision': transcode_decision,
|
'transcode_decision': transcode_decision,
|
||||||
'optimized_version': 1 if helpers.get_xml_attr(stream_media_info, 'proxyType') == '42' else 0,
|
'optimized_version': 1 if helpers.get_xml_attr(stream_media_info, 'proxyType') == '42' else 0,
|
||||||
|
@ -1620,16 +1620,13 @@ class PmsConnect(object):
|
||||||
# Entire session output (single dict for backwards compatibility)
|
# Entire session output (single dict for backwards compatibility)
|
||||||
session_output = {'session_key': helpers.get_xml_attr(session, 'sessionKey'),
|
session_output = {'session_key': helpers.get_xml_attr(session, 'sessionKey'),
|
||||||
'media_type': media_type,
|
'media_type': media_type,
|
||||||
'view_offset': progress,
|
'view_offset': view_offset,
|
||||||
'progress_percent': str(helpers.get_percent(progress, stream_details['stream_duration'])),
|
'progress_percent': str(helpers.get_percent(view_offset, stream_details['stream_duration'])),
|
||||||
'quality_profile': quality_profile,
|
'quality_profile': quality_profile,
|
||||||
'user': user_details['username'], # Keep for backwards compatibility
|
'user': user_details['username'], # Keep for backwards compatibility
|
||||||
'channel_stream': channel_stream
|
'channel_stream': channel_stream
|
||||||
}
|
}
|
||||||
|
|
||||||
if 'rating_key' not in session_output:
|
|
||||||
session_output['rating_key'] = helpers.get_xml_attr(session, 'ratingKey')
|
|
||||||
|
|
||||||
session_output.update(metadata_details)
|
session_output.update(metadata_details)
|
||||||
session_output.update(source_media_details)
|
session_output.update(source_media_details)
|
||||||
session_output.update(source_media_part_details)
|
session_output.update(source_media_part_details)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue