<%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 % if data is not None: <% from urllib import quote import plexpy %>
% if (data['media_type'] == 'movie' or data['media_type'] == 'episode' or data['media_type'] == 'track') and data['rating_key']: % else: % endif
% if not data['art'].startswith('interfaces') or not data['thumb'].startswith('interfaces'): % if (data['media_type'] == 'movie' and not plexpy.CONFIG.PMS_USE_BIF) or (plexpy.CONFIG.PMS_USE_BIF and not data['view_offset']):
% elif (data['media_type'] == 'episode' and not plexpy.CONFIG.PMS_USE_BIF) or (plexpy.CONFIG.PMS_USE_BIF and not data['view_offset']):
% elif plexpy.CONFIG.PMS_USE_BIF:
% else: % if data['media_type'] == 'track':
% elif data['media_type'] == 'clip': % if data['art'].startswith('http'):
% elif data['thumb'].startswith('http'):
% else: % if data['art']:
% else:
% endif % endif % elif data['media_type'] == 'photo':
% else:
% endif % endif % else:
% endif % if _session['user_group'] == 'admin' and plexpy.CONFIG.PMS_PLEXPASS:
% endif
${data['player']}
% if data['state'] == 'playing': State Playing ${'(' + data['quality_profile'] + ')' if data['media_type'] != 'track' else ''} % elif data['state'] == 'paused': State Paused ${'(' + data['quality_profile'] + ')' if data['media_type'] != 'track' else ''} % elif data['state'] == 'buffering': State Buffering ${'(' + data['quality_profile'] + ')' if data['media_type'] != 'track' else ''} % endif
% if data['video_decision'] == 'transcode' or data['audio_decision'] == 'transcode': % if data['transcode_hardware'] == '1': Stream Transcode (HW) (Speed: ${data['transcode_speed']}) % else: Stream Transcode (Speed: ${data['transcode_speed']}) % endif % if data['transcode_throttled'] == '1': (Throttled) % endif % elif data['video_decision'] == 'copy' or data['audio_decision'] == 'copy': Stream Direct Stream % else: Stream Direct Play % endif
% if data['media_type'] in ('movie', 'episode', 'clip'): % if data['video_decision'] == 'transcode': Video Transcode (${data['video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])} → ${data['stream_video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])}) % elif data['video_decision'] == 'copy': Video Direct Stream (${data['stream_video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])}) % else: Video Direct Play (${data['video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])}) % endif
% endif % if data['media_type'] in ('movie', 'episode', 'clip', 'track') and data['audio_codec']: % if data['audio_decision'] == 'transcode': Audio 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': Audio Direct Stream (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout']}) % else: Audio Direct Play (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout']}) % endif
% else: Audio None
% endif % if data['media_type'] in ('movie', 'episode', 'clip') and data['subtitles'] == '1': % if data['subtitle_decision'] == 'transcode': Subtitle Transcode (${data['subtitle_codec'].upper()} → ${data['stream_subtitle_codec'].upper()}) % elif data['subtitle_decision'] == 'copy': Subtitle Direct Stream (${data['subtitle_codec'].upper()}) % elif data['subtitle_decision'] == 'burn': Subtitle Burn (${data['subtitle_codec'].upper()}) % else: Subtitle Direct Play (${data['subtitle_codec'].upper()}) % endif % elif data['media_type'] != 'track': Subtitle None % endif
% if data['media_type'] != 'photo':
% if data['ip_address']: IP: ${data['ip_address']} % else: IP: N/A % endif
ETA:
/
% endif
% if (data['media_type'] == 'movie' or data['media_type'] == 'episode' or data['media_type'] == 'track') and data['rating_key']: % else: % endif
${data['transcode_progress']}%
${data['progress_percent']}%
% if data['user_id']:
% else:
% endif
% if data['state'] == 'playing': % elif data['state'] == 'paused': % elif data['state'] == 'buffering': % endif % if data['rating_key']: % if 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']} % else: ${data['title']} % endif % else: ${data['title']} % endif
% if data['rating_key']: % if data['media_type'] == 'episode': S${data['parent_media_index']} · E${data['media_index']} % elif data['media_type'] == 'movie': ${data['year']} % elif data['media_type'] == 'track': ${data['parent_title']} % elif data['media_type'] == 'photo': ${data['title']} % else: ${data['year']} % endif % endif
% if data['user_id']: ${data['friendly_name']} % else: ${data['friendly_name']} % endif
% endif