[AMC] Variable name assigned to a file after renaming?

Any questions? Need some help?
Post Reply
Arion
Posts: 25
Joined: 29 Apr 2016, 03:47

[AMC] Variable name assigned to a file after renaming?

Post 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."
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [AMC] Variable name assigned to a file after renaming?

Post 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.
:idea: Please read the FAQ and How to Request Help.
Arion
Posts: 25
Joined: 29 Apr 2016, 03:47

Re: [AMC] Variable name assigned to a file after renaming?

Post 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.
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [AMC] Variable name assigned to a file after renaming?

Post 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. ;)
:idea: Please read the FAQ and How to Request Help.
Arion
Posts: 25
Joined: 29 Apr 2016, 03:47

Re: [AMC] Variable name assigned to a file after renaming?

Post 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!
Arion
Posts: 25
Joined: 29 Apr 2016, 03:47

Re: [AMC] Variable name assigned to a file after renaming?

Post 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\""
Post Reply