mza921 / Plex-Auto-Collections

Python 3 script to automatically update Plex collections based off a configuration file
309 stars 28 forks source link

Adds movies to collections, then crashes. #188

Open allarna opened 3 years ago

allarna commented 3 years ago

I've been using this script for a few weeks now and keep running into the same issue where the script will add the tags to movies using 'append' or 'sync' and will then crash immediately after. I'm running the current version on Win10 using the below config file. Knowing me, it's probably a user error, but I can't figure out where.

INPUT (config) >

collections:
  IMDB Top 250:
    trakt_list: https://trakt.tv/users/justin/lists/imdb-top-rated-movies
    sort_title: '2000'
    collection_mode: show_items
    collection_order: alpha
    summary: IMDB top 250 movies.
    sync_mode: sync

  Last Year:
    plex_search:
      year: [2020]
    sort_title: '3000'
    collection_mode: show_items
    collection_order: alpha
    summary: Movies released in the previous year.   
    sync_mode: append   

plex:
  library: Movies
  token: [redacted]
  url: http://192.168.1.100:32400
  library_type: movie
  cache: true
  cache_update_interval: 60  
trakt: [redacted // used sample config base with my creds]
tmdb: [redacted // used sample config base with my creds]

OUTPUT >

...
| Updating collection: IMDB Top 250...
| Sync Mode: sync
|
| Processing trakt_list: https://trakt.tv/users/justin/lists/imdb-top-rated-movies
| 250 Movies found on Trakt
| IMDB Top 250 Collection | + | MOVIE TITLES HERE...
| Processed 191 Movies
| 59 missing movies from Trakt List: https://trakt.tv/users/justin/lists/imdb-top-rated-movies
| IMDB Top 250 Collection | - | IMDB Top 250
Traceback (most recent call last):
  File "C:\Plex Plugins\Plex-Auto-Collections\app\plex_auto_collections.py", line 1035, in <module>
    update_from_config(config_path, plex, False)
  File "C:\Plex Plugins\Plex-Auto-Collections\app\plex_auto_collections.py", line 695, in update_from_config
    item.removeCollection(c)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\plexapi\base.py", line 460, in removeCollection
    self._edit_tags('collection', collections, remove=True)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\plexapi\base.py", line 444, in _edit_tags
    value = getattr(self, tag + 's')
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\plexapi\base.py", line 363, in __getattribute__
    value = super(PlexPartialObject, self).__getattribute__(attr)
AttributeError: 'Collections' object has no attribute 'collections'

C:\Plex Plugins\Plex-Auto-Collections\app>
omerher commented 3 years ago

Same thing happens to me, only when using 'sync'. I think it's an error with removing collections from movies, since the error only occurs when the script tries to remove collections.