Add identifying playback of synced items

This commit is contained in:
JonnyWong16 2017-11-02 18:33:18 -07:00
commit e1dc299cba
4 changed files with 61 additions and 35 deletions

View file

@ -92,10 +92,14 @@ DOCUMENTATION :: END
rating_key = data['grandparent_rating_key']
title = data['grandparent_title']
thumb = data['grandparent_thumb']
else:
rating_key = ''
title = ''
thumb = ''
%>
% if data['rating_key'] and data['media_type'] not in ('photo', 'clip'):
<a id="poster-url-${data['session_key']}" href="info?rating_key=${rating_key}" title="${title}" class="hidden-xs">
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(pms_image_proxy?img=${thumb}&width=300&height=450&fallback=poster&refresh=true);"></div>
<div id="poster-${data['session_key']}" class="dashboard-activity-${'cover' if data['media_type'] == 'track' else 'poster'}" style="background-image: url(pms_image_proxy?img=${thumb}&width=300&height=450&fallback=poster&refresh=true);"></div>
</a>
% elif data['media_type']:
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(pms_image_proxy?img=${thumb}&width=300&height=450&fallback=poster&refresh=true);"></div>
@ -103,7 +107,13 @@ DOCUMENTATION :: END
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(images/art.png);"></div>
% endif
<div class="dashboard-activity-info-icon">
<div id="platform-${data['session_key']}" class="dashboard-activity-info-platform${'-no-terminate' if not _session['user_group'] == 'admin' else ''}" title="${data['platform']}">
<%
if not _session['user_group'] == 'admin' or data['synced_version'] == '1':
no_terminate = '-no-terminate'
else:
no_terminate = ''
%>
<div id="platform-${data['session_key']}" class="dashboard-activity-info-platform${no_terminate}" title="${data['platform']}">
<script>
$("#platform-${data['session_key']}").css("background-image", "url(" + getPlatformImagePath('${data['platform']}') + ")");
</script>
@ -133,9 +143,9 @@ DOCUMENTATION :: END
br = helpers.cast_to_int(data['stream_bitrate']) or ''
if br:
if br > 1000:
br = '(' + str(round(br / 1000.0, 1)) + 'Mbps)'
br = '(' + str(round(br / 1000.0, 1)) + ' Mbps)'
else:
br = '(' + str(br) + 'kbps)'
br = '(' + str(br) + ' kbps)'
%>
${data['quality_profile']} ${br}
% else:
@ -170,7 +180,7 @@ DOCUMENTATION :: END
% elif data['transcode_decision'] == 'copy':
Direct Stream
% else:
Direct Play
Direct Play ${'(Synced)' if data['synced_version'] else ''}
% endif
</div>
</li>
@ -214,11 +224,11 @@ DOCUMENTATION :: END
<div class="sub-heading">Audio</div>
<div class="sub-value" id="audio_decision-${data['session_key']}">
% if data['stream_audio_decision'] == 'transcode':
Transcode (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout'].split('(')[0]} &rarr; ${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout']})
Transcode (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout'].split('(')[0].capitalize()} &rarr; ${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':
Direct Stream (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout']})
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]})
Direct Play (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout'].split('(')[0].capitalize()})
% endif
</div>
</li>
@ -268,17 +278,21 @@ DOCUMENTATION :: END
<li class="dashboard-activity-info-item">
<div class="sub-heading">Bandwidth</div>
<div class="sub-value">
% if data['media_type'] != 'photo' and 'location' in data:
% if data['media_type'] != 'photo' and data['bandwidth']:
<%
bw = helpers.cast_to_int(data['bandwidth']) or "Unknown"
if bw != "Unknown":
if bw > 1000:
bw = str(round(bw / 1000.0, 1)) + 'Mbps'
bw = str(round(bw / 1000.0, 1)) + ' Mbps'
else:
bw = str(bw) + 'kbps'
bw = str(bw) + ' kbps'
%>
<span id="stream-bandwidth-${data['session_key']}">${bw}</span>
<span id="streaming-brain-${data['session_key']}" data-toggle="tooltip" title="Streaming Brain Estimate"><i class="fa fa-info-circle"></i></span>
% elif data['synced_version'] == '1':
<span id="stream-bandwidth-${data['session_key']}">None</span>
% else:
<span id="stream-bandwidth-${data['session_key']}">Unknown</span>
% endif
</div>
</li>