python-plexapi icon indicating copy to clipboard operation
python-plexapi copied to clipboard

Bad Request response when adding library with default language

Open florez-carlos opened this issue 1 year ago • 0 comments

Describe the Bug

When adding a library, the following error response is received:

plexapi.exceptions.BadRequest: (400) bad_request; 'language' is invalid

Default language in method is set to 'en', documentation also uses 'en' as example

The error does not occur however if the language supplied is 'en-US'

Code Snippets

plex = PlexServer("url", "token")
plex.library.add(name='Test', type='movie',agent="tv.plex.agents.movie",scanner="Plex Movie", location="some\\location")

Expected Behavior

Add a a new library

Additional Context

API expects country code in language attribute when adding a library such as 'en-US', however method library.add() attribute default for language is 'en'

Operating System and Version

Windows 11

Plex Media Server Version

1.32.8.7639

Python Version

3.11.6

PlexAPI Version

4.15.7

florez-carlos avatar Jan 25 '24 03:01 florez-carlos