1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-02 06:07:19 +02:00

Improve filter by using JQ

Gonzalo Peci 2017-09-15 18:12:18 +02:00
parent 2e6dbf2052
commit 221b79db9c

@ -6,7 +6,11 @@ For those who need to remove a lot of movie entries from radarr after they have
This will create api.txt and enter the json response, where you can browse at your leisure. Use sed to whittle down the list:
`sed -i -e '/"id"/!d' api.txt`
`cat api.txt| jq '.[] | .id' > todelete.txt`
JQ Allows for filtering items based on their attributes:
`cat api.txt| jq '.[] | select(.monitored | not) | .id' > todelete.txt`
would add all movies there `monitored` is not TRUE.
The first indented column is the main id that radarr uses, the other indented id's are irrelevent:
`
@ -25,6 +29,9 @@ api.txt
So, id's 4, 68 and 93 are the id's required for the next step.
---
**From file list Example**
`for i in $(cat todelete.txt); do curl https://mothership.julesinabox.com/radarr/api/movie/$i -H 'X-Api-Key: xxxxxxxxx' -X DELETE -k; done
**Oneshot example**
`for i in 4 68 93; do curl https://example.com/radarr/api/movie/$i -X DELETE -H 'X-Api-Key: xxxxxxxxx' -k; done`