Skip to content

Commit

Permalink
Merge pull request #71 from RileyXX/improvements-for-removing-watched…
Browse files Browse the repository at this point in the history
…-items-from-watchlists

Improvements for removing watched items from watchlists
  • Loading branch information
RileyXX authored Oct 13, 2023
2 parents 72a6f82 + a60af66 commit 1ca542d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions IMDBTraktSyncer/traktData.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ def getTraktData():
trakt_show_id = show['TraktID']
show_status = show['ShowStatus']
aired_episodes = show['AiredEpisodes']
episode_numbers = {episode['EpisodeNumber'] for episode in watched_episodes if episode['Type'] == 'episode' and episode['TraktShowID'] == trakt_show_id}
episode_numbers = [episode['EpisodeNumber'] for episode in watched_episodes if episode['Type'] == 'episode' and episode['TraktShowID'] == trakt_show_id]
unique_watched_episode_count = len(episode_numbers)

if (show_status == 'ended' or show_status == 'cancelled') and unique_watched_episode_count >= 0.8 * int(aired_episodes):
if (show_status.lower() in ['ended', 'cancelled', 'canceled']) and (unique_watched_episode_count >= 0.8 * int(aired_episodes)):
filtered_watched_shows.append(show)

# Update watched_shows with the filtered results
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
with codecs.open(os.path.join(here, "README.md"), 'r', encoding="utf-8") as fh:
long_description = "\n" + fh.read()

VERSION = '1.8.0'
VERSION = '1.8.1'
DESCRIPTION = 'A python script that syncs user watchlist, ratings and comments for Movies, TV Shows and Episodes both ways between Trakt and IMDB.'

# Setting up
Expand Down

0 comments on commit 1ca542d

Please sign in to comment.