* make sure to print out the TMDb invalid data error messages

This commit is contained in:
Reinhard Pointner 2013-10-14 03:31:24 +00:00
parent 2c91a3be2e
commit 4ef6b02903
3 changed files with 38 additions and 51 deletions

View File

@ -159,7 +159,7 @@ def anidb = new net.sourceforge.filebot.web.AnidbClient(null, 0).getAnimeTitles(
def anidb_index = anidb.findResults{
def row = []
row += it.getAnimeId().pad(5)
row += it.names*.replaceAll(/\s+/, ' ')*.replaceAll(/['`´ʻ]+/, /'/)*.trim().unique()
row += it.effectiveNames*.replaceAll(/\s+/, ' ')*.replaceAll(/['`´ʻ]+/, /'/)*.trim().unique()
return row
}

View File

@ -1,7 +1,5 @@
package net.sourceforge.filebot.cli;
import static net.sourceforge.filebot.Settings.*;
import static net.sourceforge.filebot.cli.CLILogging.*;
import static net.sourceforge.tuned.ExceptionUtilities.*;
@ -36,14 +34,12 @@ import net.sourceforge.filebot.web.CachedResource;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
public class ArgumentProcessor {
public void printHelp(ArgumentBean argumentBean) {
new CmdLineParser(argumentBean).printUsage(System.out);
}
public ArgumentBean parse(String[] args) throws CmdLineException {
ArgumentBean bean = new ArgumentBean();
CmdLineParser parser = new CmdLineParser(bean);
@ -51,7 +47,6 @@ public class ArgumentProcessor {
return bean;
}
public int process(ArgumentBean args, CmdlineInterface cli) {
Analytics.trackView(ArgumentProcessor.class, "FileBot CLI");
CLILogger.setLevel(args.getLogLevel());
@ -126,7 +121,6 @@ public class ArgumentProcessor {
}
}
Analytics.trackEvent("CLI", "ExecuteScript", script.getScheme());
ScriptShell shell = new ScriptShell(cli, args, AccessController.getContext(), scriptProvider);
shell.runScript(script, bindings);
}
@ -140,24 +134,20 @@ public class ArgumentProcessor {
}
}
public static class DefaultScriptProvider implements ScriptProvider {
private final boolean trustRemoteScript;
private URI baseScheme;
public DefaultScriptProvider(boolean trustRemoteScript) {
this.trustRemoteScript = trustRemoteScript;
}
public void setBaseScheme(URI baseScheme) {
this.baseScheme = baseScheme;
}
public String getResourceTemplate(String scheme) {
try {
return getApplicationProperty("script." + scheme);
@ -166,12 +156,10 @@ public class ArgumentProcessor {
}
}
public boolean isInlineScheme(String scheme) {
return "g".equals(scheme) || "system".equals(scheme);
}
@Override
public URI getScriptLocation(String input) {
try {
@ -212,7 +200,6 @@ public class ArgumentProcessor {
}
}
@Override
public Script fetchScript(URI uri) throws IOException {
if (uri.getScheme().equals("file")) {

View File

@ -85,11 +85,11 @@ public class TMDbClient implements MovieIdentificationService {
String release = (String) it.get("release_date");
year = new Scanner(release).useDelimiter("\\D+").nextInt();
} catch (Exception e) {
throw new IllegalArgumentException("Missing data: year");
throw new IllegalArgumentException("Missing data: release date");
}
result.add(new Movie(title, title.equals(originalTitle) ? new String[] {} : new String[] { originalTitle }, year, -1, (int) id));
} catch (Exception e) {
Logger.getLogger(TMDbClient.class.getName()).log(Level.FINE, String.format("Ignore movie [%s]: %s", title, e.getMessage()));
Logger.getLogger(TMDbClient.class.getName()).log(Level.WARNING, String.format("Ignore movie [%s]: %s", title, e.getMessage()));
}
}
return result;