Kometa-Team / ArrAPI

A lightweight Python library for Radarr and Sonarr API.
https://arrapi.kometa.wiki
MIT License
45 stars 7 forks source link

Type "anguageid" instead of languageid #15

Closed marc0janssen closed 1 year ago

marc0janssen commented 1 year ago

Version Number

1.4.0 and 1.4.1

Describe the Bug

When using arrapi 1.4.0 or 1.4.1 you get an error when adding a serie.

The stack trace tells you there is a typo in the api. "Anguageid" instead of "LanguageId"

Traceback (most recent call last): File "/app/sonarr_sync.py", line 230, in sonarrsync.run() File "/app/sonarr_sync.py", line 160, in run dest.add( File "/usr/lib/python3.10/site-packages/arrapi/objs/reload.py", line 619, in add self._load(self._raw.post_series(self._get_add_data(self._arr._validate_add_options( File "/usr/lib/python3.10/site-packages/arrapi/raws/sonarr.py", line 23, in post_series return self._post("series", json=json) File "/usr/lib/python3.10/site-packages/arrapi/raws/base.py", line 44, in _post return self._request("post", path, json=json, **kwargs) File "/usr/lib/python3.10/site-packages/arrapi/raws/base.py", line 89, in _request raise ArrException(f"({response.status_code} [{response.reason}]) {response_json}") arrapi.exceptions.ArrException: (400 [Bad Request]) {'message': 'BadRequest: Invalid request body. Unexpected character encountered while parsing value: [. Path \'languageProfileId\', line 1, position 1365. (Json snippet \'anguageProfileId": [<--error-->1], "seasonFolder": \')', 'content': 'Invalid request body. Unexpected character encountered while parsing value: [. Path \'languageProfileId\', line 1, position 1365. (Json snippet \'anguageProfileId": [<--error-->1], "seasonFolder": \')'}

Procuria commented 1 year ago

@marc0janssen Thanks for raising this issue. Ran into the same problem.

meisnate12 commented 1 year ago

this should already be fixed in 1.4.2

Procuria commented 1 year ago

@meisnate12 unfortunately the issue still persists. Just ran a test with 1.4.2 and still getting this error. As I don't speak Python and just being able to read it a bit I'm wondering how I could contribute to the troubleshooting. My best guess is, that something happens in the transformation to the JSON payload for the Sonarr request, which "cuts away" the L in LanguageID.

Is there any additional information I can provide?

2022-12-31_13h06_04
Procuria commented 1 year ago

@meisnate12 I'm honestly sorry for creating this fuzz. As you said, the error is resolved in nightly I had my CI/CD pipeline misconfigured - the nightly image was build but not deployed. 😞

Thank you for your awesome work and have a healthy start of the new orbit of the sun.

marc0janssen commented 1 year ago

Issue is fixed, indeed!

Thanks! And happy new year!