Advertisement
filebot

refresh-sonarr.groovy

Jun 16th, 2023 (edited)
2,439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.38 KB | Source Code | 0 0
  1. def host = '127.0.0.1'
  2. def port = 8989
  3. def auth = 'YOUR_API_KEY'
  4.  
  5.  
  6. def ids = model.findAll{ it.type =~ /Episode/ }.findResults{ it.tvdbId } as Set
  7.  
  8. ids.each{ id ->
  9.     def r = curl "http://${host}:${port}/api/v3/series?tvdbId=${id}", 'X-Api-Key': auth
  10.     r.each{ s ->
  11.         curl "http://${host}:${port}/api/v3/command", [name: 'rescanSeries', seriesId: s.id], 'X-Api-Key': auth
  12.     }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement