<%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: info.html Version: 0.1 Variable names: data [list] data :: Usable parameters (if not applicable for media type, blank value will be returned) == Global keys == rating_key Returns the unique identifier for the media item. media_type Returns the type of media. Either 'movie', 'show', 'season', 'episode', 'artist', 'album', or 'track'. art Returns the location of the item's artwork title Returns the name of the movie, show, episode, artist, album, or track. duration Returns the standard runtime of the media. content_rating Returns the age rating for the media. summary Returns a brief description of the media plot. grandparent_title Returns the name of the show, or artist. parent_media_index Returns the index number of the season. media_index Returns the index number of the episode, or track. parent_thumb Returns the location of the item's thumbnail. Use with pms_image_proxy. writers Returns an array of writers. thumb Returns the location of the item's thumbnail. Use with pms_image_proxy. parent_title Returns the name of the show, or artist. rating Returns the 5 star rating value for the movie. Between 1 and 5. year Returns the release year of the movie, or show. genres Returns an array of genres. actors Returns an array of actors. directors Returns an array of directors. studio Returns the name of the studio. originally_available_at Returns the air date of the item. DOCUMENTATION :: END <%! from collections import defaultdict import re from plexpy import notifiers from plexpy.common import MEDIA_TYPE_HEADERS, MEDIA_FLAGS_AUDIO, MEDIA_FLAGS_VIDEO from plexpy.helpers import page, get_percent, cast_to_int, short_season # Get audio codec file def af(codec): for pattern, file_type in MEDIA_FLAGS_AUDIO.items(): if re.match(pattern, codec): return file_type return codec # Get video codec file def vf(codec): for pattern, file_type in MEDIA_FLAGS_VIDEO.items(): if re.match(pattern, codec): return file_type return codec # Get video resolution file def vr(resolution): if resolution in ('1080i', '576i', '480i'): return resolution else: return resolution.lower().rstrip('ip') def br(text): return text.replace('\n', '

') %> <%inherit file="base.html"/> <%def name="headIncludes()"> <%def name="body()"> % if metadata: <% data = defaultdict(lambda: None, **metadata) media_info = defaultdict(lambda: None, **(data['media_info'][0] if data['media_info'] else {})) season = '' if data['media_type'] == 'episode': season = short_season(data['parent_title']) elif data['media_type'] == 'season': season = short_season(data['title']) %>
% if data['media_type'] not in ('photo_album', 'photo', 'playlist'): <% fallback = 'art-live-full' if data['live'] else None %>
% endif % if _session['user_group'] == 'admin': % endif
% if data['live']: % if data['media_type'] == 'movie':

 

${data['title']}

% elif data['media_type'] == 'episode':

${data['grandparent_title']}

${data['title']}

% if data['media_index']: % endif % endif % elif data['media_type'] in ('movie', 'show', 'artist', 'collection', 'playlist', 'photo_album'):

 

${data['title']}

% elif data['media_type'] == 'season':

 

${data['parent_title']}

% elif data['media_type'] == 'episode':

${data['grandparent_title']}

${data['title']}

% elif data['media_type'] == 'album':

${data['parent_title']}

${data['title']}

% elif data['media_type'] == 'track':

${data['original_title'] or data['grandparent_title']}

${data['parent_title']} - ${data['title']}

% elif data['media_type'] in ('photo', 'clip'):

${data['parent_title']}

${data['title']}

