mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 05:31:15 -07:00
Fix "Mystery" platform in stats and activity
This commit is contained in:
parent
c12c72bbd6
commit
441572ea12
5 changed files with 30 additions and 9 deletions
|
@ -106,7 +106,12 @@ DOCUMENTATION :: END
|
||||||
</div>
|
</div>
|
||||||
<div id="stream-${a['session_key']}" class="dashboard-activity-info-details-overlay">
|
<div id="stream-${a['session_key']}" class="dashboard-activity-info-details-overlay">
|
||||||
<div class="dashboard-activity-info-details-content">
|
<div class="dashboard-activity-info-details-content">
|
||||||
<div class="dashboard-activity-info-platform" id="platform-${a['session_key']}">
|
<div id="platform-${a['session_key']}" title="${a['platform']}">
|
||||||
|
<script>
|
||||||
|
$("#platform-${a['session_key']}").html("<div class='dashboard-activity-info-platform-box' style='background-image: url(" + getPlatformImagePath('${a['platform']}') + ");'>");
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div class="dashboard-activity-info-platform">
|
||||||
<strong>${a['player']}</strong><br />
|
<strong>${a['player']}</strong><br />
|
||||||
% if a['state'] == 'playing':
|
% if a['state'] == 'playing':
|
||||||
State <strong>Playing</strong>
|
State <strong>Playing</strong>
|
||||||
|
@ -249,9 +254,6 @@ DOCUMENTATION :: END
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
|
||||||
$("#platform-${a['session_key']}").prepend("<div class='dashboard-activity-info-platform-box' style='background-image: url(" + getPlatformImagePath('${a['platform']}') + ");'>");
|
|
||||||
</script>
|
|
||||||
|
|
||||||
% endfor
|
% endfor
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -213,11 +213,11 @@ function getPlatformImagePath(platformName) {
|
||||||
return 'interfaces/default/images/platforms/opera.png';
|
return 'interfaces/default/images/platforms/opera.png';
|
||||||
} else if (platformName.indexOf("KODI") > -1) {
|
} else if (platformName.indexOf("KODI") > -1) {
|
||||||
return 'interfaces/default/images/platforms/kodi.png';
|
return 'interfaces/default/images/platforms/kodi.png';
|
||||||
} else if (platformName.indexOf("Mystery 3") > -1) {
|
} else if (platformName.indexOf("Playstation 3") > -1) {
|
||||||
return 'interfaces/default/images/platforms/playstation.png';
|
return 'interfaces/default/images/platforms/playstation.png';
|
||||||
} else if (platformName.indexOf("Mystery 4") > -1) {
|
} else if (platformName.indexOf("Playstation 4") > -1) {
|
||||||
return 'interfaces/default/images/platforms/playstation.png';
|
return 'interfaces/default/images/platforms/playstation.png';
|
||||||
} else if (platformName.indexOf("Mystery 5") > -1) {
|
} else if (platformName.indexOf("Xbox 360") > -1) {
|
||||||
return 'interfaces/default/images/platforms/xbox.png';
|
return 'interfaces/default/images/platforms/xbox.png';
|
||||||
} else if (platformName.indexOf("Windows") > -1) {
|
} else if (platformName.indexOf("Windows") > -1) {
|
||||||
return 'interfaces/default/images/platforms/win8.png';
|
return 'interfaces/default/images/platforms/win8.png';
|
||||||
|
|
|
@ -502,11 +502,17 @@ class DataFactory(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
for item in result:
|
for item in result:
|
||||||
|
# Rename Mystery platform names
|
||||||
|
platform_names = {'Mystery 3': 'Playstation 3',
|
||||||
|
'Mystery 4': 'Playstation 4',
|
||||||
|
'Mystery 5': 'Xbox 360'}
|
||||||
|
platform_type = platform_names.get(item[0], item[0])
|
||||||
|
|
||||||
row = {'platform': item[0],
|
row = {'platform': item[0],
|
||||||
'total_plays': item[1],
|
'total_plays': item[1],
|
||||||
'total_duration': item[2],
|
'total_duration': item[2],
|
||||||
'last_play': item[3],
|
'last_play': item[3],
|
||||||
'platform_type': item[0],
|
'platform_type': platform_type,
|
||||||
'title': '',
|
'title': '',
|
||||||
'thumb': '',
|
'thumb': '',
|
||||||
'grandparent_thumb': '',
|
'grandparent_thumb': '',
|
||||||
|
|
|
@ -1070,6 +1070,13 @@ class PmsConnect(object):
|
||||||
else:
|
else:
|
||||||
logger.warn(u"No known stream types found in session list.")
|
logger.warn(u"No known stream types found in session list.")
|
||||||
|
|
||||||
|
# Rename Mystery platform names
|
||||||
|
platform_names = {'Mystery 3': 'Playstation 3',
|
||||||
|
'Mystery 4': 'Playstation 4',
|
||||||
|
'Mystery 5': 'Xbox 360'}
|
||||||
|
session_output['platform'] = platform_names.get(session_output['platform'],
|
||||||
|
session_output['platform'])
|
||||||
|
|
||||||
return session_output
|
return session_output
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -516,8 +516,14 @@ class Users(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
for item in result:
|
for item in result:
|
||||||
|
# Rename Mystery platform names
|
||||||
|
platform_names = {'Mystery 3': 'Playstation 3',
|
||||||
|
'Mystery 4': 'Playstation 4',
|
||||||
|
'Mystery 5': 'Xbox 360'}
|
||||||
|
platform_type = platform_names.get(item[2], item[2])
|
||||||
|
|
||||||
row = {'platform_name': item[0],
|
row = {'platform_name': item[0],
|
||||||
'platform_type': item[2],
|
'platform_type': platform_type,
|
||||||
'total_plays': item[1],
|
'total_plays': item[1],
|
||||||
'result_id': result_id
|
'result_id': result_id
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue