fn:revert --action rename Not working?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
noze2000
Donor
Posts: 22
Joined: 08 Feb 2015, 20:08

fn:revert --action rename Not working?

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

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

Post 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
:idea: Please read the FAQ and How to Request Help.
noze2000
Donor
Posts: 22
Joined: 08 Feb 2015, 20:08

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

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

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

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply