From 5a95d4a17ae27bc4febc3336843eb2c4eb438673 Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Tue, 15 Oct 2019 09:40:04 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20released=20to=20trakt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trakt.scraper.user.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trakt.scraper.user.js b/trakt.scraper.user.js index c5c6fff..641ef69 100644 --- a/trakt.scraper.user.js +++ b/trakt.scraper.user.js @@ -10,6 +10,8 @@ // @require https://raw.githubusercontent.com/tommcfarlin/konami-code/master/src/jquery.konami.min.js // ==/UserScript== +/* global $, compressedCache, localStorage */ + (function() { 'use strict'; @@ -50,6 +52,11 @@ $ep_title = $ep.find('[itemprop="name"]'); } + let released = $ep.data('released') || null; + if (released) { + released = (new Date(released)).getTime()/1000; + } + let ep_title = $ep_title.attr('content'); let ep_number = $ep.find('[itemprop="episodeNumber"]').attr('content'); let season_number = $ep.data('season-number'); @@ -63,6 +70,7 @@ episode_id: ep, title, url, + released, watches: watched ? watched[1] : 0, last_watched: watched ? watched[0] : null, };