diff --git a/trakt.scraper.user.js b/trakt.scraper.user.js index a927bd2..f18c54b 100644 --- a/trakt.scraper.user.js +++ b/trakt.scraper.user.js @@ -91,8 +91,13 @@ function getStuff() { - watched_shows = JSON.parse(localStorage.watched_shows); - watched_movies = JSON.parse(localStorage.watched_movies); + if ('compressedCache' in window) { + watched_shows = compressedCache.get('watched_shows'); + watched_movies = compressedCache.get('watched_movies'); + } else { + watched_shows = JSON.parse(localStorage.watched_shows); + watched_movies = JSON.parse(localStorage.watched_movies); + } let $el = $(''); $(document.body).append($el); diff --git a/trakt.simplifier.user.js b/trakt.simplifier.user.js index 186b21a..9fa2bca 100644 --- a/trakt.simplifier.user.js +++ b/trakt.simplifier.user.js @@ -23,8 +23,15 @@ let since = parseInt(query.since, 10); - let watched_shows = JSON.parse(localStorage.watched_shows);; - let watched_movies = JSON.parse(localStorage.watched_movies); + let watched_shows; + let watched_movies; + if ('compressedCache' in window) { + watched_shows = compressedCache.get('watched_shows'); + watched_movies = compressedCache.get('watched_movies'); + } else { + watched_shows = JSON.parse(localStorage.watched_shows); + watched_movies = JSON.parse(localStorage.watched_movies); + } $('[itemtype="http://schema.org/TVEpisode"], [itemtype="http://schema.org/Movie"]').each(function () { let type = $(this).attr('itemtype').replace(/^https?:\/\/schema.org\//, '');