* fine-tuning for amc script

This commit is contained in:
Reinhard Pointner 2014-04-26 17:31:03 +00:00
parent 060bb1f037
commit 369aa6d406
3 changed files with 12 additions and 2 deletions

View File

@ -194,7 +194,11 @@ public abstract class ScriptShellBaseClass extends Script {
}
public String detectSeriesName(Object files, boolean useSeriesIndex, boolean useAnimeIndex) throws Exception {
List<String> names = MediaDetection.detectSeriesNames(FileUtilities.asFileList(files), useSeriesIndex, useAnimeIndex, Locale.ENGLISH);
List<File> input = FileUtilities.asFileList(files);
if (input.isEmpty())
return null;
List<String> names = MediaDetection.detectSeriesNames(input, useSeriesIndex, useAnimeIndex, Locale.ENGLISH);
return names == null || names.isEmpty() ? null : names.get(0);
}

View File

@ -133,7 +133,7 @@ public class SeasonEpisodeMatcher {
};
// (last-resort) match patterns like 101, 102 (and greedily just grab the first)
Num101_SUBSTRING = new SeasonEpisodePattern(STRICT_SANITY, "([1-9]{1})(\\d{2}).+") {
Num101_SUBSTRING = new SeasonEpisodePattern(STRICT_SANITY, "([1-9]{1})(\\d{2}).*") {
@Override
protected Collection<SxE> process(MatchResult match) {
@ -341,6 +341,11 @@ public class SeasonEpisodeMatcher {
return -1;
}
@Override
public String toString() {
return pattern.pattern();
}
}
public static class SeasonEpisodeUnion implements SeasonEpisodeParser {

View File

@ -1,3 +1,4 @@
^episodes.(s\d{2}e\d{2}|\dx\d{2}) Episodes
at.midnight @midnight
BSG Battlestar Galactica
Craig.Ferguson The Late Late Show with Craig Ferguson