RefreshSeries/RescanSeries command

I meant take out “–compressed” the option is not supported apparently in that curl binary you have

oh haha woops… okay well that worked, running command

curl -s http://localhost:8989/api/series -H “X-Api-Key: 6e7bff2e25e24317924907b16e6b7eee” | jq -rs ".[]| .[] | select(.title==“Ascension”) | .id "

Ended up producing “79” which is the ID for Ascension in my sonarr list.

now I just need to make the below actually rescan the series whenever it is initiated.

curl -s http://localhost:8989/api/series -H “X-Api-Key: 6e7bff2e25e24317924907b16e6b7eee” | jq -rs --arg seriesTitle %seriesName% “.[]| .[]| select(.title==$seriesTitle) | .id”

The answer is already in this thread, the payload was correct, just escape the double quotes

"{\"name\":\"rescanSeries\",\"seriesId\":110}"

Off to bed now…

Well I must be a total idiot then because I still can’t get it to do anything no matter where I put it at in the curl command…

and wouldn’t having it just refresh 110 only make it refresh that one and only show instead of having it grab the id and replacing that part…

maybe your running like 2-3-4 seperate curl commands, I dont even completely understand, this crap is just annoying… I don’t even know why the hell I use sonarr if all I’ve been doing for the past week now is jumping through hoops trying to get stuff to work so I dont have to use the lousy post processing of sonarr… -.-

EDIT: meh forget it, I’m done trying to figure this crap out… It’s annoyed me to the last bit of annoyance that I can handle, everything just sucks.

I also use filebot instead of the Sonarr feature to deal with my file (because I also download movies without Sonarr and I want those files also to me managed properly).

But I just disable CDH feature and everything works like a charm (Sonarr doesn’t download the same file twice even if it appears in the software as available only after the 12 hours delay). Something must prevent Sonarr from downloading a file twice even if not seen as available.

What more do you need ?

Of course you have to run several curl commands (two) to get to the refresh series folder.

For example Filebot should identify the name of the series, passing that series name in the form of a variable to the script to fetch sonarr information.

SeriesName -> SonarrAPI -> seriesID ##this should be one curl command

RescanSeries+seriesID ->SonarrAPI ##this would be another curl command

I am not a frequent user of windows, but just a quick look on how to define a variable with the command output in cmd is just insane.

for /f "delims=" %%a in ('command') do @set foobar=%%a

There might be another easy way probably in powershell, maybe an advanced windows user can enlighten

That’s is why I prefer bash
In your case i would do something like this.

#!/bin/bash

seriesID=$(curl -s http://10.10.10.11:8989/api/series -H 'X-Api-Key: 5215023779d84ad391719fc703bba5ba' --compressed | jq -rs --arg seriestitle $seriesName '.[]| .[] | select(.title == $seriestitle ) | .id')

curl -s  http://10.10.10.11:8989/api/command -H 'X-Api-Key: 5215023779d84ad391719fc703bba5ba' --data-binary '{ "name": "rescanSeries", "seriesId" : "'$seriesID'" }'

In here were are assuming seriesName is some sort of environment variable defined by filebot that can pass to the script. I have no idea if filebot can do that.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.