mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
367 lines
No EOL
25 KiB
HTML
367 lines
No EOL
25 KiB
HTML
<%doc>
|
|
USAGE DOCUMENTATION :: PLEASE LEAVE THIS AT THE TOP OF THIS FILE
|
|
|
|
For Mako templating syntax documentation please visit: http://docs.makotemplates.org/en/latest/
|
|
|
|
Filename: current_activity_instance.html
|
|
Version: 0.1
|
|
Variable names: data {dict}
|
|
|
|
data :: Usable parameters
|
|
|
|
== Global keys ==
|
|
session_key Returns a unique session id for the active stream
|
|
rating_key Returns the unique identifier for the media item.
|
|
media_index Returns the index of the media item.
|
|
parent_media_index Returns the index of the media item's parent.
|
|
media_type Returns the type of session. Either 'track', 'episode' or 'movie'.
|
|
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
|
bif_thumb Returns the location of the item's bif thumbnail. Use with pms_image_proxy.
|
|
art Returns the location of the item's artwork
|
|
progress_percent Returns the current progress of the item. 0 to 100.
|
|
user Returns the name of the user owning the session.
|
|
user_id Returns the Plex user id if available.
|
|
machine_id Returns the machine id of the players being used.
|
|
friendly_name Returns the friendlly name of the user owning the session.
|
|
user_thumb Returns the profile picture of the user owning the session.
|
|
state Returns the state of the current session. Either 'playing', 'paused' or 'buffering'.
|
|
title Returns the name of the episode, movie or music track.
|
|
year Returns the year of the episode, movie, or clip.
|
|
ip_address Returns the ip address of the stream.
|
|
player Returns the name of the platform used to play the stream.
|
|
platform Returns the type of platform used to play the stream.
|
|
transcode_throttled Returns true if the transcode session is throttled.
|
|
transcode_progress Returns the current transcode progress of the item. 0 to 100.
|
|
transcode_speed Returns the current transcode speed of the item.
|
|
audio_decision Returns the audio transcode decision. Either 'transcode', 'copy' or 'direct play'.
|
|
audio_codec Returns the name of the audio codec.
|
|
audio_channels Returns the number of audio channels.
|
|
grandparent_title Returns the title of the item's grandparent.
|
|
parent_title Returns the title of the item's parent.
|
|
video_decision Returns the video transcode decision. Either 'transcode', 'copy' or 'direct play'.
|
|
video_codec Returns the name of the video codec.
|
|
height Returns the value of the video height.
|
|
width Returns the value of the video width.
|
|
container Returns the value of the media container.
|
|
bitrate Returns the value of the media bitrate.
|
|
video_resolution Returns the value of the video resolution.
|
|
video_framerate Returns the value of the video framerate.
|
|
video_aspect_ratio Returns the value of the video aspect ratio.
|
|
transcode_audio_channels Returns the amount of audio channels if there is a transcode session.
|
|
transcode_audio_codec Returns the name of the audio codec if there is a transcode session.
|
|
transcode_video_codec Returns the name of the video codec if there is a transcode session.
|
|
transcode_width Returns the video width if there is a transcode session.
|
|
transcode_height Returns the video height if there is a transcode session.
|
|
transcode_container Returns the value of media container if there is a transcode session.
|
|
transcode_protocol Returns the value of media protocol if there is a transcode session.
|
|
indexes Returns true if the media has media indexes and are enabled
|
|
|
|
DOCUMENTATION :: END
|
|
</%doc>
|
|
|
|
% if data is not None:
|
|
<%
|
|
from urllib import quote
|
|
from plexpy import helpers
|
|
import plexpy
|
|
%>
|
|
<div class="dashboard-activity-instance" id="instance-${data['session_key']}" data-key="${data['session_key']}" data-id="${data['session_id']}"
|
|
data-rating_key="${data['rating_key']}" data-parent_rating_key="${data['parent_rating_key']}" data-grandparent_rating_key="${data['grandparent_rating_key']}">
|
|
<div class="dashboard-activity-container">
|
|
<div class="dashboard-activity-background-overlay">
|
|
% if data['media_type'] != 'clip':
|
|
<div id="background-${data['session_key']}" class="dashboard-activity-background" style="background-image: url(pms_image_proxy?img=${data['art']}&width=500&height=280&fallback=art&refresh=true);"></div>
|
|
% else:
|
|
% if data['art'].startswith('http'):
|
|
<div id="background-${data['session_key']}" class="dashboard-activity-background" style="background-image: url(${data['art']});"></div>
|
|
% else:
|
|
<!--Hacky solution to escape the image url until I come up with something better-->
|
|
<div id="background-${data['session_key']}" class="dashboard-activity-background" style="background-image: url(pms_image_proxy?img=${quote(data['art'])}&width=500&height=280&fallback=art&refresh=true&clip=true);"></div>
|
|
% endif
|
|
% endif
|
|
% if data['media_type'] == 'movie':
|
|
<a id="poster-url-${data['session_key']}" href="info?rating_key=${data['rating_key']}" title="${data['title']}" class="hidden-xs">
|
|
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(pms_image_proxy?img=${data['thumb']}&width=300&height=450&fallback=poster&refresh=true);"></div>
|
|
</a>
|
|
% elif data['media_type'] == 'episode':
|
|
<a id="poster-url-${data['session_key']}" href="info?rating_key=${data['grandparent_rating_key']}" title="${data['grandparent_title']}" class="hidden-xs">
|
|
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(pms_image_proxy?img=${data['grandparent_thumb']}&width=300&height=450&fallback=poste&refresh=truer);"></div>
|
|
</a>
|
|
% elif data['media_type'] == 'track':
|
|
<a id="poster-url-${data['session_key']}" href="info?rating_key=${data['parent_rating_key']}" title="${data['parent_title']}" class="hidden-xs">
|
|
<div id="poster-${data['session_key']}" class="dashboard-activity-cover" style="background-image: url(pms_image_proxy?img=${data['parent_thumb']}&width=300&height=300&fallback=cover&refresh=true);"></div>
|
|
</a>
|
|
% elif data['media_type'] == 'photo':
|
|
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(pms_image_proxy?img=${data['parent_thumb']}&width=300&height=450&fallback=poster&refresh=true);"></div>
|
|
% elif data['media_type'] == 'clip':
|
|
<div id="poster-${data['session_key']}" class="dashboard-activity-poster" style="background-image: url(pms_image_proxy?img=${data['thumb']}&width=300&height=450&fallback=poster&refresh=true);"></div>
|
|
% else:
|
|
<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" title="${data['platform']}">
|
|
<script>
|
|
$("#platform-${data['session_key']}").css("background-image", "url(" + getPlatformImagePath('${data['platform']}') + ")");
|
|
</script>
|
|
</div>
|
|
% if _session['user_group'] == 'admin' and plexpy.CONFIG.PMS_PLEXPASS:
|
|
<div class="dashboard-activity-terminate-session" id="terminate-button-${data['session_key']}" data-key="${data['session_key']}" data-id="${data['session_id']}">
|
|
<span class="btn-terminate-session" data-toggle="tooltip" title="Terminate Stream">
|
|
<i class="fa fa-times"></i>
|
|
</span>
|
|
</div>
|
|
% endif
|
|
</div>
|
|
<div class="dashboard-activity-info-scroller scrollbar-macosx">
|
|
<div class="dashboard-activity-info">
|
|
<ul class="list-unstyled dashboard-activity-info-list">
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Platform</div>
|
|
<div class="sub-value">${data['platform']}</div>
|
|
</li>
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Player</div>
|
|
<div class="sub-value">${data['player']}</div>
|
|
</li>
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Quality</div>
|
|
<div class="sub-value" id="stream_quality-${data['session_key']}">
|
|
% if data['media_type'] != 'photo':
|
|
<%
|
|
br = helpers.cast_to_int(data['stream_bitrate']) or "Unknown"
|
|
br_units = "kbps"
|
|
if br != "Unknown" and br > 1000:
|
|
br = round(br / 1000.0, 1)
|
|
br_units = "Mbps"
|
|
%>
|
|
${data['quality_profile']} (${br} ${br_units})
|
|
% else:
|
|
${data['quality_profile']}
|
|
% endif
|
|
</div>
|
|
</li>
|
|
% if data['optimized_version'] == '1':
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Optimized</div>
|
|
<div class="sub-value" id="optimized_version-${data['session_key']}">
|
|
${data['optimized_version_profile']}
|
|
</div>
|
|
</li>
|
|
% endif
|
|
</ul>
|
|
<ul class="list-unstyled dashboard-activity-info-list">
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Stream</div>
|
|
<div class="sub-value" id="transcode_decision-${data['session_key']}">
|
|
% if data['transcode_decision'] == 'transcode':
|
|
Transcode
|
|
% if data['transcode_throttled'] == '1':
|
|
(Throttled)
|
|
% else:
|
|
(Speed: ${data['transcode_speed']})
|
|
% endif
|
|
% elif data['transcode_decision'] == 'copy':
|
|
Direct Stream
|
|
% else:
|
|
Direct Play
|
|
% endif
|
|
</div>
|
|
</li>
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Container</div>
|
|
<div class="sub-value" id="transcode_container-${data['session_key']}">
|
|
% if data['container'] != data['stream_container']:
|
|
Transcode (${data['container'].upper()} → ${data['stream_container'].upper()})
|
|
% else:
|
|
Direct Play (${data['container'].upper()})
|
|
% endif
|
|
</div>
|
|
</li>
|
|
% if data['media_type'] in ('movie', 'episode', 'clip', 'photo'):
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Video</div>
|
|
<div class="sub-value" id="video_decision-${data['session_key']}">
|
|
% if data['media_type'] in ('movie', 'episode', 'clip'):
|
|
% if data['video_decision'] == 'transcode':
|
|
<%
|
|
hw_d = ' (HW)' if data['transcode_hw_requested'] == '1' and data['transcode_hw_decode'] and data['transcode_hw_full_pipeline'] == '0' else ''
|
|
hw_e = ' (HW)' if data['transcode_hw_requested'] == '1' and data['transcode_hw_encode'] and data['transcode_hw_full_pipeline'] == '1' else ''
|
|
%>
|
|
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['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'])})
|
|
% endif
|
|
% elif data['media_type'] == 'photo':
|
|
Direct Play (${data['width']}x${data['height']})
|
|
% endif
|
|
</div>
|
|
</li>
|
|
% endif
|
|
% if data['media_type'] in ('movie', 'episode', 'clip', 'track'):
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Audio</div>
|
|
<div class="sub-value" id="audio_decision-${data['session_key']}">
|
|
% if data['audio_decision'] == 'transcode':
|
|
Transcode (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout']} → ${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout']})
|
|
% elif data['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']})
|
|
% else:
|
|
Direct Play (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout']})
|
|
% endif
|
|
</div>
|
|
</li>
|
|
% endif
|
|
% if data['media_type'] in ('movie', 'episode', 'clip'):
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Subtitle</div>
|
|
<div class="sub-value" id="subtitle_decision-${data['session_key']}">
|
|
% if data['subtitles'] == '1':
|
|
% if data['subtitle_decision'] == 'transcode':
|
|
Transcode (${data['subtitle_codec'].upper()} → ${data['stream_subtitle_codec'].upper()})
|
|
% elif data['subtitle_decision'] == 'copy':
|
|
Direct Stream (${data['subtitle_codec'].upper()})
|
|
% elif data['subtitle_decision'] == 'burn':
|
|
Burn (${data['subtitle_codec'].upper()})
|
|
% else:
|
|
Direct Play (${data['subtitle_codec'].upper()})
|
|
% endif
|
|
% else:
|
|
None
|
|
% endif
|
|
</div>
|
|
</li>
|
|
% endif
|
|
</ul>
|
|
<ul class="list-unstyled dashboard-activity-info-list">
|
|
<li class="dashboard-activity-info-item">
|
|
<div class="sub-heading">Location</div>
|
|
<div class="sub-value">
|
|
% if data['ip_address']:
|
|
${'LAN' if data['local'] == '1' else 'WAN'}: ${data['ip_address']}
|
|
<a href="#" class="external_ip-modal" data-toggle="modal" data-target="#ip-info-modal" data-ip="${data['ip_address']}">
|
|
<span id="external_ip-${data['session_key']}" class="external-ip-tooltip" data-toggle="tooltip" title="Lookup IP" style="display: none;"><i class="fa fa-map-marker"></i></span>
|
|
</a>
|
|
<script>
|
|
isPrivateIP("${data['ip_address']}").then(function () {
|
|
$("#external_ip-${data['session_key']}").hide();
|
|
}, function () {
|
|
$("#external_ip-${data['session_key']}").show();
|
|
});
|
|
</script>
|
|
% else:
|
|
N/A
|
|
% endif
|
|
</div>
|
|
</li>
|
|
<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:
|
|
<%
|
|
bw = helpers.cast_to_int(data['bandwidth']) or "Unknown"
|
|
bw_units = "kbps"
|
|
if bw != "Unknown" and bw > 1000:
|
|
bw = round(bw / 1000.0, 1)
|
|
bw_units = "Mbps"
|
|
%>
|
|
<span id="streaming-brain-${data['session_key']}" data-toggle="tooltip" title="Streaming Brain Estimate">
|
|
<span id="stream-bandwidth-${data['session_key']}">${bw} ${bw_units}</span>
|
|
</span>
|
|
% endif
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
% if data['media_type'] != 'photo':
|
|
<div class="dashboard-activity-info-time">
|
|
ETA:
|
|
<span id="stream-eta-${data['session_key']}">
|
|
<script>
|
|
$("#stream-eta-${data['session_key']}").html(moment().add(parseInt("${data['duration']}") - parseInt("${data['view_offset']}"), 'milliseconds').format(time_format));
|
|
</script>
|
|
</span><br /><span class="progress_time" id="stream-view-offset-${data['session_key']}">
|
|
<script>
|
|
$("#stream-view-offset-${data['session_key']}").html(millisecondsToMinutes(parseInt("${data['view_offset']}"), false));
|
|
</script>
|
|
</span> / <span class="progress_time" id="stream-duration-${data['session_key']}">
|
|
<script>
|
|
$("#stream-duration-${data['session_key']}").html(millisecondsToMinutes(parseInt("${data['duration']}"), false));
|
|
</script>
|
|
</span>
|
|
</div>
|
|
% endif
|
|
</div>
|
|
<div class="dashboard-activity-progress">
|
|
<div class="dashboard-activity-progress-bar">
|
|
<div id="buffer-bar-${data['session_key']}" class="buffer-bar" style="width: ${data['transcode_progress']}%" data-toggle="tooltip" title="Transcoder Progress ${data['transcode_progress']}%">${data['transcode_progress']}%</div>
|
|
<div id="progress-bar-${data['session_key']}" class="progress-bar" style="width: ${data['progress_percent']}%" data-toggle="tooltip" title="Stream Progress ${data['progress_percent']}%">${data['progress_percent']}%</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="dashboard-activity-metadata-wrapper">
|
|
% if data['user_id']:
|
|
<a href="user?user_id=${data['user_id']}" title="${data['friendly_name']}">
|
|
<div class="dashboard-activity-metadata-user-thumb" style="background-image: url(${data['user_thumb']});"></div>
|
|
</a>
|
|
% else:
|
|
<div class="dashboard-activity-metadata-user-thumb" style="background-image: url(${data['user_thumb']});"></div>
|
|
% endif
|
|
<div class="dashboard-activity-metadata-title">
|
|
<span id="play-state-${data['session_key']}">
|
|
% if data['state'] == 'playing':
|
|
<i class="fa fa-fw fa-play"></i>
|
|
% elif data['state'] == 'paused':
|
|
<i class="fa fa-fw fa-pause"></i>
|
|
% elif data['state'] == 'buffering':
|
|
<i class="fa fa-fw fa-spinner"></i>
|
|
% endif
|
|
</span>
|
|
% if data['rating_key']:
|
|
% if data['media_type'] == 'episode':
|
|
<a href="info?rating_key=${data['grandparent_rating_key']}" title="${data['grandparent_title']}">${data['grandparent_title']}</a>
|
|
- <a href="info?rating_key=${data['rating_key']}" title="${data['title']}">${data['title']}</a>
|
|
% elif data['media_type'] == 'movie':
|
|
<a href="info?rating_key=${data['rating_key']}" title="${data['title']}">${data['title']}</a>
|
|
% elif data['media_type'] == 'clip':
|
|
<span title="${data['title']}">${data['title']}</span>
|
|
% elif data['media_type'] == 'track':
|
|
<a id="metadata-grandparent_title-${data['session_key']}" href="info?rating_key=${data['grandparent_rating_key']}" title="${data['grandparent_title']}">${data['grandparent_title']}</a>
|
|
- <a id="metadata-title-${data['session_key']}" href="info?rating_key=${data['rating_key']}" title="${data['title']}">${data['title']}</a>
|
|
% elif data['media_type'] == 'photo':
|
|
<span title="${data['parent_title']}">${data['parent_title']}</span>
|
|
% else:
|
|
<span title="${data['title']}">${data['title']}</span>
|
|
% endif
|
|
% else:
|
|
${data['title']}
|
|
% endif
|
|
</div>
|
|
<div class="dashboard-activity-metadata-subtitle">
|
|
% if data['rating_key']:
|
|
% if data['media_type'] == 'episode':
|
|
<a href="info?rating_key=${data['parent_rating_key']}" title="Season ${data['parent_media_index']}" class="sub-heading">S${data['parent_media_index']}</a>
|
|
· <a href="info?rating_key=${data['rating_key']}" title="Episode ${data['media_index']}" class="sub-heading">E${data['media_index']}</a>
|
|
% elif data['media_type'] == 'movie':
|
|
<span title="${data['year']}" class="sub-heading">${data['year']}</span>
|
|
% elif data['media_type'] == 'track':
|
|
<a id="metadata-parent_title-${data['session_key']}" href="info?rating_key=${data['parent_rating_key']}" title="${data['parent_title']}" class="sub-heading">${data['parent_title']}</a>
|
|
% elif data['media_type'] == 'photo':
|
|
<span title="${data['title']}" class="sub-heading">${data['title']}</span>
|
|
% else:
|
|
<span title="${data['year']}" class="sub-heading">${data['year']}</span>
|
|
% endif
|
|
% endif
|
|
</div>
|
|
<div class="dashboard-activity-metadata-user">
|
|
% if data['user_id']:
|
|
<a href="user?user_id=${data['user_id']}" title="${data['friendly_name']}">${data['friendly_name']}</a>
|
|
% else:
|
|
${data['friendly_name']}
|
|
% endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif |