+ final adjustments for 2.4

* support "A | B | C" syntax for series mode --q option
* fine-tuning for series auto-selection
* don't create desktop shortcut when running via JNLP
This commit is contained in:
Reinhard Pointner 2012-06-24 05:43:09 +00:00
parent a5284ccb40
commit 36bcd880db
8 changed files with 25 additions and 22 deletions

View File

@ -12,10 +12,6 @@
<icon href="shortcut.ico" kind="shortcut" />
<icon href="splash.png" kind="splash" />
<shortcut online="true">
<desktop />
</shortcut>
<offline-allowed />
</information>

View File

@ -50,7 +50,7 @@ public class ArgumentBean {
@Option(name = "-get-missing-subtitles", usage = "Fetch missing subtitles", metaVar = "fileset")
public boolean getMissingSubtitles;
@Option(name = "--q", usage = "Search query", metaVar = "title")
@Option(name = "--q", usage = "Force lookup query", metaVar = "series/movie title")
public String query;
@Option(name = "--lang", usage = "Language", metaVar = "2-letter language code")
@ -59,7 +59,7 @@ public class ArgumentBean {
@Option(name = "-check", usage = "Create/Check verification file", metaVar = "fileset")
public boolean check;
@Option(name = "--output", usage = "Output path / format", metaVar = "Output options")
@Option(name = "--output", usage = "Output path / format", metaVar = "folder/file/format")
public String output;
@Option(name = "--encoding", usage = "Output character encoding", metaVar = "[UTF-8, windows-1252, GB18030, etc]")
@ -74,7 +74,7 @@ public class ArgumentBean {
@Option(name = "-extract", usage = "Extract archives")
public boolean extract = false;
@Option(name = "-script", usage = "Run Groovy script", metaVar = "robot.groovy")
@Option(name = "-script", usage = "Run Groovy script", metaVar = "path/to/script.groovy")
public String script = null;
@Option(name = "-trust-script", usage = "Lift scripting restrictions")

View File

@ -3,6 +3,7 @@ package net.sourceforge.filebot.cli;
import static java.lang.String.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static net.sourceforge.filebot.MediaTypes.*;
import static net.sourceforge.filebot.WebServices.*;
@ -34,6 +35,7 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@ -162,7 +164,7 @@ public class CmdlineOperations implements CmdlineInterface {
for (List<File> batch : batchSets) {
// auto-detect series name if not given
Collection<String> seriesNames = (query == null) ? detectSeriesQuery(batch, locale) : singleton(query);
Collection<String> seriesNames = (query == null) ? detectSeriesQuery(batch, locale) : asList(query.split("[|]"));
if (strict && seriesNames.size() > 1) {
throw new Exception("Handling multiple shows requires non-strict matching");
@ -279,8 +281,8 @@ public class CmdlineOperations implements CmdlineInterface {
for (Future<List<Episode>> future : executor.invokeAll(tasks)) {
try {
episodes.addAll(future.get());
} catch (Exception e) {
CLILogger.finest(e.getMessage());
} catch (ExecutionException e) {
CLILogger.finest(e.getCause().getMessage());
}
}
@ -752,7 +754,7 @@ public class CmdlineOperations implements CmdlineInterface {
// find probable matches using name similarity > 0.9 (or > 0.8 in non-strict mode)
for (SearchResult result : searchResults) {
float f = (query == null) ? 1 : metric.getSimilarity(query, result.getName());
if (f >= (strict ? 0.9 : 0.8) || (f >= 0.6 && result.getName().toLowerCase().startsWith(query.toLowerCase()))) {
if (f >= (strict ? 0.9 : 0.8) || (f >= 0.5 && result.getName().toLowerCase().startsWith(query.toLowerCase()))) {
if (!probableMatches.containsKey(result.toString().toLowerCase())) {
probableMatches.put(result.toString().toLowerCase(), result);
}

View File

@ -326,7 +326,7 @@ public class MediaDetection {
// assume name without spacing will mess up any lookup
if (movieNameMatches.isEmpty()) {
movieNameMatches = matchMovieFromStringWithoutSpacing(terms, new NameSimilarityMetric(), strict ? 0.9f : 0.6f);
movieNameMatches = matchMovieFromStringWithoutSpacing(terms, new NameSimilarityMetric(), strict ? 0.9f : 0.5f);
}
// query by file / folder name

View File

@ -4,7 +4,7 @@ pattern.video.source: CAMRip|CAM|PDVD|TS|TELESYNC|PDVD|PPV|PPVRip|Screener|SCR|S
# additional release info patterns
pattern.video.format: DivX|Xvid|AVC|x264|h264|3ivx|mpeg|mpeg4|mp3|aac|ac3|2ch|6ch|WS|HR|720p|1080p|NTSC
# group names mostly copied from [http://scenelingo.wordpress.com/list-of-scene-release-groups]
# known release group names
url.release-groups: http://filebot.sourceforge.net/data/release-groups.txt
# blacklisted terms that will be ignored
@ -12,6 +12,8 @@ url.query-blacklist: http://filebot.sourceforge.net/data/query-blacklist.txt
# list of all movies (id, name, year)
url.movie-list: http://filebot.sourceforge.net/data/movies.txt.gz
# list of tv show and anime names
url.series-list: http://filebot.sourceforge.net/data/series.list.gz
# disk folder matcher

View File

@ -19,7 +19,7 @@ public class ExpressionFormatTest {
public void compile() throws Exception {
ExpressionFormat format = new TestScriptFormat("");
Object[] expression = format.compile("name: {name}, number: {number}", (Compilable) format.initScriptEngine());
Object[] expression = format.compile("name: {name}, number: {number}", (Compilable) ExpressionFormat.getGroovyScriptEngine());
assertTrue(expression[0] instanceof String);
assertTrue(expression[1] instanceof CompiledScript);
@ -27,7 +27,7 @@ public class ExpressionFormatTest {
assertTrue(expression[3] instanceof CompiledScript);
}
@Test
public void format() throws Exception {
assertEquals("X5-452", new TestScriptFormat("X5-{value}").format("452"));
@ -61,13 +61,13 @@ public class ExpressionFormatTest {
assertEquals("default", new TestScriptFormat("{value ?: 'default'}").format(null));
}
@Test
public void closures() throws Exception {
assertEquals("[ant, cat]", new TestScriptFormat("{['ant', 'buffalo', 'cat', 'dinosaur'].findAll{ it.size() <= 3 }}").format(null));
}
@Test
public void illegalSyntax() throws Exception {
try {
@ -81,7 +81,7 @@ public class ExpressionFormatTest {
}
}
@Test
public void illegalClosingBracket() throws Exception {
try {
@ -95,7 +95,7 @@ public class ExpressionFormatTest {
}
}
@Test
public void illegalBinding() throws Exception {
TestScriptFormat format = new TestScriptFormat("{xyz}");
@ -105,7 +105,7 @@ public class ExpressionFormatTest {
assertEquals("BindingError: \"xyz\": undefined", format.caughtScriptException().getMessage());
}
@Test
public void illegalProperty() throws Exception {
TestScriptFormat format = new TestScriptFormat("{value.xyz}");
@ -115,14 +115,14 @@ public class ExpressionFormatTest {
assertEquals("BindingError: \"xyz\": undefined", format.caughtScriptException().getMessage());
}
protected static class TestScriptFormat extends ExpressionFormat {
public TestScriptFormat(String format) throws ScriptException {
super(format);
}
@Override
public Bindings getBindings(Object value) {
Bindings bindings = new SimpleBindings();

View File

@ -27,6 +27,7 @@
^l[^\p{Alnum}]
^Movie[s]?
^New$
^Other$
^SAMPLE
^Season.[0-9]+
^Torrents[s]?
@ -73,6 +74,7 @@ KORSUB
LMAO
Los.Sustitutos
mkvonly
Movies
MultiSub
MVGroup.org
NL

View File

@ -132,6 +132,7 @@
<li>Export your media files including media info as CSV text file</li>
... and more!
</ul>
<p>Setting up <strong>complete automation</strong> on your HTPC extract archives, organize tv shows and movies, download subtitles, fetch artwork and metadata, update XBMC with µTorrent and FileBot it's <a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p802">that</a> easy!</p>
</div>
<div class="section features" id="features">