mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Fix handling of clips in activity pane.
Start standardising variable names in templates.
This commit is contained in:
parent
b4f1bddc02
commit
c770c90d76
7 changed files with 188 additions and 124 deletions
|
@ -15,8 +15,8 @@ data['sessions'] Returns an array containing session data
|
||||||
data[sessions] :: Usable parameters
|
data[sessions] :: Usable parameters
|
||||||
|
|
||||||
== Global keys ==
|
== Global keys ==
|
||||||
sessionKey Returns a unique session id for the active stream
|
session_key Returns a unique session id for the active stream
|
||||||
ratingKey Returns the unique identifier for the media item.
|
rating_key Returns the unique identifier for the media item.
|
||||||
type Returns the type of session. Either 'track', 'episode' or 'movie'.
|
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.
|
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
art Returns the location of the item's artwork
|
art Returns the location of the item's artwork
|
||||||
|
@ -26,15 +26,13 @@ friendly_name Returns the friendlly name of the user owning the sessio
|
||||||
state Returns the state of the current session. Either 'playing', 'paused' or 'buffering'.
|
state Returns the state of the current session. Either 'playing', 'paused' or 'buffering'.
|
||||||
title Returns the name of the episode, movie or music track.
|
title Returns the name of the episode, movie or music track.
|
||||||
player Returns the name of the platform used to play the stream.
|
player Returns the name of the platform used to play the stream.
|
||||||
audioDecision Returns the audio transcode decision. Either 'transcode', 'copy' or 'direct play'.
|
audio_decision Returns the audio transcode decision. Either 'transcode', 'copy' or 'direct play'.
|
||||||
audioCodec Returns the name of the audio codec.
|
audio_codec Returns the name of the audio codec.
|
||||||
audioChannels Returns the number of audio channels.
|
audio_channels Returns the number of audio channels.
|
||||||
grandparentTitle Returns the title of the item's grandparent.
|
grandparent_title Returns the title of the item's grandparent.
|
||||||
parentTitle Returns the title of the item's parent.
|
parent_title Returns the title of the item's parent.
|
||||||
|
video_decision Returns the video transcode decision. Either 'transcode', 'copy' or 'direct play'.
|
||||||
== Only if 'type' is 'episode' or 'movie' ==
|
video_codec Returns the name of the video codec.
|
||||||
videoDecision Returns the video transcode decision. Either 'transcode', 'copy' or 'direct play'.
|
|
||||||
videoCodec Returns the name of the video codec.
|
|
||||||
height Returns the value of the video height.
|
height Returns the value of the video height.
|
||||||
width Returns the value of the video width.
|
width Returns the value of the video width.
|
||||||
indexes Returns true if the media has media indexes and are enabled
|
indexes Returns true if the media has media indexes and are enabled
|
||||||
|
@ -45,7 +43,7 @@ DOCUMENTATION :: END
|
||||||
% if data is not None:
|
% if data is not None:
|
||||||
% if data['stream_count'] != '0':
|
% if data['stream_count'] != '0':
|
||||||
% for a in data['sessions']:
|
% for a in data['sessions']:
|
||||||
<div class="instance" id="instance-${a['sessionKey']}">
|
<div class="instance" id="instance-${a['session_key']}">
|
||||||
<div class="poster">
|
<div class="poster">
|
||||||
% if a['type'] == 'movie' and not a['indexes']:
|
% if a['type'] == 'movie' and not a['indexes']:
|
||||||
<div class="dashboard-activity-poster-face">
|
<div class="dashboard-activity-poster-face">
|
||||||
|
@ -64,33 +62,35 @@ DOCUMENTATION :: END
|
||||||
<div class='dashboard-activity-instance-overlay'>
|
<div class='dashboard-activity-instance-overlay'>
|
||||||
<div class='dashboard-activity-metadata-progress-minutes'>
|
<div class='dashboard-activity-metadata-progress-minutes'>
|
||||||
<div class='progress progress-warning'>
|
<div class='progress progress-warning'>
|
||||||
<div class="bar" style="width: ${a['progressPercent']}%">${a['progressPercent']}%</div>
|
<div class="bar" style="width: ${a['progress_percent']}%">${a['progress_percent']}%</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-activity-metadata-platform" id="platform-${a['sessionKey']}">
|
<div class="dashboard-activity-metadata-platform" id="platform-${a['session_key']}">
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-activity-metadata-user">
|
<div class="dashboard-activity-metadata-user">
|
||||||
<a href="user?user=${a['user']}">${a['friendly_name']}</a> is ${a['state']}
|
<a href="user?user=${a['user']}">${a['friendly_name']}</a> is ${a['state']}
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-activity-metadata-title">
|
<div class="dashboard-activity-metadata-title">
|
||||||
% if a['type'] == 'episode':
|
% if a['type'] == 'episode':
|
||||||
<a href="info?rating_key=${a['ratingKey']}">${a['grandparentTitle']} - ${a['title']}</a>
|
<a href="info?rating_key=${a['rating_key']}">${a['grandparent_title']} - ${a['title']}</a>
|
||||||
% elif a['type'] == 'movie':
|
% elif a['type'] == 'movie':
|
||||||
<a href="info?rating_key=${a['ratingKey']}">${a['title']}</a>
|
<a href="info?rating_key=${a['rating_key']}">${a['title']}</a>
|
||||||
|
% elif a['type'] == 'clip':
|
||||||
|
${a['title']}
|
||||||
% elif a['type'] == 'track':
|
% elif a['type'] == 'track':
|
||||||
${a['grandparentTitle']} - ${a['title']}
|
${a['grandparent_title']} - ${a['title']}
|
||||||
% else:
|
% else:
|
||||||
${a['grandparentTitle']} - ${a['title']}
|
${a['grandparent_title']} - ${a['title']}
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="stream-${a['sessionKey']}" class="collapse out">
|
<div id="stream-${a['session_key']}" class="collapse out">
|
||||||
<div class='dashboard-activity-info-details-overlay'>
|
<div class='dashboard-activity-info-details-overlay'>
|
||||||
<div class='dashboard-activity-info-details-content'>
|
<div class='dashboard-activity-info-details-content'>
|
||||||
% if a['type'] == 'track':
|
% if a['type'] == 'track':
|
||||||
Artist: <strong>${a['grandparentTitle']}</strong>
|
Artist: <strong>${a['grandparent_title']}</strong>
|
||||||
<br>
|
<br>
|
||||||
Album: <strong>${a['parentTitle']}</strong>
|
Album: <strong>${a['parent_title']}</strong>
|
||||||
<br>
|
<br>
|
||||||
% endif
|
% endif
|
||||||
% if a['state'] == 'playing':
|
% if a['state'] == 'playing':
|
||||||
|
@ -102,24 +102,24 @@ DOCUMENTATION :: END
|
||||||
% endif
|
% endif
|
||||||
<br>
|
<br>
|
||||||
% if a['type'] == 'track':
|
% if a['type'] == 'track':
|
||||||
% if a['audioDecision'] == 'direct play':
|
% if a['audio_decision'] == 'direct play':
|
||||||
Stream: <strong>Direct Play</strong>
|
Stream: <strong>Direct Play</strong>
|
||||||
% else:
|
% else:
|
||||||
Stream: <strong>Transcoding</strong>
|
Stream: <strong>Transcoding</strong>
|
||||||
% endif
|
% endif
|
||||||
<br/>
|
<br/>
|
||||||
Audio: <strong>${a['audioCodec']} (${a['audioChannels']}ch)</strong>
|
Audio: <strong>${a['audio_codec']} (${a['audio_channels']}ch)</strong>
|
||||||
% elif a['type'] == 'episode' or a['type'] == 'movie':
|
% elif a['type'] == 'episode' or a['type'] == 'movie' or a['type'] == 'clip':
|
||||||
% if a['videoDecision'] == 'direct play':
|
% if a['video_decision'] == 'direct play':
|
||||||
Stream: <strong>Direct Play</strong>
|
Stream: <strong>Direct Play</strong>
|
||||||
% else:
|
% else:
|
||||||
Stream: <strong>Transcoding</strong>
|
Stream: <strong>Transcoding</strong>
|
||||||
% endif
|
% endif
|
||||||
<br/>
|
<br/>
|
||||||
Video: <strong>${a['videoDecision']} (${a['videoCodec']})
|
Video: <strong>${a['video_decision']} (${a['video_codec']})
|
||||||
(${a['width']}x${a['height']})</strong>
|
(${a['width']}x${a['height']})</strong>
|
||||||
<br/>
|
<br/>
|
||||||
Audio: <strong>${a['audioDecision']} (${a['audioCodec']}) (${a['audioChannels']}ch)</strong>
|
Audio: <strong>${a['audio_decision']} (${a['audio_codec']}) (${a['audio_channels']}ch)</strong>
|
||||||
% endif
|
% endif
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
@ -128,13 +128,13 @@ DOCUMENTATION :: END
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-activity-button-info">
|
<div class="dashboard-activity-button-info">
|
||||||
<button type="button" class="btn btn-warning" data-toggle="collapse" data-target="#stream-${a['sessionKey']}">
|
<button type="button" class="btn btn-warning" data-toggle="collapse" data-target="#stream-${a['session_key']}">
|
||||||
<i class='icon-info-sign icon-white'></i>
|
<i class='icon-info-sign icon-white'></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$("#platform-${a['sessionKey']}").html("<img src='" + getPlatformImagePath('${a['player']}') + "'>");
|
$("#platform-${a['session_key']}").html("<img src='" + getPlatformImagePath('${a['player']}') + "'>");
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -17,7 +17,7 @@ data[array_index]['rows'] :: Usable parameters
|
||||||
== Only if 'stat_id' is 'top_tv' or 'popular_tv' ==
|
== Only if 'stat_id' is 'top_tv' or 'popular_tv' ==
|
||||||
grandparent_thumb Returns location of the item's thumbnail. Use with pms_image_proxy.
|
grandparent_thumb Returns location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
rating_key Returns the unique identifier for the media item.
|
rating_key Returns the unique identifier for the media item.
|
||||||
orig_title Returns the title for the associated stat.
|
title Returns the title for the associated stat.
|
||||||
|
|
||||||
== Only if 'stat_id' is 'top_tv' or 'top_user' or 'top_platform' ==
|
== Only if 'stat_id' is 'top_tv' or 'top_user' or 'top_platform' ==
|
||||||
total_plays Returns the count for the associated stat.
|
total_plays Returns the count for the associated stat.
|
||||||
|
@ -58,7 +58,7 @@ DOCUMENTATION :: END
|
||||||
<div class="home-platforms-instance-name">
|
<div class="home-platforms-instance-name">
|
||||||
<h4>Most Watched TV</h4>
|
<h4>Most Watched TV</h4>
|
||||||
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
|
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
|
||||||
<h5>${a['rows'][0]['orig_title']}</h5>
|
<h5>${a['rows'][0]['title']}</h5>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-platforms-instance-playcount">
|
<div class="user-platforms-instance-playcount">
|
||||||
|
@ -85,7 +85,7 @@ DOCUMENTATION :: END
|
||||||
<div class="home-platforms-instance-name">
|
<div class="home-platforms-instance-name">
|
||||||
<h4>Most Popular TV</h4>
|
<h4>Most Popular TV</h4>
|
||||||
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
|
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
|
||||||
<h5>${a['rows'][0]['orig_title']}</h5>
|
<h5>${a['rows'][0]['title']}</h5>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-platforms-instance-playcount">
|
<div class="user-platforms-instance-playcount">
|
||||||
|
|
|
@ -7,42 +7,28 @@ Filename: info.html
|
||||||
Version: 0.1
|
Version: 0.1
|
||||||
Variable names: data [list]
|
Variable names: data [list]
|
||||||
|
|
||||||
data :: Usable parameters
|
data :: Usable parameters (if not applicable for media type, blank value will be returned)
|
||||||
|
|
||||||
== Global keys ==
|
== Global keys ==
|
||||||
ratingKey Returns the unique identifier for the media item.
|
rating_key Returns the unique identifier for the media item.
|
||||||
type Returns the type of media. Either 'movie', 'episode' or 'show' or 'season'.
|
type Returns the type of media. Either 'movie', 'episode' or 'show' or 'season'.
|
||||||
art Returns the location of the item's artwork
|
art Returns the location of the item's artwork
|
||||||
title Returns the name of the episode, show, season or movie.
|
title Returns the name of the episode, show, season or movie.
|
||||||
duration Returns the standard runtime of the media.
|
duration Returns the standard runtime of the media.
|
||||||
contentRating Returns the age rating for the media.
|
content_rating Returns the age rating for the media.
|
||||||
summary Returns a brief description of the media plot.
|
summary Returns a brief description of the media plot.
|
||||||
|
grandparent_title Returns the name of the TV show.
|
||||||
== Only if 'type' is 'episode' ==
|
parent_index Returns the season number of the TV show.
|
||||||
grandparentTitle Returns the name of the TV show.
|
|
||||||
parentIndex Returns the season number of the TV show.
|
|
||||||
index Returns the episode number.
|
index Returns the episode number.
|
||||||
parentThumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
parent_thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
writers Returns an array of writers.
|
writers Returns an array of writers.
|
||||||
|
|
||||||
== Only if 'type' is 'movie' or 'season' or 'show' ==
|
|
||||||
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
|
parent_title Returns the name of the TV show.
|
||||||
== Only if 'type' is 'season' ==
|
|
||||||
parentTitle Returns the name of the TV show.
|
|
||||||
|
|
||||||
== Only if 'type' is 'movie' ==
|
|
||||||
rating Returns the 5 star rating value for the movie. Between 1 and 5.
|
rating Returns the 5 star rating value for the movie. Between 1 and 5.
|
||||||
year Returns the release year of the movie.
|
year Returns the release year of the movie.
|
||||||
|
|
||||||
== Only if 'type' is 'movie' or 'show' ==
|
|
||||||
genres Returns an array of genres.
|
genres Returns an array of genres.
|
||||||
actors Returns an array of actors.
|
actors Returns an array of actors.
|
||||||
|
|
||||||
== Only if 'type' is 'episode' or 'movie' ==
|
|
||||||
directors Returns an array of directors.
|
directors Returns an array of directors.
|
||||||
|
|
||||||
== Only if 'type' is 'show' or 'season' ==
|
|
||||||
studio Returns the name of the studio.
|
studio Returns the name of the studio.
|
||||||
|
|
||||||
DOCUMENTATION :: END
|
DOCUMENTATION :: END
|
||||||
|
@ -72,7 +58,7 @@ from plexpy import helpers
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
<div class="summary-content-poster hidden-phone hidden-tablet">
|
<div class="summary-content-poster hidden-phone hidden-tablet">
|
||||||
% if data['type'] == 'episode':
|
% if data['type'] == 'episode':
|
||||||
<img src="pms_image_proxy?img=${data['parentThumb']}&width=256&height=352">
|
<img src="pms_image_proxy?img=${data['parent_thumb']}&width=256&height=352">
|
||||||
% else:
|
% else:
|
||||||
<img src="pms_image_proxy?img=${data['thumb']}&width=256&height=352">
|
<img src="pms_image_proxy?img=${data['thumb']}&width=256&height=352">
|
||||||
% endif
|
% endif
|
||||||
|
@ -82,9 +68,9 @@ from plexpy import helpers
|
||||||
% if data['type'] == 'movie':
|
% if data['type'] == 'movie':
|
||||||
<h1>${data['title']} (${data['year']})</h1>
|
<h1>${data['title']} (${data['year']})</h1>
|
||||||
% elif data['type'] == 'season':
|
% elif data['type'] == 'season':
|
||||||
<h1>${data['parentTitle']} (${data['title']})</h1>
|
<h1>${data['parent_title']} (${data['title']})</h1>
|
||||||
% elif data['type'] == 'episode':
|
% elif data['type'] == 'episode':
|
||||||
<h1>${data['grandparentTitle']} (Season ${data['parentIndex']}, Episode
|
<h1>${data['grandparent_title']} (Season ${data['parent_index']}, Episode
|
||||||
${data['index']}) "${data['title']}"</h1>
|
${data['index']}) "${data['title']}"</h1>
|
||||||
% else:
|
% else:
|
||||||
<h1>${data['title']}</h1>
|
<h1>${data['title']}</h1>
|
||||||
|
@ -110,7 +96,7 @@ from plexpy import helpers
|
||||||
Runtime <strong> ${data['duration']} mins</strong>
|
Runtime <strong> ${data['duration']} mins</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-content-content-rating">
|
<div class="summary-content-content-rating">
|
||||||
Rated <strong> ${data['contentRating']} </strong>
|
Rated <strong> ${data['content_rating']} </strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-content-summary">
|
<div class="summary-content-summary">
|
||||||
|
@ -198,7 +184,7 @@ from plexpy import helpers
|
||||||
<th class="desktop" align='left' id="stopped">Stopped</th>
|
<th class="desktop" align='left' id="stopped">Stopped</th>
|
||||||
<th class="desktop" align='left' id="duration">Duration</th>
|
<th class="desktop" align='left' id="duration">Duration</th>
|
||||||
<th class="desktop" align='left' id="percent_complete">Completed</th>
|
<th class="desktop" align='left' id="percent_complete">Completed</th>
|
||||||
<th class="never" align='left' id="rating_key">RatingKey</th>
|
<th class="never" align='left' id="rating_key">rating_key</th>
|
||||||
<th class="never" align='left' id="xml"></th>
|
<th class="never" align='left' id="xml"></th>
|
||||||
<th class="never" align='left' id="user"></th>
|
<th class="never" align='left' id="user"></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -258,7 +244,7 @@ from plexpy import helpers
|
||||||
history_table_options.ajax = {
|
history_table_options.ajax = {
|
||||||
"url": "get_history",
|
"url": "get_history",
|
||||||
"data": function(d) {
|
"data": function(d) {
|
||||||
d.rating_key = ${data['ratingKey']};
|
d.rating_key = ${data['rating_key']};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +262,7 @@ from plexpy import helpers
|
||||||
history_table_options.ajax = {
|
history_table_options.ajax = {
|
||||||
"url": "get_history",
|
"url": "get_history",
|
||||||
"data": function(d) {
|
"data": function(d) {
|
||||||
d.grandparent_rating_key = ${data['ratingKey']};
|
d.grandparent_rating_key = ${data['rating_key']};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +278,7 @@ from plexpy import helpers
|
||||||
url: 'get_children',
|
url: 'get_children',
|
||||||
type: "GET",
|
type: "GET",
|
||||||
async: true,
|
async: true,
|
||||||
data: { rating_key : ${data['ratingKey']} },
|
data: { rating_key : ${data['rating_key']} },
|
||||||
complete: function(xhr, status) {
|
complete: function(xhr, status) {
|
||||||
$("#episode-list").html(xhr.responseText);
|
$("#episode-list").html(xhr.responseText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ episode_list Returns an array of episodes.
|
||||||
data['episode_list'] :: Usable paramaters
|
data['episode_list'] :: Usable paramaters
|
||||||
|
|
||||||
== Global keys ==
|
== Global keys ==
|
||||||
ratingKey Returns the unique identifier for the media item.
|
rating_key Returns the unique identifier for the media item.
|
||||||
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
title Returns the name of the episode.
|
title Returns the name of the episode.
|
||||||
index Returns the episode number.
|
index Returns the episode number.
|
||||||
|
@ -32,7 +32,7 @@ DOCUMENTATION :: END
|
||||||
<li>
|
<li>
|
||||||
<div class="season-episodes-poster">
|
<div class="season-episodes-poster">
|
||||||
<div class="season-episodes-poster-face">
|
<div class="season-episodes-poster-face">
|
||||||
<a href="info?rating_key=${a['ratingKey']}">
|
<a href="info?rating_key=${a['rating_key']}">
|
||||||
<img src="pms_image_proxy?img=${a['thumb']}&width=205&height=115"
|
<img src="pms_image_proxy?img=${a['thumb']}&width=205&height=115"
|
||||||
class="season-episodes-poster-face">
|
class="season-episodes-poster-face">
|
||||||
</a>
|
</a>
|
||||||
|
@ -45,7 +45,7 @@ DOCUMENTATION :: END
|
||||||
</div>
|
</div>
|
||||||
<div class="season-episodes-instance-text-wrapper">
|
<div class="season-episodes-instance-text-wrapper">
|
||||||
<div class="season-episodes-title">
|
<div class="season-episodes-title">
|
||||||
<a href="info?rating_key=${a['ratingKey']}">
|
<a href="info?rating_key=${a['rating_key']}">
|
||||||
"${a['title']}"
|
"${a['title']}"
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -347,8 +347,12 @@ def convert_xml_to_dict(xml):
|
||||||
|
|
||||||
|
|
||||||
def get_percent(value1, value2):
|
def get_percent(value1, value2):
|
||||||
|
|
||||||
|
if value1.isdigit() and value2.isdigit():
|
||||||
value1 = cast_to_float(value1)
|
value1 = cast_to_float(value1)
|
||||||
value2 = cast_to_float(value2)
|
value2 = cast_to_float(value2)
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
if value1 != 0 and value2 != 0:
|
if value1 != 0 and value2 != 0:
|
||||||
percent = (value1 / value2) * 100
|
percent = (value1 / value2) * 100
|
||||||
|
|
|
@ -634,11 +634,17 @@ class PlexWatch(object):
|
||||||
for a in xml_head:
|
for a in xml_head:
|
||||||
grandparent_thumb = self.get_xml_attr(a, 'grandparentThumb')
|
grandparent_thumb = self.get_xml_attr(a, 'grandparentThumb')
|
||||||
|
|
||||||
row = {'orig_title': item[0],
|
row = {'title': item[0],
|
||||||
'total_plays': item[1],
|
'total_plays': item[1],
|
||||||
|
'users_watched': '',
|
||||||
'rating_key': item[2],
|
'rating_key': item[2],
|
||||||
'last_play': item[3],
|
'last_play': item[3],
|
||||||
'grandparent_thumb': grandparent_thumb
|
'grandparent_thumb': grandparent_thumb,
|
||||||
|
'thumb': '',
|
||||||
|
'user': '',
|
||||||
|
'friendly_name': '',
|
||||||
|
'platform_type': '',
|
||||||
|
'platform': ''
|
||||||
}
|
}
|
||||||
top_tv.append(row)
|
top_tv.append(row)
|
||||||
|
|
||||||
|
@ -679,12 +685,17 @@ class PlexWatch(object):
|
||||||
for a in xml_head:
|
for a in xml_head:
|
||||||
grandparent_thumb = self.get_xml_attr(a, 'grandparentThumb')
|
grandparent_thumb = self.get_xml_attr(a, 'grandparentThumb')
|
||||||
|
|
||||||
row = {'orig_title': item[0],
|
row = {'title': item[0],
|
||||||
'users_watched': item[1],
|
'users_watched': item[1],
|
||||||
'rating_key': item[2],
|
'rating_key': item[2],
|
||||||
'last_play': item[3],
|
'last_play': item[3],
|
||||||
'total_plays': item[5],
|
'total_plays': item[5],
|
||||||
'grandparent_thumb': grandparent_thumb
|
'grandparent_thumb': grandparent_thumb,
|
||||||
|
'thumb': '',
|
||||||
|
'user': '',
|
||||||
|
'friendly_name': '',
|
||||||
|
'platform_type': '',
|
||||||
|
'platform': ''
|
||||||
}
|
}
|
||||||
popular_tv.append(row)
|
popular_tv.append(row)
|
||||||
|
|
||||||
|
@ -720,7 +731,13 @@ class PlexWatch(object):
|
||||||
'friendly_name': item[1],
|
'friendly_name': item[1],
|
||||||
'total_plays': item[2],
|
'total_plays': item[2],
|
||||||
'last_play': item[3],
|
'last_play': item[3],
|
||||||
'thumb': user_thumb
|
'thumb': user_thumb,
|
||||||
|
'grandparent_thumb': '',
|
||||||
|
'users_watched': '',
|
||||||
|
'rating_key': '',
|
||||||
|
'title': '',
|
||||||
|
'platform_type': '',
|
||||||
|
'platform': ''
|
||||||
}
|
}
|
||||||
top_users.append(row)
|
top_users.append(row)
|
||||||
|
|
||||||
|
@ -762,7 +779,14 @@ class PlexWatch(object):
|
||||||
row = {'platform': item[0],
|
row = {'platform': item[0],
|
||||||
'total_plays': item[1],
|
'total_plays': item[1],
|
||||||
'last_play': item[2],
|
'last_play': item[2],
|
||||||
'platform_type': platform_type
|
'platform_type': platform_type,
|
||||||
|
'title': '',
|
||||||
|
'thumb': '',
|
||||||
|
'grandparent_thumb': '',
|
||||||
|
'users_watched': '',
|
||||||
|
'rating_key': '',
|
||||||
|
'user': '',
|
||||||
|
'friendly_name': ''
|
||||||
}
|
}
|
||||||
top_platform.append(row)
|
top_platform.append(row)
|
||||||
|
|
||||||
|
|
|
@ -409,17 +409,22 @@ class PmsConnect(object):
|
||||||
|
|
||||||
if metadata_type == 'show':
|
if metadata_type == 'show':
|
||||||
metadata = {'type': metadata_type,
|
metadata = {'type': metadata_type,
|
||||||
'ratingKey': self.get_xml_attr(metadata_main, 'ratingKey'),
|
'rating_key': self.get_xml_attr(metadata_main, 'ratingKey'),
|
||||||
|
'grandparent_title': self.get_xml_attr(metadata_main, 'grandparentTitle'),
|
||||||
|
'parent_index': self.get_xml_attr(metadata_main, 'parentIndex'),
|
||||||
|
'parent_title': self.get_xml_attr(metadata_main, 'parentTitle'),
|
||||||
|
'index': self.get_xml_attr(metadata_main, 'index'),
|
||||||
'studio': self.get_xml_attr(metadata_main, 'studio'),
|
'studio': self.get_xml_attr(metadata_main, 'studio'),
|
||||||
'title': self.get_xml_attr(metadata_main, 'title'),
|
'title': self.get_xml_attr(metadata_main, 'title'),
|
||||||
'contentRating': self.get_xml_attr(metadata_main, 'contentRating'),
|
'content_rating': self.get_xml_attr(metadata_main, 'contentRating'),
|
||||||
'summary': self.get_xml_attr(metadata_main, 'summary'),
|
'summary': self.get_xml_attr(metadata_main, 'summary'),
|
||||||
'rating': self.get_xml_attr(metadata_main, 'rating'),
|
'rating': self.get_xml_attr(metadata_main, 'rating'),
|
||||||
'duration': helpers.convert_milliseconds_to_minutes(self.get_xml_attr(metadata_main, 'duration')),
|
'duration': helpers.convert_milliseconds_to_minutes(self.get_xml_attr(metadata_main, 'duration')),
|
||||||
'year': self.get_xml_attr(metadata_main, 'year'),
|
'year': self.get_xml_attr(metadata_main, 'year'),
|
||||||
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
||||||
|
'parent_thumb': self.get_xml_attr(metadata_main, 'parentThumb'),
|
||||||
'art': self.get_xml_attr(metadata_main, 'art'),
|
'art': self.get_xml_attr(metadata_main, 'art'),
|
||||||
'originallyAvailableAt': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
'originally_available_at': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
||||||
'writers': writers,
|
'writers': writers,
|
||||||
'directors': directors,
|
'directors': directors,
|
||||||
'genres': genres,
|
'genres': genres,
|
||||||
|
@ -428,19 +433,22 @@ class PmsConnect(object):
|
||||||
metadata_list = {'metadata': metadata}
|
metadata_list = {'metadata': metadata}
|
||||||
elif metadata_type == 'episode':
|
elif metadata_type == 'episode':
|
||||||
metadata = {'type': metadata_type,
|
metadata = {'type': metadata_type,
|
||||||
'ratingKey': self.get_xml_attr(metadata_main, 'ratingKey'),
|
'rating_key': self.get_xml_attr(metadata_main, 'ratingKey'),
|
||||||
'grandparentTitle': self.get_xml_attr(metadata_main, 'grandparentTitle'),
|
'grandparent_title': self.get_xml_attr(metadata_main, 'grandparentTitle'),
|
||||||
'parentIndex': self.get_xml_attr(metadata_main, 'parentIndex'),
|
'parent_index': self.get_xml_attr(metadata_main, 'parentIndex'),
|
||||||
|
'parent_title': self.get_xml_attr(metadata_main, 'parentTitle'),
|
||||||
'index': self.get_xml_attr(metadata_main, 'index'),
|
'index': self.get_xml_attr(metadata_main, 'index'),
|
||||||
|
'studio': self.get_xml_attr(metadata_main, 'studio'),
|
||||||
'title': self.get_xml_attr(metadata_main, 'title'),
|
'title': self.get_xml_attr(metadata_main, 'title'),
|
||||||
'contentRating': self.get_xml_attr(metadata_main, 'contentRating'),
|
'content_rating': self.get_xml_attr(metadata_main, 'contentRating'),
|
||||||
'summary': self.get_xml_attr(metadata_main, 'summary'),
|
'summary': self.get_xml_attr(metadata_main, 'summary'),
|
||||||
|
'rating': self.get_xml_attr(metadata_main, 'rating'),
|
||||||
'duration': helpers.convert_milliseconds_to_minutes(self.get_xml_attr(metadata_main, 'duration')),
|
'duration': helpers.convert_milliseconds_to_minutes(self.get_xml_attr(metadata_main, 'duration')),
|
||||||
'year': self.get_xml_attr(metadata_main, 'year'),
|
'year': self.get_xml_attr(metadata_main, 'year'),
|
||||||
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
||||||
'parentThumb': self.get_xml_attr(metadata_main, 'parentThumb'),
|
'parent_thumb': self.get_xml_attr(metadata_main, 'parentThumb'),
|
||||||
'art': self.get_xml_attr(metadata_main, 'art'),
|
'art': self.get_xml_attr(metadata_main, 'art'),
|
||||||
'originallyAvailableAt': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
'originally_available_at': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
||||||
'writers': writers,
|
'writers': writers,
|
||||||
'directors': directors,
|
'directors': directors,
|
||||||
'genres': genres,
|
'genres': genres,
|
||||||
|
@ -449,17 +457,22 @@ class PmsConnect(object):
|
||||||
metadata_list = {'metadata': metadata}
|
metadata_list = {'metadata': metadata}
|
||||||
elif metadata_type == 'movie':
|
elif metadata_type == 'movie':
|
||||||
metadata = {'type': metadata_type,
|
metadata = {'type': metadata_type,
|
||||||
'ratingKey': self.get_xml_attr(metadata_main, 'ratingKey'),
|
'rating_key': self.get_xml_attr(metadata_main, 'ratingKey'),
|
||||||
|
'grandparent_title': self.get_xml_attr(metadata_main, 'grandparentTitle'),
|
||||||
|
'parent_index': self.get_xml_attr(metadata_main, 'parentIndex'),
|
||||||
|
'parent_title': self.get_xml_attr(metadata_main, 'parentTitle'),
|
||||||
|
'index': self.get_xml_attr(metadata_main, 'index'),
|
||||||
'studio': self.get_xml_attr(metadata_main, 'studio'),
|
'studio': self.get_xml_attr(metadata_main, 'studio'),
|
||||||
'title': self.get_xml_attr(metadata_main, 'title'),
|
'title': self.get_xml_attr(metadata_main, 'title'),
|
||||||
'contentRating': self.get_xml_attr(metadata_main, 'contentRating'),
|
'content_rating': self.get_xml_attr(metadata_main, 'contentRating'),
|
||||||
'summary': self.get_xml_attr(metadata_main, 'summary'),
|
'summary': self.get_xml_attr(metadata_main, 'summary'),
|
||||||
'rating': self.get_xml_attr(metadata_main, 'rating'),
|
'rating': self.get_xml_attr(metadata_main, 'rating'),
|
||||||
'duration': helpers.convert_milliseconds_to_minutes(self.get_xml_attr(metadata_main, 'duration')),
|
'duration': helpers.convert_milliseconds_to_minutes(self.get_xml_attr(metadata_main, 'duration')),
|
||||||
'year': self.get_xml_attr(metadata_main, 'year'),
|
'year': self.get_xml_attr(metadata_main, 'year'),
|
||||||
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
||||||
|
'parent_thumb': self.get_xml_attr(metadata_main, 'parentThumb'),
|
||||||
'art': self.get_xml_attr(metadata_main, 'art'),
|
'art': self.get_xml_attr(metadata_main, 'art'),
|
||||||
'originallyAvailableAt': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
'originally_available_at': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
||||||
'genres': genres,
|
'genres': genres,
|
||||||
'actors': actors,
|
'actors': actors,
|
||||||
'writers': writers,
|
'writers': writers,
|
||||||
|
@ -470,16 +483,26 @@ class PmsConnect(object):
|
||||||
parent_rating_key = self.get_xml_attr(metadata_main, 'parentRatingKey')
|
parent_rating_key = self.get_xml_attr(metadata_main, 'parentRatingKey')
|
||||||
show_details = self.get_metadata_details(parent_rating_key)
|
show_details = self.get_metadata_details(parent_rating_key)
|
||||||
metadata = {'type': metadata_type,
|
metadata = {'type': metadata_type,
|
||||||
'ratingKey': self.get_xml_attr(metadata_main, 'ratingKey'),
|
'rating_key': self.get_xml_attr(metadata_main, 'ratingKey'),
|
||||||
'parentTitle': self.get_xml_attr(metadata_main, 'parentTitle'),
|
'grandparent_title': self.get_xml_attr(metadata_main, 'grandparentTitle'),
|
||||||
|
'parent_index': self.get_xml_attr(metadata_main, 'parentIndex'),
|
||||||
|
'parent_title': self.get_xml_attr(metadata_main, 'parentTitle'),
|
||||||
'index': self.get_xml_attr(metadata_main, 'index'),
|
'index': self.get_xml_attr(metadata_main, 'index'),
|
||||||
|
'studio': self.get_xml_attr(metadata_main, 'studio'),
|
||||||
'title': self.get_xml_attr(metadata_main, 'title'),
|
'title': self.get_xml_attr(metadata_main, 'title'),
|
||||||
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
'content_rating': self.get_xml_attr(metadata_main, 'contentRating'),
|
||||||
'art': self.get_xml_attr(metadata_main, 'art'),
|
|
||||||
'summary': show_details['metadata']['summary'],
|
'summary': show_details['metadata']['summary'],
|
||||||
'studio': show_details['metadata']['studio'],
|
'rating': self.get_xml_attr(metadata_main, 'rating'),
|
||||||
'duration': show_details['metadata']['duration'],
|
'duration': show_details['metadata']['duration'],
|
||||||
'contentRating': show_details['metadata']['contentRating']
|
'year': self.get_xml_attr(metadata_main, 'year'),
|
||||||
|
'thumb': self.get_xml_attr(metadata_main, 'thumb'),
|
||||||
|
'parent_thumb': self.get_xml_attr(metadata_main, 'parentThumb'),
|
||||||
|
'art': self.get_xml_attr(metadata_main, 'art'),
|
||||||
|
'originally_available_at': self.get_xml_attr(metadata_main, 'originallyAvailableAt'),
|
||||||
|
'genres': genres,
|
||||||
|
'actors': actors,
|
||||||
|
'writers': writers,
|
||||||
|
'directors': directors
|
||||||
}
|
}
|
||||||
metadata_list = {'metadata': metadata}
|
metadata_list = {'metadata': metadata}
|
||||||
else:
|
else:
|
||||||
|
@ -580,29 +603,29 @@ class PmsConnect(object):
|
||||||
duration = self.get_xml_attr(media_info, 'duration')
|
duration = self.get_xml_attr(media_info, 'duration')
|
||||||
progress = self.get_xml_attr(session, 'viewOffset')
|
progress = self.get_xml_attr(session, 'viewOffset')
|
||||||
|
|
||||||
session_output = {'sessionKey': self.get_xml_attr(session, 'sessionKey'),
|
session_output = {'session_key': self.get_xml_attr(session, 'sessionKey'),
|
||||||
'art': self.get_xml_attr(session, 'art'),
|
'art': self.get_xml_attr(session, 'art'),
|
||||||
'parentThumb': self.get_xml_attr(session, 'parentThumb'),
|
'parent_thumb': self.get_xml_attr(session, 'parentThumb'),
|
||||||
'thumb': self.get_xml_attr(session, 'thumb'),
|
'thumb': self.get_xml_attr(session, 'thumb'),
|
||||||
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
||||||
'friendly_name': plex_watch.get_user_friendly_name(
|
'friendly_name': plex_watch.get_user_friendly_name(
|
||||||
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
||||||
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
||||||
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
||||||
'grandparentTitle': self.get_xml_attr(session, 'grandparentTitle'),
|
'grandparent_title': self.get_xml_attr(session, 'grandparentTitle'),
|
||||||
'parentTitle': self.get_xml_attr(session, 'parentTitle'),
|
'parent_title': self.get_xml_attr(session, 'parentTitle'),
|
||||||
'title': self.get_xml_attr(session, 'title'),
|
'title': self.get_xml_attr(session, 'title'),
|
||||||
'ratingKey': self.get_xml_attr(session, 'ratingKey'),
|
'rating_key': self.get_xml_attr(session, 'ratingKey'),
|
||||||
'audioDecision': audio_decision,
|
'audio_decision': audio_decision,
|
||||||
'audioChannels': audio_channels,
|
'audio_channels': audio_channels,
|
||||||
'audioCodec': audio_codec,
|
'audio_codec': audio_codec,
|
||||||
'videoDecision': '',
|
'video_decision': '',
|
||||||
'videoCodec': '',
|
'video_codec': '',
|
||||||
'height': '',
|
'height': '',
|
||||||
'width': '',
|
'width': '',
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'progress': progress,
|
'progress': progress,
|
||||||
'progressPercent': str(helpers.get_percent(progress, duration)),
|
'progress_percent': str(helpers.get_percent(progress, duration)),
|
||||||
'type': 'track',
|
'type': 'track',
|
||||||
'indexes': 0
|
'indexes': 0
|
||||||
}
|
}
|
||||||
|
@ -650,59 +673,86 @@ class PmsConnect(object):
|
||||||
use_indexes = 0
|
use_indexes = 0
|
||||||
|
|
||||||
if self.get_xml_attr(session, 'type') == 'episode':
|
if self.get_xml_attr(session, 'type') == 'episode':
|
||||||
session_output = {'sessionKey': self.get_xml_attr(session, 'sessionKey'),
|
session_output = {'session_key': self.get_xml_attr(session, 'sessionKey'),
|
||||||
'art': self.get_xml_attr(session, 'art'),
|
'art': self.get_xml_attr(session, 'art'),
|
||||||
'parentThumb': self.get_xml_attr(session, 'parentThumb'),
|
'parent_thumb': self.get_xml_attr(session, 'parentThumb'),
|
||||||
'thumb': thumb,
|
'thumb': thumb,
|
||||||
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
||||||
'friendly_name': plex_watch.get_user_friendly_name(
|
'friendly_name': plex_watch.get_user_friendly_name(
|
||||||
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
||||||
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
||||||
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
||||||
'grandparentTitle': self.get_xml_attr(session, 'grandparentTitle'),
|
'grandparent_title': self.get_xml_attr(session, 'grandparentTitle'),
|
||||||
'parentTitle': self.get_xml_attr(session, 'parentTitle'),
|
'parent_title': self.get_xml_attr(session, 'parentTitle'),
|
||||||
'title': self.get_xml_attr(session, 'title'),
|
'title': self.get_xml_attr(session, 'title'),
|
||||||
'ratingKey': self.get_xml_attr(session, 'ratingKey'),
|
'rating_key': self.get_xml_attr(session, 'ratingKey'),
|
||||||
'audioDecision': audio_decision,
|
'audio_decision': audio_decision,
|
||||||
'audioChannels': audio_channels,
|
'audio_channels': audio_channels,
|
||||||
'audioCodec': audio_codec,
|
'audio_codec': audio_codec,
|
||||||
'videoDecision': video_decision,
|
'video_decision': video_decision,
|
||||||
'videoCodec': video_codec,
|
'video_codec': video_codec,
|
||||||
'height': height,
|
'height': height,
|
||||||
'width': width,
|
'width': width,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'progress': progress,
|
'progress': progress,
|
||||||
'progressPercent': str(helpers.get_percent(progress, duration)),
|
'progress_percent': str(helpers.get_percent(progress, duration)),
|
||||||
'type': self.get_xml_attr(session, 'type'),
|
'type': self.get_xml_attr(session, 'type'),
|
||||||
'indexes': use_indexes
|
'indexes': use_indexes
|
||||||
}
|
}
|
||||||
elif self.get_xml_attr(session, 'type') == 'movie':
|
elif self.get_xml_attr(session, 'type') == 'movie':
|
||||||
session_output = {'sessionKey': self.get_xml_attr(session, 'sessionKey'),
|
session_output = {'session_key': self.get_xml_attr(session, 'sessionKey'),
|
||||||
'art': self.get_xml_attr(session, 'art'),
|
'art': self.get_xml_attr(session, 'art'),
|
||||||
'thumb': thumb,
|
'thumb': thumb,
|
||||||
'parentThumb': self.get_xml_attr(session, 'parentThumb'),
|
'parent_thumb': self.get_xml_attr(session, 'parentThumb'),
|
||||||
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
||||||
'friendly_name': plex_watch.get_user_friendly_name(
|
'friendly_name': plex_watch.get_user_friendly_name(
|
||||||
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
||||||
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
||||||
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
||||||
'grandparentTitle': self.get_xml_attr(session, 'grandparentTitle'),
|
'grandparent_title': self.get_xml_attr(session, 'grandparentTitle'),
|
||||||
'parentTitle': self.get_xml_attr(session, 'parentTitle'),
|
'parent_title': self.get_xml_attr(session, 'parentTitle'),
|
||||||
'title': self.get_xml_attr(session, 'title'),
|
'title': self.get_xml_attr(session, 'title'),
|
||||||
'ratingKey': self.get_xml_attr(session, 'ratingKey'),
|
'rating_key': self.get_xml_attr(session, 'ratingKey'),
|
||||||
'audioDecision': audio_decision,
|
'audio_decision': audio_decision,
|
||||||
'audioChannels': audio_channels,
|
'audio_channels': audio_channels,
|
||||||
'audioCodec': audio_codec,
|
'audio_codec': audio_codec,
|
||||||
'videoDecision': video_decision,
|
'video_decision': video_decision,
|
||||||
'videoCodec': video_codec,
|
'video_codec': video_codec,
|
||||||
'height': height,
|
'height': height,
|
||||||
'width': width,
|
'width': width,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'progress': progress,
|
'progress': progress,
|
||||||
'progressPercent': str(helpers.get_percent(progress, duration)),
|
'progress_percent': str(helpers.get_percent(progress, duration)),
|
||||||
'type': self.get_xml_attr(session, 'type'),
|
'type': self.get_xml_attr(session, 'type'),
|
||||||
'indexes': use_indexes
|
'indexes': use_indexes
|
||||||
}
|
}
|
||||||
|
elif self.get_xml_attr(session, 'type') == 'clip':
|
||||||
|
session_output = {'session_key': self.get_xml_attr(session, 'sessionKey'),
|
||||||
|
'art': self.get_xml_attr(session, 'art'),
|
||||||
|
'thumb': thumb,
|
||||||
|
'parent_thumb': self.get_xml_attr(session, 'parentThumb'),
|
||||||
|
'user': self.get_xml_attr(session.getElementsByTagName('User')[0], 'title'),
|
||||||
|
'friendly_name': plex_watch.get_user_friendly_name(
|
||||||
|
self.get_xml_attr(session.getElementsByTagName('User')[0], 'title')),
|
||||||
|
'player': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'platform'),
|
||||||
|
'state': self.get_xml_attr(session.getElementsByTagName('Player')[0], 'state'),
|
||||||
|
'grandparent_title': self.get_xml_attr(session, 'grandparentTitle'),
|
||||||
|
'parent_title': self.get_xml_attr(session, 'parentTitle'),
|
||||||
|
'title': self.get_xml_attr(session, 'title'),
|
||||||
|
'rating_key': self.get_xml_attr(session, 'ratingKey'),
|
||||||
|
'audio_decision': audio_decision,
|
||||||
|
'audio_channels': audio_channels,
|
||||||
|
'audio_codec': audio_codec,
|
||||||
|
'video_decision': video_decision,
|
||||||
|
'video_codec': video_codec,
|
||||||
|
'height': height,
|
||||||
|
'width': width,
|
||||||
|
'duration': duration,
|
||||||
|
'progress': progress,
|
||||||
|
'progress_percent': str(helpers.get_percent(progress, duration)),
|
||||||
|
'type': self.get_xml_attr(session, 'type'),
|
||||||
|
'indexes': 0
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
logger.warn(u"No known stream types found in session list.")
|
logger.warn(u"No known stream types found in session list.")
|
||||||
|
|
||||||
|
@ -743,7 +793,7 @@ class PmsConnect(object):
|
||||||
if a.getElementsByTagName('Video'):
|
if a.getElementsByTagName('Video'):
|
||||||
result_data = a.getElementsByTagName('Video')
|
result_data = a.getElementsByTagName('Video')
|
||||||
for result in result_data:
|
for result in result_data:
|
||||||
episode_output = {'ratingKey': self.get_xml_attr(result, 'ratingKey'),
|
episode_output = {'rating_key': self.get_xml_attr(result, 'ratingKey'),
|
||||||
'index': self.get_xml_attr(result, 'index'),
|
'index': self.get_xml_attr(result, 'index'),
|
||||||
'title': self.get_xml_attr(result, 'title'),
|
'title': self.get_xml_attr(result, 'title'),
|
||||||
'thumb': self.get_xml_attr(result, 'thumb')
|
'thumb': self.get_xml_attr(result, 'thumb')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue