mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Implement friendly names in current activity.
Fix bug on current activity when playing music.
This commit is contained in:
parent
6f7194593b
commit
64d9b95de9
2 changed files with 12 additions and 3 deletions
|
@ -22,6 +22,7 @@ thumb Returns the location of the item's thumbnail. Use with p
|
||||||
art Returns the location of the item's artwork
|
art Returns the location of the item's artwork
|
||||||
progress_percent Returns the current progress of the item. 0 to 100.
|
progress_percent Returns the current progress of the item. 0 to 100.
|
||||||
user Returns the name of the user owning the session.
|
user Returns the name of the user owning the session.
|
||||||
|
friendly_name Returns the friendlly name of the user owning the session.
|
||||||
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.
|
||||||
|
@ -74,7 +75,7 @@ DOCUMENTATION :: END
|
||||||
<div class="dashboard-activity-metadata-platform" id="platform-${a['sessionKey']}">
|
<div class="dashboard-activity-metadata-platform" id="platform-${a['sessionKey']}">
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-activity-metadata-user">
|
<div class="dashboard-activity-metadata-user">
|
||||||
<a href="user?user=${a['user']}">${a['user']}</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':
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with PlexPy. If not, see <http://www.gnu.org/licenses/>.
|
# along with PlexPy. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from plexpy import logger, helpers
|
from plexpy import logger, helpers, plexwatch
|
||||||
|
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
from httplib import HTTPSConnection
|
from httplib import HTTPSConnection
|
||||||
|
@ -497,6 +497,7 @@ class PmsConnect(object):
|
||||||
"""
|
"""
|
||||||
def get_session_each(self, stream_type='', session=None):
|
def get_session_each(self, stream_type='', session=None):
|
||||||
session_output = None
|
session_output = None
|
||||||
|
plex_watch = plexwatch.PlexWatch()
|
||||||
if stream_type == 'track':
|
if stream_type == 'track':
|
||||||
if session.getElementsByTagName('TranscodeSession'):
|
if session.getElementsByTagName('TranscodeSession'):
|
||||||
transcode_session = session.getElementsByTagName('TranscodeSession')[0]
|
transcode_session = session.getElementsByTagName('TranscodeSession')[0]
|
||||||
|
@ -517,6 +518,8 @@ class PmsConnect(object):
|
||||||
'parentThumb': self.get_xml_attr(session, 'parentThumb'),
|
'parentThumb': 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(
|
||||||
|
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'),
|
||||||
'artist': self.get_xml_attr(session, 'grandparentTitle'),
|
'artist': self.get_xml_attr(session, 'grandparentTitle'),
|
||||||
|
@ -529,7 +532,8 @@ class PmsConnect(object):
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'progress': progress,
|
'progress': progress,
|
||||||
'progressPercent': str(helpers.get_percent(progress, duration)),
|
'progressPercent': str(helpers.get_percent(progress, duration)),
|
||||||
'type': 'track'
|
'type': 'track',
|
||||||
|
'indexes': 0
|
||||||
}
|
}
|
||||||
elif stream_type == 'video':
|
elif stream_type == 'video':
|
||||||
if session.getElementsByTagName('TranscodeSession'):
|
if session.getElementsByTagName('TranscodeSession'):
|
||||||
|
@ -579,6 +583,8 @@ class PmsConnect(object):
|
||||||
'art': self.get_xml_attr(session, 'art'),
|
'art': self.get_xml_attr(session, 'art'),
|
||||||
'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(
|
||||||
|
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'),
|
'grandparentTitle': self.get_xml_attr(session, 'grandparentTitle'),
|
||||||
|
@ -602,6 +608,8 @@ class PmsConnect(object):
|
||||||
'art': self.get_xml_attr(session, 'art'),
|
'art': self.get_xml_attr(session, 'art'),
|
||||||
'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(
|
||||||
|
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'),
|
||||||
'title': self.get_xml_attr(session, 'title'),
|
'title': self.get_xml_attr(session, 'title'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue