%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
%doc>
<%!
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
# 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>
<%def name="body()">
% if metadata:
<%
data = defaultdict(lambda: None, **metadata)
media_info = defaultdict(lambda: None, **(data['media_info'][0] if data['media_info'] else {}))
%>