Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)
MIT License
1.5k stars 100 forks source link

TypeError was raised: unhashable type: 'PlexLibraryItem' in 0.28.7 #1740

Closed JourneyOver closed 6 months ago

JourneyOver commented 6 months ago

Confirmation

The problem

Updated to version 0.28.7 and upon doing so I start getting errors in the log about TypeError was raised: unhashable type: 'PlexLibraryItem' constantly when browsing my plex library or watching something, it no longer scrobbles after the watch period of a show or movie is over either.

Error trace / logs

2024-01-14 23:36:25,318 DEBUG[requests_cache.backends]:Initializing backend: None /app/config/trakt_cache
2024-01-14 23:36:25,318 DEBUG[requests_cache.backends.base]:Initialized SQLiteDict with serializer: SerializerPipeline(name=pickle, n_stages=2)
2024-01-14 23:36:25,319 DEBUG[requests_cache.backends.sqlite]:Opening connection to /app/config/trakt_cache.sqlite:responses
2024-01-14 23:36:25,320 DEBUG[requests_cache.backends.base]:Initialized SQLiteDict with serializer: None
2024-01-14 23:36:25,320 DEBUG[requests_cache.backends.sqlite]:Opening connection to /app/config/trakt_cache.sqlite:redirects
2024-01-14 23:36:25,325 INFO[PlexTraktSync.PlexServerConnection]:Connecting with url: https://<URL>:32400, timeout 30 seconds
2024-01-14 23:36:25,330 DEBUG[plexapi]:GET https://<URL>:32400/
2024-01-14 23:36:25,335 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:25,346 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled cache
2024-01-14 23:36:25,346 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=-1, send_request=True, skip_read=True)
2024-01-14 23:36:25,347 DEBUG[urllib3.connectionpool]:Starting new HTTPS connection (1): <URL>:32400
2024-01-14 23:36:25,388 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET / HTTP/1.1" 200 3319
2024-01-14 23:36:25,389 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:25,389 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled cache
2024-01-14 23:36:25,389 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/
2024-01-14 23:36:25,442 INFO[PlexTraktSync.WebSocketListener]:Listening for events!
2024-01-14 23:36:25,444 DEBUG[PlexTraktSync.EventDispatcher]:<class 'plextraktsync.watch.events.ServerStarted'>:{'notifier': <AlertListener(Thread-1, started daemon 140092616977208)>}
2024-01-14 23:36:25,444 INFO[PlexTraktSync.WatchStateUpdater]:Server connected: Endless Media Entertainment (1.40.0.7775-456fbaf97)
2024-01-14 23:36:25,452 INFO[plexapi]:Starting AlertListener: wss://<URL>:32400/:/websockets/notifications?X-Plex-Token=<hidden>
2024-01-14 23:36:25,494 INFO[websocket]:Websocket connected
2024-01-14 23:36:29,052 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:29,052 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'started', 'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'Activity': {'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': '', 'progress': 0}}]}
2024-01-14 23:36:29,053 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:29,053 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'Activity': {'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Checking files', 'progress': 0, 'Context': {'key': '/library/metadata/21340'}}}]}
2024-01-14 23:36:29,053 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:29,053 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'Activity': {'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing local metadata', 'progress': 33, 'Context': {'accessible': True, 'exists': True, 'key': '/library/metadata/21340'}}}]}
2024-01-14 23:36:29,054 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:29,054 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'Activity': {'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing media analysis', 'progress': 66, 'Context': {'accessible': True, 'exists': True, 'key': '/library/metadata/21340', 'refreshed': False}}}]}
2024-01-14 23:36:29,054 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:29,054 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'ended', 'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'Activity': {'uuid': '7f6551c4-160c-41d4-a947-069aa686345f', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing media analysis', 'progress': 100, 'Context': {'accessible': True, 'analyzed': False, 'exists': True, 'key': '/library/metadata/21340', 'refreshed': False}}}]}
2024-01-14 23:36:29,054 DEBUG[plexapi]:GET https://<URL>:32400/library
2024-01-14 23:36:29,056 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:29,056 DEBUG[requests_cache.policy.expiration]:URL https://<URL>:32400/library matched pattern "*/library": 3674576450094852
2024-01-14 23:36:29,056 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled by expiration
2024-01-14 23:36:29,056 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=3674576450094852, send_request=True, skip_read=True)
2024-01-14 23:36:29,058 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET /library HTTP/1.1" 200 290
2024-01-14 23:36:29,059 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:29,059 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled by expiration
2024-01-14 23:36:29,059 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/library
2024-01-14 23:36:29,060 DEBUG[plexapi]:GET https://<URL>:32400/library/metadata/21340
2024-01-14 23:36:29,061 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:29,061 DEBUG[requests_cache.policy.expiration]:URL https://<URL>:32400/library/metadata/21340 matched pattern "*/library/metadata/*": 3674576450094852
2024-01-14 23:36:29,061 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled by expiration
2024-01-14 23:36:29,061 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=3674576450094852, send_request=True, skip_read=True)
2024-01-14 23:36:29,067 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET /library/metadata/21340 HTTP/1.1" 200 2287
2024-01-14 23:36:29,067 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:29,067 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled by expiration
2024-01-14 23:36:29,068 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/library/metadata/21340
2024-01-14 23:36:29,084 DEBUG[plexapi]:GET https://<URL>:32400/library/sections
2024-01-14 23:36:29,085 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:29,086 DEBUG[requests_cache.policy.expiration]:URL https://<URL>:32400/library/sections matched pattern "*/library/sections": 3674576450094852
2024-01-14 23:36:29,086 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled by expiration
2024-01-14 23:36:29,086 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=3674576450094852, send_request=True, skip_read=True)
2024-01-14 23:36:29,088 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET /library/sections HTTP/1.1" 200 598
2024-01-14 23:36:29,089 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:29,089 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled by expiration
2024-01-14 23:36:29,089 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/library/sections
2024-01-14 23:36:29,091 ERROR[PlexTraktSync.EventDispatcher]:TypeError was raised: unhashable type: 'PlexLibraryItem'
2024-01-14 23:36:29,093 DEBUG[PlexTraktSync.EventDispatcher]:['  File "/app/plextraktsync/watch/EventDispatcher.py", line 37, in dispatch\n    listener["listener"](event)\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 129, in on_activity\n    m = self.find_by_key(activity.key, reload=True)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 96, in find_by_key\n    m = self.mf_resolve(pm)\n        ^^^^^^^^^^^^^^^^^^^\n']
2024-01-14 23:36:39,593 DEBUG[plexapi]:Alert: type size PlaySessionStateNotification
2024-01-14 23:36:39,594 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'playing', 'size': 1, 'PlaySessionStateNotification': [{'sessionKey': '19', 'clientIdentifier': 'n5juzfq1fkhpd9smhnzw5n5e', 'guid': '', 'ratingKey': '21340', 'url': '', 'key': '/library/metadata/21340', 'viewOffset': 1000, 'playQueueItemID': 10180, 'playQueueID': 2509, 'state': 'playing'}]}
2024-01-14 23:36:39,594 DEBUG[plexapi]:GET https://<URL>:32400/status/sessions
2024-01-14 23:36:39,599 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:39,601 DEBUG[requests_cache.policy.expiration]:URL https://<URL>:32400/status/sessions matched pattern "*/status/sessions": 3674576450094852
2024-01-14 23:36:39,601 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled by expiration
2024-01-14 23:36:39,602 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=3674576450094852, send_request=True, skip_read=True)
2024-01-14 23:36:39,607 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET /status/sessions HTTP/1.1" 200 2416
2024-01-14 23:36:39,609 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:39,610 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled by expiration
2024-01-14 23:36:39,611 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/status/sessions
2024-01-14 23:36:39,640 DEBUG[plexapi]:GET https://plex.tv/api/v2/user 
2024-01-14 23:36:39,644 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:39,645 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: Passed
2024-01-14 23:36:39,662 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=-1, send_request=True)
2024-01-14 23:36:39,663 DEBUG[urllib3.connectionpool]:Starting new HTTPS connection (1): plex.tv:443
2024-01-14 23:36:40,266 DEBUG[urllib3.connectionpool]:https://plex.tv:443 "GET /api/v2/user HTTP/1.1" 200 None
2024-01-14 23:36:40,270 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(max_age=0, must_revalidate=True, etag='W/"93ed11af7d4cd75b67766f91f5f87423"')
2024-01-14 23:36:40,270 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: Passed
2024-01-14 23:36:40,513 DEBUG[charset_normalizer]:Encoding detection: utf_8 is most likely the one.
2024-01-14 23:36:40,515 DEBUG[plexapi]:GET https://<URL>:32400/status/sessions
2024-01-14 23:36:40,517 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:40,517 DEBUG[requests_cache.policy.expiration]:URL https://<URL>:32400/status/sessions matched pattern "*/status/sessions": 3674576450094852
2024-01-14 23:36:40,517 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled by expiration
2024-01-14 23:36:40,517 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=3674576450094852, send_request=True, skip_read=True)
2024-01-14 23:36:40,519 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET /status/sessions HTTP/1.1" 200 2416
2024-01-14 23:36:40,520 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:40,520 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled by expiration
2024-01-14 23:36:40,520 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/status/sessions
2024-01-14 23:36:40,528 ERROR[PlexTraktSync.EventDispatcher]:TypeError was raised: unhashable type: 'PlexLibraryItem'
2024-01-14 23:36:40,530 DEBUG[PlexTraktSync.EventDispatcher]:['  File "/app/plextraktsync/watch/EventDispatcher.py", line 37, in dispatch\n    listener["listener"](event)\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 156, in on_play\n    m = self.find_by_key(event.key)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 96, in find_by_key\n    m = self.mf_resolve(pm)\n        ^^^^^^^^^^^^^^^^^^^\n']
2024-01-14 23:36:46,036 DEBUG[plexapi]:Alert: type size PlaySessionStateNotification
2024-01-14 23:36:46,039 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'playing', 'size': 1, 'PlaySessionStateNotification': [{'sessionKey': '19', 'clientIdentifier': 'n5juzfq1fkhpd9smhnzw5n5e', 'guid': '', 'ratingKey': '21340', 'url': '', 'key': '/library/metadata/21340', 'viewOffset': 7000, 'playQueueItemID': 10180, 'playQueueID': 2509, 'state': 'stopped'}]}
2024-01-14 23:36:46,039 ERROR[PlexTraktSync.EventDispatcher]:TypeError was raised: unhashable type: 'PlexLibraryItem'
2024-01-14 23:36:46,044 DEBUG[PlexTraktSync.EventDispatcher]:['  File "/app/plextraktsync/watch/EventDispatcher.py", line 37, in dispatch\n    listener["listener"](event)\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 156, in on_play\n    m = self.find_by_key(event.key)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 96, in find_by_key\n    m = self.mf_resolve(pm)\n        ^^^^^^^^^^^^^^^^^^^\n']
2024-01-14 23:36:46,075 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:46,075 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'started', 'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'Activity': {'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': '', 'progress': 0}}]}
2024-01-14 23:36:46,077 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:46,077 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'Activity': {'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Checking files', 'progress': 0, 'Context': {'key': '/library/metadata/21340'}}}]}
2024-01-14 23:36:46,079 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:46,079 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'Activity': {'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing local metadata', 'progress': 33, 'Context': {'accessible': True, 'exists': True, 'key': '/library/metadata/21340'}}}]}
2024-01-14 23:36:46,080 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:46,080 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'Activity': {'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing media analysis', 'progress': 66, 'Context': {'accessible': True, 'exists': True, 'key': '/library/metadata/21340', 'refreshed': False}}}]}
2024-01-14 23:36:46,085 DEBUG[plexapi]:Alert: type size ActivityNotification
2024-01-14 23:36:46,088 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'ended', 'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'Activity': {'uuid': '7ebcd3a4-1a23-475d-a9fd-8eee4f25d110', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing media analysis', 'progress': 100, 'Context': {'accessible': True, 'analyzed': False, 'exists': True, 'key': '/library/metadata/21340', 'refreshed': False}}}]}
2024-01-14 23:36:46,089 DEBUG[plexapi]:GET https://<URL>:32400/library/metadata/21340
2024-01-14 23:36:46,093 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-01-14 23:36:46,096 DEBUG[requests_cache.policy.expiration]:URL https://<URL>:32400/library/metadata/21340 matched pattern "*/library/metadata/*": 3674576450094852
2024-01-14 23:36:46,097 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled by expiration
2024-01-14 23:36:46,098 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=3674576450094852, send_request=True, skip_read=True)
2024-01-14 23:36:46,105 DEBUG[urllib3.connectionpool]:https://<URL>:32400 "GET /library/metadata/21340 HTTP/1.1" 200 2287
2024-01-14 23:36:46,105 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-01-14 23:36:46,106 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled by expiration
2024-01-14 23:36:46,106 DEBUG[requests_cache.session]:Skipping cache write for URL: https://<URL>:32400/library/metadata/21340
2024-01-14 23:36:46,112 ERROR[PlexTraktSync.EventDispatcher]:TypeError was raised: unhashable type: 'PlexLibraryItem'
2024-01-14 23:36:46,115 DEBUG[PlexTraktSync.EventDispatcher]:['  File "/app/plextraktsync/watch/EventDispatcher.py", line 37, in dispatch\n    listener["listener"](event)\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 129, in on_activity\n    m = self.find_by_key(activity.key, reload=True)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', '  File "/app/plextraktsync/watch/WatchStateUpdater.py", line 96, in find_by_key\n    m = self.mf_resolve(pm)\n        ^^^^^^^^^^^^^^^^^^^\n']

