Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. def host = '127.0.0.1'
  2. def port = 8310
  3. def auth = 'YOUR_API_KEY'
  4.  
  5.  
  6. def ids = model.findAll{ it.type =~ /Movie/ }.findResults{ it.tmdbId } as Set
  7.  
  8. ids.each{ id ->
  9.     def r = curl "http://${host}:${port}/api/v3/movie?tmdbId=${id}", 'X-Api-Key': auth
  10.     r.each{ m ->
  11.         curl "http://${host}:${port}/api/v3/command", [name: 'rescanMovie', movieId: m.id], 'X-Api-Key': auth
  12.     }
  13. }
  14.