% endif
<% padding_height = '' if data['media_type'] == 'movie' or data['live']: padding_height = 'height: 305px;' elif data['media_type'] in ('show', 'season', 'collection'): padding_height = 'height: 270px;' elif data['media_type'] == 'episode': padding_height = 'height: 70px;' elif data['media_type'] in ('artist', 'album', 'playlist', 'photo_album', 'photo'): padding_height = 'height: 150px;' elif data['media_type'] in ('track', 'clip'): padding_height = 'height: 180px;' %>
<% rating = data['rating'] or data['audience_rating'] %> % if rating: % if data['audience_rating_image']: % if data['audience_rating_image'].startswith('imdb://'): % endif % if data['audience_rating_image'].startswith('themoviedb://'): % endif % if data['audience_rating_image'].startswith('thetvdb://'): % endif % if data['audience_rating_image'].startswith('rottentomatoes://'): % endif % if data['rating_image'].startswith('rottentomatoes://'): % endif % else: % endif % endif
% if data['media_type'] in ('collection', 'playlist') and data['children_count']: <% if data['media_type'] == 'collection': suffix = MEDIA_TYPE_HEADERS[data['sub_media_type']] elif data['media_type'] == 'playlist': suffix = MEDIA_TYPE_HEADERS[data['playlist_type']] if data['children_count'] == 1: suffix = suffix[:-1] %> Items ${data['children_count']} ${suffix} % endif
% if data['directors']: Directed by ${data['directors'][0]} % endif
% if data['studio']: Studio ${data['studio']} % endif
% if data['media_type'] == 'movie': Year ${data['year']} % elif data['media_type'] == 'show': Aired ${data['year']} % elif data['media_type'] == 'episode': Aired ${data['originally_available_at']} % elif data['media_type'] == 'album' or data['media_type'] == 'track': Released ${data['year']} % elif data['media_type'] in ('photo', 'clip'): Taken ${data['originally_available_at']} % elif data['media_type'] == 'collection' and data['min_year'] and data['max_year']: Year ${data['min_year']} - ${data['max_year']} % elif data['year']: Year ${data['year']} % endif
% if data['duration']: Runtime ${data['duration']} % endif
% if data['content_rating']: Rated ${data['content_rating']} % endif
% if media_info['channel_identifier']: Channel ${media_info['channel_call_sign']} ${media_info['channel_identifier']} % endif
% if data['tagline']:

${data['tagline']}

% endif

${data['summary'] | br, n}

% if data['media_type'] == 'show':
Season List for ${data['title']}
  Loading season list...
% elif data['media_type'] == 'season':
Episode List for ${data['title']}
  Loading episode list...
% elif data['media_type'] == 'artist':
Album List for ${data['title']}
  Loading album list...
% elif data['media_type'] == 'album':
Track List for ${data['title']}
  Loading track list...
% elif data['media_type'] == 'photo_album':
Photo List for ${data['title']}
  Loading photo list...
% elif data['media_type'] == 'collection':
${MEDIA_TYPE_HEADERS[data['sub_media_type']]} in ${data['title']} collection
  Loading collection items...
% elif data['media_type'] == 'playlist':
${MEDIA_TYPE_HEADERS[data['playlist_type']]} List for ${data['title']}
  Loading playlist items...
% endif <% history_type = data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track') history_active = 'active' if history_type else '' export_active = 'active' if not history_type else '' %> % if history_type and _session['user_group'] == 'admin':
% if source == 'history': % endif % if data.get('tvmaze_id') or data.get('themoviedb_id') or data.get('musicbrainz_id'):
% endif % if data.get('poster_url'):
% if data['media_type'] == 'artist' or data['media_type'] == 'album' or data['media_type'] == 'track': % else: % endif
% endif % if not data['live']:
% endif
% endif
% if history_type:
% if data['media_type'] in ('artist', 'album', 'track'): Play History for ${data['title']} % else: Watch History for ${data['title']} % endif
% if _session['user_group'] == 'admin':
% endif
Delete Date User IP Address Platform Product Player Title Started Paused Stopped Duration
% endif % if not data['live'] and _session['user_group'] == 'admin':
Metadata Exports for ${data['title']}
Exported At Media Type Rating Key Filename File Format Metadata Level Media Info Level Custom Fields File Size Download Delete
% endif
% endif <%def name="modalIncludes()"> % if metadata: <% data = defaultdict(None, **metadata) season = '' if data['media_type'] == 'episode': season = short_season(data['parent_title']) elif data['media_type'] == 'season': season = short_season(data['title']) %> % endif <%def name="javascriptIncludes()"> % if metadata: <% data = defaultdict(None, **metadata) history_user_id = '' if _session['user_group'] == 'admin' else _session['user_id'] %> % if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track'): % endif % if data['media_type'] in ('show', 'season', 'artist', 'album', 'photo_album', 'collection', 'playlist'): % endif % if data['media_type'] == 'collection': % endif % if _session['user_group'] == 'admin': % endif % if data.get('poster_url'): % endif % if data.get('tvmaze_id') or data.get('themoviedb_id') or data.get('musicbrainz_id'): % endif % endif