Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SonarrAPI.upd_manual_import using wrong HTTP method and data types #165

Open
2 tasks done
linuxdaemon opened this issue Oct 7, 2023 · 0 comments · May be fixed by #166
Open
2 tasks done

SonarrAPI.upd_manual_import using wrong HTTP method and data types #165

linuxdaemon opened this issue Oct 7, 2023 · 0 comments · May be fixed by #166
Labels
type/bug Something isn't working

Comments

@linuxdaemon
Copy link

linuxdaemon commented Oct 7, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behaviour

The SonarrAPI.upd_manual_import method should use POST, according to the docs, and it should accept and return JsonArray, not JsonObject. This currently throws a 405 Method Not Allowed.

Steps To Reproduce

  1. Spin up Sonarr container based on current latest (3.0.10.1567)
  2. Have a file you wish to import manually in to sonarr
  3. Use the get_manual_import and upd_manual_import methods to try and import the file

Expected behaviour

The method should use the POST HTTP method, so it will not error.

Pyarr Version

5.2.0

Python Version

3.10.12

Example Code

from pyarr import SonarrAPI

api = SonarrAPI('http://localhost:8989', 'MY-API-KEY')
data = api.get_manual_import('/media/my_folder')
api.upd_manual_import(data)

Relevant log output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/linuxdaemon/.cache/pypoetry/virtualenvs/indexer-Ucgmqaqj-py3.10/lib/python3.10/site-packages/pyarr/sonarr.py", line 751, in upd_manual_import
    return self._put("manualimport", self.ver_uri, data=data)
  File "/home/linuxdaemon/.cache/pypoetry/virtualenvs/indexer-Ucgmqaqj-py3.10/lib/python3.10/site-packages/pyarr/request_handler.py", line 160, in _put
    response = _process_response(res)
  File "/home/linuxdaemon/.cache/pypoetry/virtualenvs/indexer-Ucgmqaqj-py3.10/lib/python3.10/site-packages/pyarr/request_handler.py", line 246, in _process_response
    raise PyarrMethodNotAllowed(f"The endpoint {res.url} is not allowed")
pyarr.exceptions.PyarrMethodNotAllowed: The endpoint http://docker-vm:8989/api/v3/manualimport is not allowed

Code of Conduct

  • I agree to follow this project's Code of Conduct
@linuxdaemon linuxdaemon added the type/bug Something isn't working label Oct 7, 2023
@linuxdaemon linuxdaemon linked a pull request Oct 7, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant