* temporary compatibility fix

This commit is contained in:
Reinhard Pointner 2014-04-15 17:55:34 +00:00
parent 12c5c6809c
commit 8945478a6b
3 changed files with 14 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package net.sourceforge.filebot.cli;
import groovy.lang.GroovyClassLoader;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.Map;
import java.util.ResourceBundle;
@ -37,6 +38,13 @@ public class ScriptShell {
// setup script context
engine.getContext().setBindings(bindings, ScriptContext.GLOBAL_SCOPE);
// import additional functions into the shell environment
// TODO remove
// engine.eval(new InputStreamReader(ExpressionFormat.class.getResourceAsStream("ExpressionFormat.lib.groovy")));
bindings.put("_shell", this);
bindings.put("_cli", new CmdlineOperations());
engine.eval(new InputStreamReader(ScriptShell.class.getResourceAsStream("ScriptShell.lib.groovy")));
}
public ScriptEngine createScriptEngine() {

View File

@ -248,7 +248,7 @@ def detectMovie(File file, strict = true, queryLookupService = TheMovieDB, hashL
return m
// 2. perfect filename match
m = MediaDetection.matchMovieName(file.listPath(4, true).findResults{ it.name ?: null }, true, 0)
m = MediaDetection.matchMovieName(file.listPath(4).reverse().findResults{ it.name ?: null }, true, 0)
if (m != null && m.size() > 0)
return m[0]

View File

@ -257,10 +257,14 @@ public class ExpressionFormatMethods {
return FileUtilities.listPath(self).get(0);
}
public static List<File> getPathList(File self) {
public static List<File> listPath(File self) {
return FileUtilities.listPath(self);
}
public static List<File> listPath(File self, int tailSize) {
return FileUtilities.listPath(FileUtilities.getRelativePathTail(self, tailSize));
}
public static File getRelativePathTail(File self, int tailSize) {
return FileUtilities.getRelativePathTail(self, tailSize);
}