From e976e6cf5c910e7d52933ff4994ed9d479f9c909 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sat, 22 Aug 2015 05:17:30 -0700 Subject: [PATCH] Added more detail to history items * Year for movies * Season and episode number for episodes * Album name for tracks --- data/interfaces/default/js/tables/history_table.js | 7 ++++--- plexpy/datafactory.py | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js index 287e9d75..9898cc1b 100644 --- a/data/interfaces/default/js/tables/history_table.js +++ b/data/interfaces/default/js/tables/history_table.js @@ -119,15 +119,16 @@ history_table_options = { var thumb_popover = ''; if (rowData['media_type'] === 'movie') { media_type = ''; - thumb_popover = '' + cellData + '' + thumb_popover = '' + cellData + ' (' + rowData['year'] + ')' $(td).html('
' + media_type + ' ' + thumb_popover + '
'); } else if (rowData['media_type'] === 'episode') { media_type = ''; - thumb_popover = '' + cellData + '' + thumb_popover = '' + cellData + ' \ + (S' + ('00' + rowData['parent_media_index']).slice(-2) + 'E' + ('00' + rowData['media_index']).slice(-2) + ')' $(td).html('
' + media_type + ' ' + thumb_popover + '
'); } else if (rowData['media_type'] === 'track') { media_type = ''; - thumb_popover = '' + cellData + '' + thumb_popover = '' + cellData + ' (' + rowData['parent_title'] + ')' $(td).html('
' + media_type + ' ' + thumb_popover + '
'); } else { $(td).html('' + cellData + ''); diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 797b21c7..b60c654b 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -39,6 +39,10 @@ class DataFactory(object): 'session_history_metadata.thumb', 'session_history_metadata.parent_thumb', 'session_history_metadata.grandparent_thumb', + 'session_history_metadata.media_index', + 'session_history_metadata.parent_media_index', + 'session_history_metadata.parent_title', + 'session_history_metadata.year', 'session_history.started', 'session_history.paused_counter', 'session_history.stopped', @@ -98,6 +102,10 @@ class DataFactory(object): "ip_address": item["ip_address"], "full_title": item["full_title"], "thumb": thumb, + "media_index": item["media_index"], + "parent_media_index": item["parent_media_index"], + "parent_title": item["parent_title"], + "year": item["year"], "started": item["started"], "paused_counter": item["paused_counter"], "stopped": item["stopped"],