-
-
Save mcevskb/310ecab9a874c805e391a13cb38a4ed7 to your computer and use it in GitHub Desktop.
Remove duplicate episodes from Trakt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run in console on the history page (http://trakt.tv/users/<username>/history) | |
// Will remove all the duplicate episodes, on that page, from the watched history. | |
var episodesRemoved = [] | |
// episodeItems = $("[data-type=episode]") | |
episodeItems.each(function(){ | |
var $this = $(this); | |
var episodeId = $this.data('episode-id') | |
var showId = $this.data('show-id') | |
if (!episodesRemoved.includes(episodeId)) { | |
var plays = shows.watched[showId].episodes[episodeId][1] | |
if (plays > 1) { | |
console.info(episodeId, 'removed') | |
historyRemove($this, $this.data("history-id")); | |
} else { | |
console.info(episodeId, 'has been played once') | |
} | |
episodesRemoved.push(episodeId) | |
} else { | |
console.info(episodeId, 'has already been removed') | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/desbarmitar/Trakt-Integration/blob/main/README.md
Inspiered in your code and use javascript minifier to use as bookmarklet, like a bookmark in the toolbar.