// Run in console on the history page (http://trakt.tv/users//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') } })