vche / pycliarr

Python client for radarr and sonarr apis. The package provides python client and CLI to use in command line.
MIT License
13 stars 1 forks source link

Request: method to update/edit movie/serie #28

Closed marc0janssen closed 2 years ago

marc0janssen commented 2 years ago

Hi Vivien,

I would love to have a method for a movie and a serie to update/edit the existing datA in radarr/sonarr.

I need this to update tags in for a movie/serie.

Any help would be appreciated

Regards, Marco

vche commented 2 years ago

the api to edit an item is indeed missing, i will add it when i get time to work on pycliarr again.

i'm not sure which date you're referring to, e.g. it may not be possible to the date added as it is generated by sonarr/radarr. but all editable field will be editable.

you will be able to get the movie/serie, edit the returned item, and call the new update_movie/serie with the edited item to save it.

marc0janssen commented 2 years ago

SOrry was typo. I meant DATA instead of datE.

you will be able to get the movie/serie, edit the returned item, and call the new update_movie/serie with the edited item to save it.

That is exactly what I need!!

Thanks!!

vche commented 2 years ago

Fixed in v1.0.19 Note that some fields are not editable (like informations from scappers, those are not updated by sonarr/radarr).

From python:

from pycliarr.api import SonarrCli
sonarr_cli = SonarrCli('http://192.168.0.199:8989', '2ac2d0f66752xda3b41845e81dba5a84')

movie_info=sonarr_cli.get_serie(101)
movie_info.qualityProfileId = 3

updates_movie_info=sonarr_cli.edit_serie(movie_info)

From shell:

pycliarr -t "http://192.168.0.199:8989" -k "2ac2d0f66752xda3b41845e81dba5a84" sonarr get -i 101 -j >info.json
vim info.json # edit info
pycliarr -t "http://192.168.0.199:8989" -k "2ac2d0f66752xda3b41845e81dba5a84" sonarr edit -f info.json