mirror of
https://github.com/Radarr/Radarr
synced 2025-03-12 07:05:08 +00:00
Improve filter by using JQ
parent
2e6dbf2052
commit
221b79db9c
1 changed files with 8 additions and 1 deletions
|
@ -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`
|
||||
|
|
Loading…
Add table
Reference in a new issue