Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear_collected removes episodes from Trakt that weren't collected in the first place

NGDM opened this issue · comments

commented

Confirmation

  • I have read the README.md on the project homepage
  • I have checked if identical issue already exists
  • I have tried downgrading to find version that can be used as a workaround

The problem

The script will iterate over all episodes of a show and remove them from the Trakt Collection, even if those episodes were never collected in the first place.
Not sure if this is a Trakt API restriction, but it would be better to use the actual list of episodes in the Trakt Collection to iterate over.

Example

Error trace / logs

2023-04-06 10:49:57,137 INFO[PlexTraktSync]:Remove from Trakt collection (1/3190): <TVEpisode>: Malcolm in the Middle S0E1 A Stroke of Genius
2023-04-06 10:49:57,183 INFO[PlexTraktSync]:Remove from Trakt collection (2/3190): <TVEpisode>: Malcolm in the Middle S0E2 Outtakes
2023-04-06 10:49:57,189 INFO[PlexTraktSync]:Remove from Trakt collection (3/3190): <TVEpisode>: Malcolm in the Middle S0E3 Gag Reel
2023-04-06 10:49:57,193 INFO[PlexTraktSync]:Remove from Trakt collection (4/3190): <TVEpisode>: Malcolm in the Middle S0E4 Malcolm Vision
2023-04-06 10:49:57,196 INFO[PlexTraktSync]:Remove from Trakt collection (5/3190): <TVEpisode>: Malcolm in the Middle S0E5 DS Deals And Sellouts
2023-04-06 10:49:57,199 INFO[PlexTraktSync]:Remove from Trakt collection (6/3190): <TVEpisode>: Malcolm in the Middle S0E6 Cold Opens
2023-04-06 10:49:57,202 INFO[PlexTraktSync]:Remove from Trakt collection (7/3190): <TVEpisode>: Malcolm in the Middle S0E7 Season One Promos
2023-04-06 10:49:57,205 INFO[PlexTraktSync]:Remove from Trakt collection (8/3190): <TVEpisode>: Malcolm in the Middle S0E8 Malcolm: Behind the Middle
2023-04-06 10:49:57,209 INFO[PlexTraktSync]:Remove from Trakt collection (9/3190): <TVEpisode>: Malcolm in the Middle S0E9 Dewey's Day Job: A Portrait of Erik Per Sullivan
2023-04-06 10:49:57,213 INFO[PlexTraktSync]:Remove from Trakt collection (10/3190): <TVEpisode>: Malcolm in the Middle S0E10 Pilot Extended
2023-04-06 10:49:57,240 INFO[PlexTraktSync]:Remove from Trakt collection (11/3190): <TVEpisode>: Malcolm in the Middle S0E11 None
2023-04-06 10:49:57,243 INFO[PlexTraktSync]:Remove from Trakt collection (12/3190): <TVEpisode>: Malcolm in the Middle S0E12 Company Picnic 1: Director's cut (Season 3, episode 11)
2023-04-06 10:49:57,247 INFO[PlexTraktSync]:Remove from Trakt collection (13/3190): <TVEpisode>: Malcolm in the Middle S0E13 Quarantunes Reunion
2023-04-06 10:49:57,251 INFO[PlexTraktSync]:Remove from Trakt collection (14/3190): <TVEpisode>: The Mandalorian S3E7 Chapter 23
2023-04-06 10:49:57,256 INFO[PlexTraktSync]:Remove from Trakt collection (15/3190): <TVEpisode>: The Mandalorian S3E8 Chapter 24
2023-04-06 10:49:57,260 INFO[PlexTraktSync]:Remove from Trakt collection (16/3190): <TVEpisode>: Ted Lasso S0E1 The Missing Christmas Mustache
2023-04-06 10:49:57,263 INFO[PlexTraktSync]:Remove from Trakt collection (17/3190): <TVEpisode>: Ted Lasso S3E5 Signs
2023-04-06 10:49:57,266 INFO[PlexTraktSync]:Remove from Trakt collection (18/3190): <TVEpisode>: Ted Lasso S3E6 Every Disadvantage Has Its Advantage
2023-04-06 10:49:57,269 INFO[PlexTraktSync]:Remove from Trakt collection (19/3190): <TVEpisode>: Ted Lasso S3E7 Ola's
2023-04-06 10:49:57,272 INFO[PlexTraktSync]:Remove from Trakt collection (20/3190): <TVEpisode>: Ted Lasso S3E8 We'll Never Have Paris
2023-04-06 10:49:57,275 INFO[PlexTraktSync]:Remove from Trakt collection (21/3190): <TVEpisode>: Ted Lasso S3E9 The Omission Attrition
2023-04-06 10:49:57,278 INFO[PlexTraktSync]:Remove from Trakt collection (22/3190): <TVEpisode>: Ted Lasso S3E10 Episode 10
2023-04-06 10:49:57,282 INFO[PlexTraktSync]:Remove from Trakt collection (23/3190): <TVEpisode>: Ted Lasso S3E11 Episode 11
2023-04-06 10:49:57,284 INFO[PlexTraktSync]:Remove from Trakt collection (24/3190): <TVEpisode>: Ted Lasso S3E12 Episode 12

Expected behavior

I would expect that the script only removes items from collection if they were actually collected before.
Now it seems to just take all episodes of the show, crosscheck with the Plex library and try to remove all differences from the Trakt collection.

Steps to reproduce the behavior

  1. Regular sync with plex_to_trakt.collection and plex_to_trakt.clear_collected both set to true
  2. In the logs you will see an iteration of all 'missing' episodes of the shows on Plex stating the episode was removed of the Trakt Collection

Inspect of problematic items

No response

Workarounds

No response

Install method

docker-compose

Config file contents

cache:
  path: $PTS_CACHE_DIR/trakt_cache

excluded-libraries:
  - Family
  - HDD Movies
  - HDD TV Shows

config:
  dotenv_override: true

plex:
  timeout: 30

logging:
  append: false
  # Whether to show timestamps in console messages
  console_time: false
  debug: false
  filename: plextraktsync.log
  filter:
#    # Filter out all messages with level WARNING
#    - level: WARNING
#    # Filter out message with level WARNING and containing a text
#    - level: WARNING
#      message: "not found on Trakt"
#    - message: "because provider local has no external Id"
#    - message: "because provider none has no external Id"
#    - message: "Retry using search for specific Plex Episode"

sync:
  plex_to_trakt:
    collection: true
    clear_collected: true
    ratings: true
    watched_status: true
    watchlist: false
  trakt_to_plex:
    liked_lists: true
    ratings: true
    watched_status: true
    watchlist: true
    watchlist_as_playlist: false

watch:
  add_collection: true
  remove_collection: true
  scrobble_threshold: 80
  username_filter: true

xbmc-providers:
  movies: imdb
  shows: tvdb

# vim:ts=2:sw=2:et

Version

0.25.17

Python Version

3.11.2

Operating System and Version

Synology DSM 6

You failed to explain why you need this. Is something broken due this? you didn't report as Feature request (Enchancement) but rather as a Bug.

commented

My bad, thought this was an issue with the script.
I've logged a Feature Request. It's a QOL enhancement, so do with it what you want. (#1452)

This bug appeared in 0.25.11

With :

See #1452