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

Since 0.25.11, EventFactory errors prevent watch command to properly function

dotneB 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

Started noticing shows not syncing on trakt.tv. Watching the logs I saw that Watchtower had updated my :latest version to 0.25.12 and started to see a bug of errors related to the new EventFactory missing attributes. Tested with 0.25.11 seeing the same errors. Downgraded to 0.25.10, no errors and shows are synced properly

Error trace / logs

docker run -v /volume1/docker/plextraktsync/config:/app/config --name plextraktsync_test_0.25.11 -e PUID=redacted -e PGID=redacted -e TZ=redacted ghcr.io/taxel/plextraktsync:0.25.11  watch
INFO     Listening for events!
INFO     Starting AlertListener:
         wss://redacted.plex.direct:32400/:
         /websockets/notifications?X-Plex-Token=<hidden>
WARNING  websocket connected
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'PlaySessionStateNotification'
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'PlaySessionStateNotification'
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'ActivityNotification'
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'ActivityNotification'
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'ActivityNotification'
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'ActivityNotification'
ERROR    AlertListener Msg Error: module 'plextraktsync.watch.EventFactory' has
         no attribute 'ActivityNotification'

-----

docker run -v /volume1/docker/plextraktsync/config:/app/config --name plextraktsync_test_0.25.10 -e PUID=redacted -e PGID=redacted -e TZ=redacted ghcr.io/taxel/plextraktsync:0.25.10  watch
INFO     Listening for events!
INFO     Starting AlertListener:
         wss://redacted.plex.direct:32400/:
         /websockets/notifications?X-Plex-Token=<hidden>
WARNING  websocket connected
INFO     on_play: <Episode:redacted>: 0.000000%, State:
         playing, Watched: True, LastViewed: 2023-01-20 17:05:33
INFO     on_play: <Episode:redacted>: 0.662653%, State:
         playing, Watched: True, LastViewed: 2023-01-20 17:05:33
INFO     on_play: <Episode:redacted>: 97.778197%, State:
         playing, Watched: True, LastViewed: 2023-01-20 17:05:33
INFO     on_play: <Episode:redacted>: 97.999081%, State:
         stopped, Watched: True, LastViewed: 2023-01-20 17:05:33
INFO     on_activity: <tmdb:redacted>:
         Collected: False, Watched: [Plex: True, Trakt: True]
INFO     on_play: <Episode:redacted>: 0.000000%, State:
         playing, Watched: False, LastViewed: None
INFO     on_play: <Episode:redacted>: 0.341919%, State:
         stopped, Watched: False, LastViewed: None
INFO     on_activity: <tmdb:redacted>:
         Collected: False, Watched: [Plex: True, Trakt: True]

Expected behavior

Watch command to behave as in 0.25.10

Steps to reproduce the behavior

  1. Docker run watch on version 0.25.11, or 0.25.12
  2. Start watching an episode in plex
  3. Notice errors in console/logs
  4. Also notice nothing marked as watched on trakt.tv

Inspect of problematic items

No response

Workarounds

Downgrading to 0.25.10 works

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
  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"

# settings for 'sync' command (default)
sync:
  plex_to_trakt:
    collection: true
    ratings: true
    watched_status: true
    # If plex_to_trakt watchlist=false and trakt_to_plex watchlist=true
    # the Plex watchlist will be overwritten by Trakt watchlist
    watchlist: true
  trakt_to_plex:
    liked_lists: true
    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: true
    # 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: false
  remove_collection: false
  # what video watched percentage (0 to 100) triggers the watched status
  scrobble_threshold: 80
  # true to scrobble only what's watched by you, false for all your PMS users
  username_filter: true

xbmc-providers:
  movies: imdb
  shows: tvdb
##### Advanced settings below this line, don't edit unless you know what you're doing #####
#http_cache:
# Value "0" means never cache, value "-1" means never expires
# anything else means how long to cache
#
# https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#url-patterns
#
# 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": 1 day
#    "*.trakt.tv/users/likes/lists": 0

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

Version

0.25.12

Python Version

3.11.1

Operating System and Version

Synology DSM 7.1.1

commented

Seems to be related to changes made in #1378 @glensc ?

Running into the same errors and issues on both 0.25.11 and 0.25.12.. Downgrading to version 0.25.10 works for me as well.

This is the full log starting from when plextraktsync updated to version 0.25.11 and up to the event of me downgrading back to 0.25.10 just recently

https://ghostbin.me/63cbb9b1b0896

The error on the walker episode

2023-01-21 03:54:38,953 INFO[PlexTraktSync.WatchStateUpdater]:on_delete: Deleted on Plex: 20094: Walker (2021)
2023-01-21 03:54:39,046 ERROR[PlexTraktSync.EventDispatcher]:AttributeError was raised: 'NoneType' object has no attribute 'library'
2023-01-21 03:54:39,049 INFO[PlexTraktSync.WatchStateUpdater]:on_delete: Deleted on Plex: 20095: Walker S03
2023-01-21 03:54:39,057 ERROR[PlexTraktSync.EventDispatcher]:AttributeError was raised: 'NoneType' object has no attribute 'library'
2023-01-21 03:54:39,059 INFO[PlexTraktSync.WatchStateUpdater]:on_delete: Deleted on Plex: 20096: Walker S03 E09
2023-01-21 03:54:39,067 ERROR[PlexTraktSync.EventDispatcher]:AttributeError was raised: 'NoneType' object has no attribute 'library'

happened after I had downgraded back to 0.25.10, not sure what to make of it other than it did not clear the collection on trakt at all for the episode after I had deleted it from plex.

here is my config

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: true
    # 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
    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 seems to be broken for `watch` command as it has never added anything ever to my collection and I have to use the `sync` command to actually add anything to my collection, keeping it true for now in the event that it ever gets updated to actually work.
  add_collection: true
  remove_collection: true
  # what video watched percentage (0 to 100) triggers the watched status
  scrobble_threshold: 95
  # 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

Facing this issue as well as of the latest Docker update.