Expected behavior

For it to behave like previous versions where it wasn't throwing said error.

Steps to reproduce the behavior

  1. Download or update to 0.28.7 and use the watch command (I'm sure it'll do the same in the sync command as well but haven't tested)
  2. browse to a movie or tv show episode
  3. look at the log and see that it's throwing TypeError was raised: unhashable type: 'PlexLibraryItem' 3.1 can try watching movie or tv episode and see that it's constantly throwing the same error, and when the movie or tv episode ends it does not scrobble to trakt at all.
  4. ???

Inspect of problematic items

No response

Workarounds

Downgraded back to version 0.28.6 and no longer see the error, so it's something that was introduced between 0.28.6 and 0.28.7 release.

Install method

docker-compose

Config file contents

cache:
  path: $PTS_CACHE_DIR/trakt_cache

excluded-libraries:
  - Private
  - Family Holidays

config:
  dotenv_override: true

plex:
  timeout: 30

logging:
  append: true
  # Whether to show timestamps in console messages
  console_time: false
  debug: false
  filename: plextraktsync.log
  # Additional logger names to apply filtering
  filter_loggers:
#    - plexapi
#    - requests_cache.backends
#    - requests_cache.backends.base
#    - requests_cache.backends.sqlite
#    - requests_cache.policy.actions
#    - requests_cache.session
#    - trakt.core
#    - urllib3.connectionpool
  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"
#    # Filter out messages by requests_cache
#    - name: requests_cache.backends
#    - name: requests_cache.backends.base
#    - name: requests_cache.backends.sqlite
#    - name: requests_cache.policy.actions
#    - name: requests_cache.session

# settings for 'sync' command (default)
sync:
  plex_to_trakt:
    collection: true
    # Clear collected state of items not present in Plex
    clear_collected: true
    ratings: true
    watched_status: false
    # If plex_to_trakt watchlist=false and trakt_to_plex watchlist=true
    # the Plex watchlist will be overwritten by Trakt watchlist
    watchlist: false
  trakt_to_plex:
    liked_lists: false
    # If two-way rating sync, Plex rating takes precedence over Trakt rating
    ratings: true
    watched_status: true
    # If trakt_to_plex watchlist=false and plex_to_trakt watchlist=true
    # the Trakt watchlist will be overwritten by Plex watchlist
    watchlist: false
    # If you prefer to fetch trakt watchlist as a playlist instead of
    # plex watchlist, toggle this to true (is read only if watchlist=true)
    watchlist_as_playlist: false

# settings for 'watch' command
watch:
  add_collection: true
  remove_collection: true
  # what video watched percentage (0 to 100) triggers the watched status
  scrobble_threshold: 99
  # true to scrobble only what's watched by you, false for all your PMS users
  username_filter: true
  # Show the progress bar of played media in terminal
  media_progressbar: true

xbmc-providers:
  movies: imdb
  shows: tvdb

##### Advanced settings below this line, don't edit unless you know what you're doing #####
#http_cache:
  # https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#url-patterns
  #
  # The value is seconds to cache,
  # Special values "0" means never cache, value "-1" means never expires.
  #
  # The value can be also suffixed with a time unit:
  # - 5m, 1h, 3d
  # See full documentation at:
  # - https://github.com/wroberts/pytimeparse#pytimeparse-time-expression-parser
  #
  # NOTE: If there is more than one match, the first match will be used in the order they are defined
#  policy:
#    "*.trakt.tv/users/me": 1d
#    "*.trakt.tv/users/likes/lists": 0

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

Version

0.28.7

Python Version

3.12.1

Plex Server Version

1.40.0.7775

Operating System and Version

Ubuntu 22.04


I turned debug to true to get my log, usually it's set to false.

glensc commented 6 months ago

I think you misidentified the version, there's nothing changed in the area of code that reports the error:

The commit that leads to this is 3536303dbc5fe4b93ee7b6a82c4ccecb73ff6d3b, i.e:

    @lru_cache(maxsize=2) # <-- this triggers the error
    def mf_resolve(self, pm: PlexLibraryItem):
        return self.mf.resolve_any(pm)

and it affects on watch command.

glensc commented 6 months ago

ok. seems those both together don't work, i.e the __eq__ and @lru_cache together give this error:

JourneyOver commented 6 months ago

Looks like #1744 fixed the issue as I updated to 0.28.8 now and the error seems to no longer appear and everything is back to working order ^^.