From 6c64213999cbf685ff1ad4201604095d164b69ec Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Fri, 28 Aug 2020 16:28:07 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20pick-show:=20Skip=20completed=20sho?= =?UTF-8?q?ws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trakt.pick-show.user.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/trakt.pick-show.user.js b/trakt.pick-show.user.js index d17c02e..f4701ae 100644 --- a/trakt.pick-show.user.js +++ b/trakt.pick-show.user.js @@ -78,20 +78,26 @@ function filterShows($shows) { // Milliseconds in two days - let twoDays = 2 * 24 * 60 * 60 * 1000; - let twoDaysAgo = (new Date()) - twoDays; + const twoDays = 2 * 24 * 60 * 60 * 1000; + const twoDaysAgo = (new Date()) - twoDays; $shows.each(function (i, show) { - let showId = Number.parseInt(show.dataset.showId); - let showInfo = watched_shows[showId]; + const showId = Number.parseInt(show.dataset.showId); + const showInfo = watched_shows[showId]; if (!showInfo) return; - let lastWatch = showInfo.ts*1000; + const lastWatch = showInfo.ts*1000; // Skip ones we've watched in the last two days if (lastWatch > twoDaysAgo) { show.classList.add('sortable-ghost'); } + + const percentage = show.dataset.percentage; + + if (percentage == 100) { + show.classList.add('sortable-ghost'); + } }); return $shows.filter(':not(.sortable-ghost)');