mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
325 lines
18 KiB
HTML
325 lines
18 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.html
|
|
Version: 0.1
|
|
Variable names: data [list]
|
|
|
|
data :: Usable parameters
|
|
|
|
data['stream_count'] Returns the current number of active streams
|
|
data['sessions'] Returns an array containing session data
|
|
|
|
data[sessions] :: 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.
|
|
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:
|
|
% if data['stream_count'] != '0':
|
|
% for a in data['sessions']:
|
|
<div class="dashboard-instance" id="instance-${a['session_key']}">
|
|
% if (a['media_type'] == 'movie' or a['media_type'] == 'episode' or a['media_type'] == 'track') and a['rating_key']:
|
|
<a href="info?rating_key=${a['rating_key']}">
|
|
% else:
|
|
<a href="#">
|
|
% endif
|
|
<div class="dashboard-activity-poster">
|
|
% if not a['art'].startswith('interfaces') or not a['thumb'].startswith('interfaces'):
|
|
% if (a['media_type'] == 'movie' and not a['indexes']) or (a['indexes'] and not a['view_offset']):
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(pms_image_proxy?img=${a['art']}&width=500&height=280&fallback=art);"></div>
|
|
% elif (a['media_type'] == 'episode' and not a['indexes']) or (a['indexes'] and not a['view_offset']):
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(pms_image_proxy?img=${a['art']}&width=500&height=280&fallback=art);"></div>
|
|
% elif a['indexes']:
|
|
<div class="dashboard-activity-poster-face bif" style="background-image: url(pms_image_proxy?img=${a['bif_thumb']}&width=500&height=280&fallback=art); display: none;"></div>
|
|
% else:
|
|
% if a['media_type'] == 'track':
|
|
<div class="dashboard-activity-cover-face-bg" style="background-image: url(pms_image_proxy?img=${a['thumb']}&width=300&height=300&fallback=cover);"></div>
|
|
<div class="dashboard-activity-cover-face" style="background-image: url(pms_image_proxy?img=${a['thumb']}&width=300&height=300&fallback=cover);"></div>
|
|
% elif a['media_type'] == 'clip':
|
|
% if a['art'][:4] == 'http':
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(${a['art']});"></div>
|
|
% elif a['thumb'][:4] == 'http':
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(${a['thumb']});"></div>
|
|
% else:
|
|
% if a['art']:
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(pms_image_proxy?img=${a['art']}&width=500&height=280&fallback=art);"></div>
|
|
% else:
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(pms_image_proxy?img=${a['thumb']}&width=500&height=280&fallback=art);"></div>
|
|
% endif
|
|
% endif
|
|
% elif a['media_type'] == 'photo':
|
|
<div class="dashboard-activity-poster-face bif" style="background-image: url(pms_image_proxy?img=${a['thumb']}&width=500&height=500&fallback=cover);"></div>
|
|
% else:
|
|
<div class="dashboard-activity-cover-face" style="background-image: url(pms_image_proxy?img=${a['thumb']}&width=300&height=300&fallback=cover);"></div>
|
|
% endif
|
|
% endif
|
|
% else:
|
|
<div class="dashboard-activity-poster-face" style="background-image: url(${a['art']});"></div>
|
|
% endif
|
|
<div class="dashboard-activity-button-info">
|
|
<button type="button" class="btn btn-activity-info btn-lg" data-target="#stream-${a['session_key']}">
|
|
<i class="fa fa-info-circle"></i>
|
|
</button>
|
|
</div>
|
|
<div id="stream-${a['session_key']}" class="dashboard-activity-info-details-overlay">
|
|
<div class="dashboard-activity-info-details-content">
|
|
<div id="platform-${a['session_key']}" title="${a['platform']}">
|
|
<script>
|
|
$("#platform-${a['session_key']}").html("<div class='dashboard-activity-info-platform-box' style='background-image: url(" + getPlatformImagePath('${a['platform']}') + ");'>");
|
|
</script>
|
|
</div>
|
|
<div class="dashboard-activity-info-platform">
|
|
<strong>${a['player']}</strong><br />
|
|
% if a['state'] == 'playing':
|
|
State <strong>Playing</strong>
|
|
% elif a['state'] == 'paused':
|
|
State <strong>Paused</strong>
|
|
% elif a['state'] == 'buffering':
|
|
State <strong>Buffering</strong>
|
|
% endif
|
|
</div>
|
|
% if a['media_type'] == 'track':
|
|
% if a['audio_decision'] == 'direct play':
|
|
Stream <strong>Direct Play</strong>
|
|
% elif a['audio_decision'] == 'copy':
|
|
Stream <strong>Direct Stream</strong>
|
|
% else:
|
|
Stream <strong>Transcoding
|
|
(Speed: ${a['transcode_speed']})
|
|
% if a['throttled'] == '1':
|
|
(Throttled)
|
|
% endif
|
|
</strong>
|
|
% endif
|
|
<br />
|
|
% if a['audio_decision'] == 'direct play':
|
|
Audio <strong>Direct Play (${a['audio_codec']}) (${a['audio_channels']}ch)</strong>
|
|
% elif a['audio_decision'] == 'copy':
|
|
Audio <strong>Direct Stream (${a['transcode_audio_codec']}) (${a['transcode_audio_channels']}ch)</strong>
|
|
% elif a['audio_decision'] == 'transcode':
|
|
Audio <strong>Transcode (${a['transcode_audio_codec']}) (${a['transcode_audio_channels']}ch)</strong>
|
|
% endif
|
|
% elif a['media_type'] == 'episode' or a['media_type'] == 'movie' or a['media_type'] == 'clip':
|
|
% if a['video_decision'] == 'direct play' and a['audio_decision'] == 'direct play':
|
|
Stream <strong>Direct Play</strong>
|
|
% elif a['video_decision'] == 'copy' and a['audio_decision'] == 'copy':
|
|
Stream <strong>Direct Stream</strong>
|
|
% else:
|
|
Stream <strong>Transcoding
|
|
(Speed: ${a['transcode_speed']})
|
|
% if a['throttled'] == '1':
|
|
(Throttled)
|
|
% endif
|
|
</strong>
|
|
% endif
|
|
<br />
|
|
% if a['video_decision'] == 'direct play':
|
|
Video <strong>Direct Play (${a['video_codec']}) (${a['width']}x${a['height']})</strong>
|
|
% elif a['video_decision'] == 'copy':
|
|
Video <strong>Direct Stream (${a['transcode_video_codec']}) (${a['width']}x${a['height']})</strong>
|
|
% elif a['video_decision'] == 'transcode':
|
|
Video <strong>Transcode (${a['transcode_video_codec']}) (${a['transcode_width']}x${a['transcode_height']})</strong>
|
|
% endif
|
|
<br />
|
|
% if a['audio_decision'] == 'direct play':
|
|
Audio <strong>Direct Play (${a['audio_codec']}) (${a['audio_channels']}ch)</strong>
|
|
% elif a['audio_decision'] == 'copy':
|
|
Audio <strong>Direct Stream (${a['transcode_audio_codec']}) (${a['transcode_audio_channels']}ch)</strong>
|
|
% elif a['audio_decision'] == 'transcode':
|
|
Audio <strong>Transcode (${a['transcode_audio_codec']}) (${a['transcode_audio_channels']}ch)</strong>
|
|
% endif
|
|
% elif a['media_type'] == 'photo':
|
|
% if a['video_decision'] == 'direct play':
|
|
Stream <strong>Direct Play</strong>
|
|
% elif a['video_decision'] == 'copy':
|
|
Stream <strong>Direct Stream</strong>
|
|
% else:
|
|
Stream <strong>
|
|
Transcoding
|
|
(Speed: ${a['transcode_speed']})
|
|
% if a['throttled'] == '1':
|
|
(Throttled)
|
|
% endif
|
|
</strong>
|
|
% endif
|
|
% endif
|
|
<br>
|
|
</div>
|
|
</div>
|
|
% if a['media_type'] != 'photo':
|
|
<div class="dashboard-activity-poster-info-bar">
|
|
<div class="dashboard-activity-poster-info-ip-address">
|
|
% if a['ip_address']:
|
|
<span>IP: ${a['ip_address']}</span>
|
|
% else:
|
|
<span>IP: N/A</span>
|
|
% endif
|
|
<br />
|
|
ETA:
|
|
<span id="stream-eta-${a['session_key']}">
|
|
<script>
|
|
$("#stream-eta-${a['session_key']}").html(moment().add(parseInt(${a['duration']}) - parseInt(${a['view_offset']}), 'milliseconds').format(time_format));
|
|
</script>
|
|
</span>
|
|
</div>
|
|
<div class="dashboard-activity-poster-info-time">
|
|
<span class="progress_time">${a['view_offset']}</span>/<span class="progress_time">${a['duration']}</span>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
</div>
|
|
% if (a['media_type'] == 'movie' or a['media_type'] == 'episode' or a['media_type'] == 'track') and a['rating_key']:
|
|
</a>
|
|
% else:
|
|
</a>
|
|
% endif
|
|
<div class="dashboard-activity-progress">
|
|
<div class="dashboard-activity-progress-bar">
|
|
<div class="bufferbar" style="width: ${a['transcode_progress']}%" data-toggle="tooltip" title="Transcoder Progress">${a['transcode_progress']}%</div>
|
|
<div class="bar" style="width: ${a['progress_percent']}%" data-toggle="tooltip" title="Stream Progress">${a['progress_percent']}%</div>
|
|
</div>
|
|
</div>
|
|
<div class="dashboard-activity-metadata-wrapper">
|
|
% if a['user_id']:
|
|
<a href="user?user_id=${a['user_id']}">
|
|
<div class="dashboard-activity-metadata-user-thumb" style="background-image: url(${a['user_thumb']});"></div>
|
|
</a>
|
|
% else:
|
|
<div class="dashboard-activity-metadata-user-thumb" style="background-image: url(${a['user_thumb']});"></div>
|
|
% endif
|
|
<div class="dashboard-activity-metadata-title">
|
|
% if a['state'] == 'playing':
|
|
<i class="fa fa-play"></i>
|
|
% elif a['state'] == 'paused':
|
|
<i class="fa fa-pause"></i>
|
|
% elif a['state'] == 'buffering':
|
|
<i class="fa fa-spinner"></i>
|
|
% endif
|
|
% if a['rating_key']:
|
|
% if a['media_type'] == 'episode':
|
|
<a href="info?rating_key=${a['rating_key']}" title="${a['grandparent_title']} - ${a['title']}">${a['grandparent_title']} - ${a['title']}</a>
|
|
% elif a['media_type'] == 'movie':
|
|
<a href="info?rating_key=${a['rating_key']}" title="${a['title']}">${a['title']}</a>
|
|
% elif a['media_type'] == 'clip':
|
|
<span title="${a['title']}">${a['title']}</span>
|
|
% elif a['media_type'] == 'track':
|
|
<a href="info?rating_key=${a['rating_key']}" title="${a['grandparent_title']} - ${a['title']}">${a['grandparent_title']} - ${a['title']}</a>
|
|
% elif a['media_type'] == 'photo':
|
|
<span title="${a['parent_title']}">${a['parent_title']}</span>
|
|
% else:
|
|
<span title="${a['title']}">${a['title']}</span>
|
|
% endif
|
|
% else:
|
|
${a['title']}
|
|
% endif
|
|
</div>
|
|
<div class="dashboard-activity-metadata-subtitle">
|
|
% if a['rating_key']:
|
|
% if a['media_type'] == 'episode':
|
|
<span title="S${a['parent_media_index']} · E${a['media_index']}">S${a['parent_media_index']} · E${a['media_index']}</span>
|
|
% elif a['media_type'] == 'movie':
|
|
<span title="${a['year']}">${a['year']}</span>
|
|
% elif a['media_type'] == 'track':
|
|
<a href="info?rating_key=${a['parent_rating_key']}" title="${a['parent_title']}">${a['parent_title']}</a>
|
|
% elif a['media_type'] == 'photo':
|
|
<span title="${a['title']}">${a['title']}</span>
|
|
% else:
|
|
<span title="${a['year']}">${a['year']}</span>
|
|
% endif
|
|
% endif
|
|
</div>
|
|
<div class="dashboard-activity-metadata-user">
|
|
% if a['user_id']:
|
|
<a href="user?user_id=${a['user_id']}" title="${a['friendly_name']}">${a['friendly_name']}</a>
|
|
% else:
|
|
${a['friendly_name']}
|
|
% endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
% endfor
|
|
<script>
|
|
// When using bif indexes make the image transition a little smoother.
|
|
$('.bif').each(function() {
|
|
$(this).hide().fadeIn(1000);
|
|
});
|
|
|
|
// Convert timestamps to readable times
|
|
$('.progress_time').each(function(index) {
|
|
$(this).html(millisecondsToMinutes($(this).text(), false));
|
|
});
|
|
|
|
// Show/Hide activity info
|
|
$('.btn-activity-info').on('click', function(e) {
|
|
e.preventDefault();
|
|
$($(this).attr('data-target')).toggle();
|
|
});
|
|
|
|
// Add hover class to dashboard-instance
|
|
$('.dashboard-activity-poster, .dashboard-activity-progress-bar').hover(function() {
|
|
$(this).closest('.dashboard-instance').addClass('hover');
|
|
}, function() {
|
|
$(this).closest('.dashboard-instance').removeClass('hover');
|
|
});
|
|
|
|
$('.bar, .bufferbar').tooltip({container: 'body', placement: 'right', delay: 50});
|
|
</script>
|
|
% else:
|
|
<div class="text-muted">Nothing is currently being watched.</div><br>
|
|
% endif
|
|
% else:
|
|
<div class="text-muted">There was an error communicating with your Plex Server. Please check your <a
|
|
href="settings">settings</a>.
|
|
</div><br>
|
|
% endif
|