* temporary compatibility fix
This commit is contained in:
parent
12c5c6809c
commit
8945478a6b
|
@ -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() {
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue