diff --git a/source/net/sourceforge/filebot/StandardRenameAction.java b/source/net/sourceforge/filebot/StandardRenameAction.java index 3b2524e2..b5e8772a 100644 --- a/source/net/sourceforge/filebot/StandardRenameAction.java +++ b/source/net/sourceforge/filebot/StandardRenameAction.java @@ -78,6 +78,20 @@ public enum StandardRenameAction implements RenameAction { } }, + RENAME { + + @Override + public File rename(File from, File to) throws IOException { + // rename only the filename + File dest = new File(from.getParentFile(), to.getName()); + + if (!from.renameTo(dest)) + throw new IOException("Rename failed: " + dest); + + return dest; + } + }, + TEST { @Override diff --git a/website/data/query-blacklist.txt b/website/data/query-blacklist.txt index 6738d7e7..fde10218 100644 --- a/website/data/query-blacklist.txt +++ b/website/data/query-blacklist.txt @@ -29,6 +29,7 @@ ^Downloads$ ^DVD ^Erotic$ +^Extract$ ^Film[s]? ^Finished ^Horror$ @@ -72,8 +73,8 @@ Demonoid Director's.Cut Directors.Cut Discovery.Channel -DLLValley.eu DLLValley +DLLValley.eu docu Dual.Audio dubbed diff --git a/website/scripts/revert.groovy b/website/scripts/revert.groovy new file mode 100644 index 00000000..a489175b --- /dev/null +++ b/website/scripts/revert.groovy @@ -0,0 +1,19 @@ +// filebot -script fn:revert + + +def accept(from, to) { + args.find{ to.absolutePath.startsWith(it.absolutePath) } && to.exists() +} + +def revert(from, to) { + def action = net.sourceforge.filebot.StandardRenameAction.forName(_args.action) + + println "[$action] Revert [$from] to [$to]" + action.rename(from, to) +} + + +getRenameLog(true).reverseEach { from, to -> + if (accept(from, to)) + revert(to, from) +}