blacktwin / JBOPS

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

[Issue] Playlist creation with playlist manager script #299

Closed irodimus closed 3 years ago

irodimus commented 3 years ago

Describe the bug

Attempting to add or update a random playlist with filter errors with Bad Request. Using playlistmanager script https://github.com/blacktwin/JBOPS/commit/69fd40e25a835605c8e7de6bc8a88c58c2abdc82

Provide logs

Traceback (most recent call last):
  File "/Applications/Plex Scripts/Scripts/playlist_manager.py", line 906, in <module>
    create_playlist(title, keys_list, data['server'], data['user'])
  File "/Applications/Plex Scripts/Scripts/playlist_manager.py", line 601, in create_playlist
    server.createPlaylist(playlist_title, playlist_list)
  File "/usr/local/lib/python3.9/site-packages/plexapi/server.py", line 477, in createPlaylist
    return Playlist.create(
  File "/usr/local/lib/python3.9/site-packages/plexapi/playlist.py", line 384, in create
    return cls._create(server, title, items)
  File "/usr/local/lib/python3.9/site-packages/plexapi/playlist.py", line 309, in _create
    raise BadRequest('Must include items to add when creating new playlist.')
plexapi.exceptions.BadRequest: Must include items to add when creating new playlist.

To Reproduce

Steps to reproduce the behavior:

Tested with this:

python3 playlist_manager.py --jbop random --action update --name "01 Science Fiction" --libraries Movies --limit 50 --filter genre=sci-fi

Expected behavior

A playlist to be created with specified filters

Desktop (please complete the following information):

blacktwin commented 3 years ago

Update the script.

irodimus commented 3 years ago

Works great after updating, thank you!