Page 1 of 1

fn:revert --action rename Not working?

Posted: 05 Jul 2017, 19:40
by noze2000
Hi,

I wanted to rename my files back to what they were called earlier ( in a particular directory).

I use this:

Code: Select all

filebot -script fn:revert --action rename /mnt/Disk2/
But this gives me

Code: Select all

/mnt/Disk2$ filebot -script fn:revert --action rename /mnt/Disk2
rename not in [MOVE, COPY, KEEPLINK, SYMLINK, HARDLINK, DUPLICATE, REFLINK, TEST]
java.lang.IllegalArgumentException: rename not in [MOVE, COPY, KEEPLINK, SYMLINK, HARDLINK, DUPLICATE, REFLINK, TEST]
	at net.filebot.StandardRenameAction.forName(StandardRenameAction.java:180)
	at net.filebot.StandardRenameAction$forName.call(Unknown Source)
	at Script1.revert(Script1.groovy:9)
	at Script1$_run_closure1.doCall(Script1.groovy:23)
	at Script1.run(Script1.groovy:21)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:64)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:74)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:119)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
	at net.filebot.Main.main(Main.java:115)

Failure (°_°)


Failure (°_°)
Was --action rename removed?
Btw, "-- action test" works fine

Thanks for your help!

Re: fn:revert --action rename Not working?

Posted: 06 Jul 2017, 04:55
by rednoah
1.
--action rename was never officially supported or documented and has been removed some time ago.


2.
The revert script is deprecated in favour of the new filebot -revert command. But there's a few subtle differences so the revert script will stick around for a bit longer.


3.
I'd use --db xattr to process previously renamed files, and use {original} as format expression to restore the original name:

Code: Select all

filebot -rename . --db xattr --format "{original}"
@see viewtopic.php?f=4&t=4788

Re: fn:revert --action rename Not working?

Posted: 12 Jul 2017, 12:11
by noze2000
Ah. Makes sense.

UPDATE: Seems that 2. does the trick.

Thanks!

--------------------------------------------------

Just for clarity:

What I did accidentlially changed the filename of a lot of files to something that is NOT related to the movie, (but still in the right folders). What I need is keep same path but revert filename to the scene name so that I can rename it the right way using AMC script
For this, would I use:
1. --format "/current/path/{original}", or
2. --format "{original}", or
3. --format "/new/path/{original}" and then move back to the place I prefer?


Thanks!

Re: fn:revert --action rename Not working?

Posted: 12 Jul 2017, 15:33
by rednoah
The CLI will resolve relative paths against the --output folder which is $PWD by default. If you just use {original} then you'll probably be moving files to your current working directory with the original filename.

If you want files to go to specific folder, then you just need to make sure that your format evaluates to an absolute file path.