Sonarr version (exact version): 2.0.0.4323 Mono version (if Sonarr is not running on Windows): OS: Windows 10.0.14393 x64 ((Debug logs)): sonarr.debug.txt Description of issue:
Hello,
since the last update, calling the api/episode with method PUT (to update an episode monitored status from True to False) returns the error 500 and the logs returns this :
Request Failed: Error converting value “@{id=4; name=HDTV-720p}” to type ‘NzbDrone.Core.Qualities.Quality’. Path ‘episodeFile.quality.quality’, line 18, position 78.
The script is in powershell using Invoke-RestMethod, the body is the episode informations retrieved with method Get on api/episode (with just the modification on monitored) in json format
The problem is likely in your powershell code, incorrectly serializing json. But you need to show us the actual HTTP call, both the GET/{id} and PUT.
Fiddler would be perfect for that, the inspector shows the http call including headers and contents.
If you already have the list of episodes you don’t need to get the single episode to post it back to the server, if you need the episode file you can fetch the episode file using the episodeFileId on the episode.
Ok, sorry my question was how to PUT episodefile as there is no documentation and this morning I was not awake, so I can now put episodeFIle but the field I want to update (monitored) is not in the episodefile.
Is it possible to update only one field instead of the whole episode ?
You don’t PUT an episodeFile to update the monitored status of the episode. That is why I said if you need the episode file, you can get it with the episodeFileId, if you’re trying to update the monitored status for the episode don’t even bother fetching the episode file, you don’t need it.
You’d get the list of episodes, pull the one you want to update out of the list of them and then PUT that to the server after changing the monitored status.
I did some test :
I tried with an old version 2.0.0.3732 and it works…
So, I re-tried with the last one and here are my results :
When the episode contains an episodeFile (aka when I have the episode on my HDD), it fails (see file PUT_episode KO.saz)
When the episode does not contains an episodeFile it works
So, I tried by setting episodeFile of my object episode (retrieved with GET/{id}, see file GET_id.saz) to “” and it works (see file PUT_episode OK.saz)
The episode object is convertged to json with the native powershell command ConvertTo-Json