<%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'. sub_media_type Returns the subtype 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. edition_title Returns the edition title of a movie. 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
<% legacy = '&legacy=1' if data['media_type'] in ('photo_album', 'photo', 'clip') else '' %> % if data['media_type'] in ('track', 'photo'): % elif data['media_type'] == 'playlist': % elif not data['live']: % endif % if data['live']:
% else: % if data['media_type'] == 'episode':
% if _session['user_group'] == 'admin': % endif % elif data['media_type'] in ('artist', 'album', 'track', 'playlist', 'photo_album', 'photo', 'clip') or data['sub_media_type'] in ('artist', 'album', 'track'):
% if data['media_type'] == 'playlist' and data['smart']: % endif
% if _session['user_group'] == 'admin': % endif % else:
% if data['media_type'] == 'collection' and data['smart']: % endif
% if _session['user_group'] == 'admin': % endif % endif % endif % if not data['live']: % 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']:

### ${season} · E${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']}

### ${season}

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

# ${data['grandparent_title']}

## ${data['title']}

### ${season} · E${data['media_index']}

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

# ${data['parent_title']}

## ${data['title']}

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

# ${data['grandparent_title']}

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

### T${data['media_index']}

% 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 ('artist', 'album', 'playlist', 'photo_album', 'photo') or data['sub_media_type'] in ('artist', 'album', 'track'): padding_height = 'height: 150px;' elif data['media_type'] in ('track', 'clip'): padding_height = 'height: 180px;' elif data['media_type'] == 'episode': padding_height = 'height: 70px;' elif data['media_type'] in ('show', 'season', 'collection'): padding_height = 'height: 270px;' %>
% if data['media_type'] in ('movie', 'episode', 'track', 'clip'):
% if data['media_type'] != 'track' and media_info['video_codec']: % endif % if data['media_type'] != 'track' and media_info['video_resolution']: % endif % if media_info['audio_codec']: % endif % if media_info['audio_channels']: % endif
% endif
<% rating = data['rating'] or data['audience_rating'] %> % if rating: % if data['audience_rating_image']: % if data['audience_rating_image'].startswith('imdb://'):
${rating}
% endif % if data['audience_rating_image'].startswith('themoviedb://'):
${get_percent(rating, 10)}%
% endif % if data['audience_rating_image'].startswith('thetvdb://'):
${get_percent(rating, 10)}%
% endif % if data['audience_rating_image'].startswith('rottentomatoes://'):
${get_percent(data['audience_rating'], 10)}%
% endif % if data['rating_image'].startswith('rottentomatoes://'):
${get_percent(data['rating'], 10)}%
% endif % else:
${get_percent(rating, 10)}%
% 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'] == 'track' and data['original_title']: Track Artists ${data['original_title']} % 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['edition_title']:
Edition ${data['edition_title']}
% endif
% if data['content_rating']: Rated ${data['content_rating']} % endif
% if media_info['channel_vcn']: Channel ${media_info['channel_title'] or (media_info['channel_vcn'] + ' ' + media_info['channel_call_sign'])} % endif
% if data['tagline']:

${data['tagline']}

% endif

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

Read more
% if data['writers']:
Written by

% for writer in data['writers']: % if loop.index < 5:
- ${writer}
% endif % endfor

% endif % if data['actors']:
Starring

% for actor in data['actors']: % if loop.index < 5:
- ${actor}
% endif % endfor

% endif
% if data['genres']:
Genres

% for genre in data['genres']: % if loop.index < 5:
- ${genre}
% endif % endfor

% endif
% 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 % if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track', 'collection', 'playlist'):
Global Stats
Loading data...
User Stats
Loading data...
% endif <% history_type = data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track', 'collection', 'playlist') 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':
Fix Match
% 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', 'playlist'): Play History for ${data['title']} % else: Watch History for ${data['title']} % endif
% if _session['user_group'] == 'admin':
% endif
Direct Play Direct Stream Transcode

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']) %>

#### Confirm Delete

Are you REALLY sure you want to delete history item(s)?

This is permanent and cannot be undone!

#### Recently Added Notification

Send a recently added notification for the following:

% if data['media_type'] == 'movie': ${data['title']}
${data['year']} % elif data['media_type'] == 'show': ${data['title']} % elif data['media_type'] == 'season': ${data['parent_title']}
${data['title']} % elif data['media_type'] == 'episode': ${data['grandparent_title']}
${data['title']}
${season} · E${data['media_index']} % elif data['media_type'] == 'artist': ${data['title']} % elif data['media_type'] == 'album': ${data['parent_title']}
${data['title']} % elif data['media_type'] == 'track': ${data['grandparent_title']}
${data['title']}
${data['parent_title']} % endif

Select the Notification Agent

Note: All custom notification conditions will be bypassed.

% 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', 'collection', 'playlist'):
% endif % if data['media_type'] in ('show', 'season', 'artist', 'album', 'photo_album', 'collection', 'playlist'):
% endif % if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track', '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