Skip to content

Instantly share code, notes, and snippets.

@mcevskb
Forked from hugoboos/trakt-remove-history.js
Last active July 8, 2021 21:07
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcevskb/310ecab9a874c805e391a13cb38a4ed7 to your computer and use it in GitHub Desktop.
Save mcevskb/310ecab9a874c805e391a13cb38a4ed7 to your computer and use it in GitHub Desktop.
Remove duplicate episodes from Trakt
// 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')
}
})
@desbarmitar
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment