From 1ff58a85dc2305d21c888fcad291a24644c3023d Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 18 Oct 2015 10:27:18 -0700 Subject: [PATCH 1/7] Fix bug in "Last Watched" statistics *Fix if two users watched the same item, it would only show the most recent user. --- plexpy/datafactory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index f09ae30c..1ffdc2e5 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -564,7 +564,7 @@ class DataFactory(object): 'AND (session_history_metadata.media_type = "movie" ' \ 'OR session_history_metadata.media_type = "episode") ' \ 'AND percent_complete >= %s ' \ - 'GROUP BY session_history_metadata.full_title ' \ + 'GROUP BY session_history.id ' \ 'ORDER BY last_watch DESC ' \ 'LIMIT %s' % (time_range, notify_watched_percent, stats_count) result = monitor_db.select(query) From 2243cd1de9a12f7e4c38c9ef7bc24f595939b5e4 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 18 Oct 2015 11:50:01 -0700 Subject: [PATCH 2/7] Add filtering of media_type from history table --- data/interfaces/default/history.html | 55 ++++++++++++++++++++++------ data/interfaces/default/user.html | 42 ++++++++++++++++++--- plexpy/datatables.py | 13 ++++--- plexpy/webserve.py | 17 +++++---- 4 files changed, 98 insertions(+), 29 deletions(-) diff --git a/data/interfaces/default/history.html b/data/interfaces/default/history.html index 3f589390..050e82c4 100644 --- a/data/interfaces/default/history.html +++ b/data/interfaces/default/history.html @@ -76,19 +76,52 @@ % endif +% if data['type'] != 'library': + +% endif % if data['type'] != 'library' and data['rating']: