Page 1 of 1
[AMC] Variable name assigned to a file after renaming?
Posted: 11 May 2016, 15:14
by Arion
Before renaming the file, we get the file name by the variable "ut_file" in the AMC Script.
I was wondering what variable is assigned to it after it is renamed. If there isn't, please guide me on how I could declare such a variable myself.
I've inspected the AMC script in the past few days looking for a way to change the manner in which my pushbullet notifications appear.
I want them to appear in the below manner:
"[Filebot] {n} - {s00e00} - {t} has finished downloading."
Re: [AMC] Variable name assigned to a file after renaming?
Posted: 11 May 2016, 16:33
by rednoah
The easiest way is probably to pass your own command-line hook:
Code: Select all
--def "exec=echo '{n} - {s00e00} - {t}'"
If this works, then you just need a command-line tool for sending pushbullet notifications.
Re: [AMC] Variable name assigned to a file after renaming?
Posted: 11 May 2016, 17:10
by Arion
I tried replacing "ut_title" in the below line in the AMC Script with "exec" after adding the exec command you gave above to the CLI
Code: Select all
def getNotificationMessage = { prefix = '• ', postfix = '\n' -> tryQuietly{ exec } ?: (input.any{ !it.isSubtitle() } ? input.findAll{ !it.isSubtitle() } : input).collect{ relativeInputPath(it) as File }*.getRoot()*.getNameWithoutExtension().unique().sort{ it.toLowerCase() }.collect{ prefix + it }.join(postfix).trim() }.memoize()
And it just sent me this as the file title= '{n} - {s00e00} - {t}'
This my the CLI input:
Code: Select all
filebot -script amc.groovy --output "E:/" --action move --conflict skip -non-strict "E:/New" --log-file amc.log --def unsorted=y clean=y subtitles=en --def "seriesFormat=/TV Shows/{n}/{'Season '+s}/{s00e00} - {t }" --def excludeList=amc.txt --def pushbullet=apikey --def "exec=echo '{n} - {s00e00} - {t}'"
P.S: Removed my pushbullet API Key in the above line for security.
Re: [AMC] Variable name assigned to a file after renaming?
Posted: 11 May 2016, 17:28
by rednoah
OK... here's what I've been trying to tell you:
1.
You're on the wrong path. You'll never manage to modifying the pushbullet feature to do what you want without me giving you significant help, me doing it for you basically. Donate 50 EUR and I'm good to go.
2.
The exec feature allows you to call your own programs, and the exec template works just the same as filebot formats. You just need to figure out how to send pushbullet notifications from the command-line, and then the rest will be easy peasy. You won't need to modify the script neither. This is the easy solution you should be going for.

Re: [AMC] Variable name assigned to a file after renaming?
Posted: 11 May 2016, 17:49
by Arion
Thanks for your help! I don't have the money so I can't donate and get this done,unfortunately. But, I'm grateful for all the help you provide on this forum and the program you've built. I'll focus on your second point. I'm reading about using curl to send pushes to pushbullet right now.
If I figure this out, I'll reply with the solution in this thread. Thanks!
Re: [AMC] Variable name assigned to a file after renaming?
Posted: 11 May 2016, 19:58
by Arion
Hey! I figured it out!
I used an unofficial CLI tool built by dendory [
https://github.com/dendory/pushbullet_cli]. I added the pushbullet.exe to my System32 folder.
Then I added this hook to my AMC cmdline arguments:
Code: Select all
--def "exec=pushbullet -apikey \"apikey\" -title \"[Filebot] {n} - {s00e00} DONE! \" -message \"{n} has been downloaded\""