- % if data['stream_container_decision'] == 'transcode':
+ % if data.get('stream_container_decision') == 'transcode':
Transcode (${data['container'].upper()} → ${data['stream_container'].upper()})
% else:
Direct Play (${data['container'].upper()})
@@ -199,7 +197,7 @@ DOCUMENTATION :: END
Video
% if data['media_type'] in ('movie', 'episode', 'clip'):
- % if data['stream_video_decision'] == 'transcode':
+ % if data.get('stream_video_decision') == 'transcode':
<%
hw_d = hw_e = ''
if data['transcode_hw_requested'] == '1' and data['transcode_hw_full_pipeline'] == '0':
@@ -208,7 +206,7 @@ DOCUMENTATION :: END
hw_d = hw_e = ' (HW)'
%>
Transcode (${data['video_codec'].upper()}${hw_d} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])} → ${data['stream_video_codec'].upper()}${hw_e} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})
- % elif data['stream_video_decision'] == 'copy':
+ % elif data.get('stream_video_decision') == 'copy':
Direct Stream (${data['stream_video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})
% else:
Direct Play (${data['video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])})
@@ -223,9 +221,9 @@ DOCUMENTATION :: END
Audio
- % if data['stream_audio_decision'] == 'transcode':
+ % if data.get('stream_audio_decision') == 'transcode':
Transcode (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout'].split('(')[0].capitalize()} → ${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout'].split('(')[0].capitalize()})
- % elif data['stream_audio_decision'] == 'copy':
+ % elif data.get('stream_audio_decision') == 'copy':
Direct Stream (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout'].split('(')[0].capitalize()})
% else:
Direct Play (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout'].split('(')[0].capitalize()})
@@ -278,9 +276,9 @@ DOCUMENTATION :: END
Bandwidth
- % if data['media_type'] != 'photo' and data['bandwidth']:
+ % if data['media_type'] != 'photo' and helpers.cast_to_int(data['bandwidth']):
<%
- bw = helpers.cast_to_int(data['bandwidth']) or "Unknown"
+ bw = helpers.cast_to_int(data['bandwidth'])
if bw != "Unknown":
if bw > 1000:
bw = str(round(bw / 1000.0, 1)) + ' Mbps'
@@ -289,7 +287,7 @@ DOCUMENTATION :: END
%>
${bw}
- % elif data['synced_version'] == '1':
+ % elif data['synced_version'] == '1' or data['channel_stream'] == '1':
None
% else:
Unknown
@@ -301,6 +299,7 @@ DOCUMENTATION :: END
% if data['media_type'] != 'photo':
+ % if data['view_offset']:
ETA:
+ % else:
+ ETA: Unknown
0:00 /
+
+
+ % endif
% endif
@@ -343,28 +349,31 @@ DOCUMENTATION :: END
% endif
- % if data['rating_key']:
- % if data['media_type'] == 'episode':
+ % if data['channel_stream'] == '0':
+ % if data['media_type'] == 'movie':
+ ${data['title']}
+ % elif data['media_type'] == 'episode':
${data['grandparent_title']}
- ${data['title']}
- % elif data['media_type'] == 'movie':
- ${data['title']}
- % elif data['media_type'] == 'clip':
- ${data['title']}
% elif data['media_type'] == 'track':
${data['grandparent_title']}
- ${data['title']}
% elif data['media_type'] == 'photo':
${data['parent_title']}
+ % elif data['media_type'] == 'clip':
+ ${data['title']}
% else:
${data['title']}
% endif
+ % elif data['media_type'] == 'episode':
+ ${data['channel_title']}
+ - ${data['title']}
% else:
- ${data['title']}
+ ${data['title']}
% endif
diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html
index fc3555b1..6cba6667 100644
--- a/data/interfaces/default/index.html
+++ b/data/interfaces/default/index.html
@@ -422,8 +422,8 @@
}
$('#optimized_version-' + key).html(s.optimized_version_profile);
- if (s.media_type != 'photo' && s.bandwidth) {
- var bw = parseInt(s.bandwidth) || 'Unknown';
+ if (s.media_type != 'photo' && parseInt(s.bandwidth)) {
+ var bw = parseInt(s.bandwidth);
if (bw != "Unknown") {
if (bw > 1000) {
bw = (bw / 1000).toFixed(1) + ' Mbps';
@@ -496,14 +496,14 @@
setInterval( function(){
$('.progress_time_offset').each(function () {
- if ($(this).data('state') === 'playing') {
+ if ($(this).data('state') === 'playing' && $(this).data('view_offset')) {
var view_offset = parseInt($(this).data('view_offset'));
var timestamp = millisecondsToMinutes(view_offset, false);
$(this).html(timestamp).data('view_offset', view_offset + 1000)
}
});
$('.progress-bar').each(function () {
- if ($(this).data('state') === 'playing') {
+ if ($(this).data('state') === 'playing' && $(this).data('view_offset')) {
var view_offset = parseInt($(this).data('view_offset'));
var duration = parseInt($(this).data('stream_duration'));
var progress_percent = Math.trunc(view_offset / duration * 100)
diff --git a/plexpy/common.py b/plexpy/common.py
index 97317a83..0fbc45dc 100644
--- a/plexpy/common.py
+++ b/plexpy/common.py
@@ -61,6 +61,7 @@ AUDIO_CODEC_OVERRIDES = {'truehd': 'TrueHD'}
VIDEO_RESOLUTION_OVERRIDES = {'sd': 'SD',
'480': '480p',
+ '540': '540p',
'576': '576p',
'720': '720p',
'1080': '1080p',
diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py
index 5ab6b398..42e2fb00 100644
--- a/plexpy/pmsconnect.py
+++ b/plexpy/pmsconnect.py
@@ -1418,7 +1418,8 @@ class PmsConnect(object):
transcode_decision = 'direct play'
# Determine if a synced version is being played
- if media_type not in ('photo', 'clip') and not session.getElementsByTagName('Session') and transcode_decision == 'direct play':
+ if media_type not in ('photo', 'clip') and not session.getElementsByTagName('Session') \
+ and helpers.get_xml_attr(session, 'ratingKey').isdigit() and transcode_decision == 'direct play':
synced_version = 1
else:
synced_version = 0
@@ -1498,7 +1499,7 @@ class PmsConnect(object):
'stream_aspect_ratio': helpers.get_xml_attr(stream_media_info, 'aspectRatio'),
'stream_audio_codec': helpers.get_xml_attr(stream_media_info, 'audioCodec'),
'stream_audio_channels': stream_audio_channels,
- 'stream_audio_channel_layout': audio_details['stream_audio_channel_layout_'] or common.AUDIO_CHANNELS.get(stream_audio_channels, stream_audio_channels),
+ 'stream_audio_channel_layout': audio_details.get('stream_audio_channel_layout_') or common.AUDIO_CHANNELS.get(stream_audio_channels, stream_audio_channels),
'stream_video_codec': helpers.get_xml_attr(stream_media_info, 'videoCodec'),
'stream_video_framerate': helpers.get_xml_attr(stream_media_info, 'videoFrameRate'),
'stream_video_resolution': stream_video_resolution,
@@ -1519,7 +1520,9 @@ class PmsConnect(object):
source_media_details = source_media_part_details = \
source_video_details = source_audio_details = source_subtitle_details = {}
- if media_type == 'clip' and not helpers.get_xml_attr(session, 'ratingKey').isdigit():
+ if not helpers.get_xml_attr(session, 'ratingKey').isdigit():
+ channel_stream = 1
+
clip_media = session.getElementsByTagName('Media')[0]
audio_channels = helpers.get_xml_attr(clip_media, 'audioChannels')
metadata_details = {'media_type': media_type,
@@ -1565,9 +1568,13 @@ class PmsConnect(object):
'video_resolution': helpers.get_xml_attr(clip_media, 'videoResolution'),
'audio_codec': helpers.get_xml_attr(clip_media, 'audioCodec'),
'audio_channels': audio_channels,
- 'audio_channel_layout': common.AUDIO_CHANNELS.get(audio_channels, audio_channels)
+ 'audio_channel_layout': common.AUDIO_CHANNELS.get(audio_channels, audio_channels),
+ 'channel_icon': helpers.get_xml_attr(session, 'sourceIcon'),
+ 'channel_title': helpers.get_xml_attr(session, 'sourceTitle')
}
else:
+ channel_stream = 0
+
media_id = helpers.get_xml_attr(stream_media_info, 'id')
part_id = helpers.get_xml_attr(stream_media_parts_info, 'id')
@@ -1616,7 +1623,8 @@ class PmsConnect(object):
'view_offset': progress,
'progress_percent': str(helpers.get_percent(progress, stream_details['stream_duration'])),
'quality_profile': quality_profile,
- 'user': user_details['username'] # Keep for backwards compatibility
+ 'user': user_details['username'], # Keep for backwards compatibility
+ 'channel_stream': channel_stream
}
if 'rating_key' not in session_output: