blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.67k stars 307 forks source link

AttributeError: 'str' object has no attribute 'key' #307

Closed torres3490 closed 2 years ago

torres3490 commented 3 years ago

receiving this error after running _python playlistmanager.py --action share --users "ESPANOL" --playlists "Caliente" pause"

Traceback (most recent call last): File "playlist.py", line 848, in share_playlists(selected_playlists, users) File "playlist.py", line 538, in share_playlists plex.playlist(title).copyToUser(user) File "C:\Users\torre\AppData\Local\Programs\Python\Python37\lib\site-packages\plexapi\server.py", line 481, in playlist return self.fetchItem('/playlists', title=title) File "C:\Users\torre\AppData\Local\Programs\Python\Python37\lib\site-packages\plexapi\base.py", line 156, in fetchItem if self._checkAttrs(elem, **kwargs): File "C:\Users\torre\AppData\Local\Programs\Python\Python37\lib\site-packages\plexapi\base.py", line 339, in _checkAttrs if operator(value, query): File "C:\Users\torre\AppData\Local\Programs\Python\Python37\lib\site-packages\plexapi\base.py", line 13, in 'exact': lambda v, q: v == q, File "C:\Users\torre\AppData\Local\Programs\Python\Python37\lib\site-packages\plexapi\base.py", line 418, in eq return other not in [None, []] and self.key == other.key AttributeError: 'str' object has no attribute 'key'

blacktwin commented 3 years ago

This might need to be defined before using the action

Change line 538

plex.playlist(title).copyToUser(user)

to

playlist = plex.playlist(title)
playlist.copyToUser(user)