Hello,
so I am not sure if the AMC already use the Post-Process Script I set in Filebot like(Relocate Radarr, etc) if not, how do I ask it to use the script??
Thanks
AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
Re: AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
Yes, your --apply options apply for both simple -rename commands as well as -script commands internally call -rename in some fashion. If in doubt, I recommend doing a test run and reading the console output.
[DOCS] --apply post-processing features › Apply Post-Processing Features via the --apply option from Terminal
Re: AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
okk so I add --apply the.script.name.I.put.in.post-process?
I find out that the code I put in the Post-process are in a single file (using jlesage docker)
file -> prefs.properties -> net/filebot/ui/rename/scripts/1702741369={"@type"\:"Script","id"\:"1702741369","name"\:"Refresh Sonarr","code"\:"def host \= 'localhost'\\ndef port \= 8989\\ndef auth \= 'api_key'\\n \\ndef ids \= model.findAll{ it.type \=~ /Episode/ }.findResults{ it.tvdbId } as Set\\n\\nids.each{ id ->\\n\\tdef r \= curl \\"http\://${host}\:${port}/api/v3/series?tvdbId\=${id}\\", 'X-Api-Key'\: auth\\n\\tr.each{ s ->\\n\\t\\tcurl \\"http\://${host}\:${port}/api/v3/command\\", [name\: 'rescanSeries', seriesId\: s.id], 'X-Api-Key'\: auth\\n\\t}\\n}\\n"}
so in that case, I use --apply Refresh Sonarr ??
I find out that the code I put in the Post-process are in a single file (using jlesage docker)
file -> prefs.properties -> net/filebot/ui/rename/scripts/1702741369={"@type"\:"Script","id"\:"1702741369","name"\:"Refresh Sonarr","code"\:"def host \= 'localhost'\\ndef port \= 8989\\ndef auth \= 'api_key'\\n \\ndef ids \= model.findAll{ it.type \=~ /Episode/ }.findResults{ it.tvdbId } as Set\\n\\nids.each{ id ->\\n\\tdef r \= curl \\"http\://${host}\:${port}/api/v3/series?tvdbId\=${id}\\", 'X-Api-Key'\: auth\\n\\tr.each{ s ->\\n\\t\\tcurl \\"http\://${host}\:${port}/api/v3/command\\", [name\: 'rescanSeries', seriesId\: s.id], 'X-Api-Key'\: auth\\n\\t}\\n}\\n"}
so in that case, I use --apply Refresh Sonarr ??
Re: AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
Re: AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
ok so in short I have to put this code in a file?
and --apply path/filename.ext to use it so?
Groovy: Select all
{ source, target ->
def host = '127.0.0.1'
def port = 8989
def auth = 'YOUR_API_KEY'
def ids = model.findAll{ it.type =~ /Episode/ }.findResults{ it.tvdbId } as Set
ids.each{ id ->
def r = curl "http://${host}:${port}/api/v3/series?tvdbId=${id}", 'X-Api-Key': auth
r.each{ s ->
curl "http://${host}:${port}/api/v3/command", [name: 'rescanSeries', seriesId: s.id], 'X-Api-Key': auth
}
}Re: AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
Yep, that's how I would do it:
Shell: Select all
--apply "/path/to/Refresh-Sonarr.groovy"Re: AMC -> Is it possible to ask AMC to use a Post-Process script like in GUI?
alright thanks
Trying to create a post-Process script to as *arr to import the movies/shows
in that code
do you see something wrong before I test it? I am not sure about the target.dir.path if its the good one
Thanks in advance
Trying to create a post-Process script to as *arr to import the movies/shows
in that code
Groovy: Select all
{ source, target ->
def importPath = target.dir.path
// ---------- TV SHOWS → Sonarr ----------
if (model.any{ it.type =~ /Episode/ }) {
def host = '127.0.0.1'
def port = 8989
def auth = 'SONARR_API_KEY'
curl "http://${host}:${port}/api/v3/command",
[
name: 'DownloadedEpisodesScan',
path: importPath,
importMode: 'Move',
downloadClientId: 'FileBot'
],
'X-Api-Key': auth
}
// ---------- MOVIES → Radarr ----------
if (model.any{ it.type =~ /Movie/ }) {
def host = '127.0.0.1'
def port = 7878
def auth = 'RADARR_API_KEY'
curl "http://${host}:${port}/api/v3/command",
[
name: 'DownloadedMoviesScan',
path: importPath,
importMode: 'Move',
downloadClientId: 'FileBot'
],
'X-Api-Key': auth
}
}
Thanks in advance