diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 869d6766..171b42b0 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -50,13 +50,21 @@ DOCUMENTATION :: END return file_type return codec - # Get audio codec file + # Get video codec file def vf(codec): for pattern, file_type in MEDIA_FLAGS_VIDEO.iteritems(): if re.match(pattern, codec): return file_type return codec + # Get video resolution file + def vr(resolution): + print(resolution) + if resolution in ('1080i', '576i', '480i'): + return resolution + else: + return resolution.lower().rstrip('ip') + def br(text): return text.replace('\n', '

') %> @@ -248,7 +256,7 @@ DOCUMENTATION :: END % endif % if data['media_type'] != 'track' and media_info['video_resolution']: - + % endif % if media_info['audio_codec']: diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 006664c4..39a74980 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -1050,6 +1050,7 @@ class DataFactory(object): 'session_history_metadata.labels, ' \ 'session_history_media_info.container, session_history_media_info.bitrate, ' \ 'session_history_media_info.video_codec, session_history_media_info.video_resolution, ' \ + 'session_history_media_info.video_full_resolution, ' \ 'session_history_media_info.video_framerate, session_history_media_info.audio_codec, ' \ 'session_history_media_info.audio_channels, session_history_metadata.live, ' \ 'session_history_metadata.channel_call_sign, session_history_metadata.channel_identifier, ' \ @@ -1077,6 +1078,7 @@ class DataFactory(object): 'bitrate': item['bitrate'], 'video_codec': item['video_codec'], 'video_resolution': item['video_resolution'], + 'video_full_resolution': item['video_full_resolution'], 'video_framerate': item['video_framerate'], 'audio_codec': item['audio_codec'], 'audio_channels': item['audio_channels'], diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 52f3db18..a19a9296 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -1282,7 +1282,7 @@ class PmsConnect(object): medias = [] media_items = metadata_main.getElementsByTagName('Media') for media in media_items: - video_full_resolution_scan_type = None + video_full_resolution_scan_type = '' parts = [] part_items = media.getElementsByTagName('Part') @@ -1293,8 +1293,7 @@ class PmsConnect(object): for stream in stream_items: if helpers.get_xml_attr(stream, 'streamType') == '1': video_scan_type = helpers.get_xml_attr(stream, 'scanType') - if video_full_resolution_scan_type is None: - video_full_resolution_scan_type = video_scan_type + video_full_resolution_scan_type = (video_full_resolution_scan_type or video_scan_type) streams.append({'id': helpers.get_xml_attr(stream, 'id'), 'type': helpers.get_xml_attr(stream, 'streamType'), @@ -1354,12 +1353,10 @@ class PmsConnect(object): 'selected': int(helpers.get_xml_attr(part, 'selected') == '1') }) - video_resolution = helpers.get_xml_attr(media, 'videoResolution').lower() - video_full_resolution = '' - if video_full_resolution_scan_type is not None: - video_full_resolution = common.VIDEO_RESOLUTION_OVERRIDES.get( - video_resolution, video_resolution + (video_full_resolution_scan_type[:1] or 'p') - ) + video_resolution = helpers.get_xml_attr(media, 'videoResolution').lower().rstrip('ip') + video_full_resolution = common.VIDEO_RESOLUTION_OVERRIDES.get( + video_resolution, video_resolution + (video_full_resolution_scan_type[:1] or 'p') + ) audio_channels = helpers.get_xml_attr(media, 'audioChannels') @@ -1831,7 +1828,7 @@ class PmsConnect(object): if helpers.cast_to_int(stream_video_width) >= 3840: stream_video_resolution = '4k' else: - stream_video_resolution = helpers.get_xml_attr(stream_media_info, 'videoResolution').rstrip('p').lower() + stream_video_resolution = helpers.get_xml_attr(stream_media_info, 'videoResolution').lower().rstrip('ip') stream_audio_channels = helpers.get_xml_attr(stream_media_info, 'audioChannels')