From c25c48c1a6de8ee678363b1211d16e64d6b05b34 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Mon, 12 Oct 2015 00:28:05 -0700 Subject: [PATCH] Add watched percent to history table tooltip --- .../default/js/tables/history_table.js | 21 ++++++++++--------- plexpy/datafactory.py | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js index 6ff1d674..1cafd218 100644 --- a/data/interfaces/default/js/tables/history_table.js +++ b/data/interfaces/default/js/tables/history_table.js @@ -214,13 +214,13 @@ history_table_options = { { "targets": [11], "data": "watched_status", - "render": function (data, type, full) { - if (data == 1) { - return '' - } else if (data == 0.5) { - return '' + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData == 1) { + $(td).html(''); + } else if (cellData == 0.5) { + $(td).html(''); } else { - return '' + $(td).html(''); } }, "searchable": false, @@ -236,12 +236,13 @@ history_table_options = { // Create the tooltips. $('.expand-history-tooltip').tooltip({ container: 'body' }); - $('.external-ip-tooltip').tooltip(); - $('.transcode-tooltip').tooltip(); - $('.media-type-tooltip').tooltip(); - $('.watched-tooltip').tooltip(); + $('.external-ip-tooltip').tooltip({ container: 'body' }); + $('.transcode-tooltip').tooltip({ container: 'body' }); + $('.media-type-tooltip').tooltip({ container: 'body' }); + $('.watched-tooltip').tooltip({ container: 'body' }); $('.thumb-tooltip').popover({ html: true, + container: 'body', trigger: 'hover', placement: 'right', content: function () { diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 0fde3150..f09ae30c 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -136,6 +136,7 @@ class DataFactory(object): "thumb": thumb, "video_decision": item["video_decision"], "audio_decision": item["audio_decision"], + "percent_complete": int(round(item['percent_complete'])), "watched_status": watched_status, "group_count": item["group_count"], "group_ids": item["group_ids"]