* better fix for the "3-digit SxE pattern with multiple files" issues

This commit is contained in:
Reinhard Pointner 2013-01-17 06:32:58 +00:00
parent 450e65dc0c
commit d52ae6cab8
1 changed files with 10 additions and 1 deletions

View File

@ -45,6 +45,7 @@ import net.sourceforge.filebot.similarity.DateMetric;
import net.sourceforge.filebot.similarity.MetricAvg; import net.sourceforge.filebot.similarity.MetricAvg;
import net.sourceforge.filebot.similarity.NameSimilarityMetric; import net.sourceforge.filebot.similarity.NameSimilarityMetric;
import net.sourceforge.filebot.similarity.SeasonEpisodeMatcher; import net.sourceforge.filebot.similarity.SeasonEpisodeMatcher;
import net.sourceforge.filebot.similarity.SeasonEpisodeMatcher.SeasonEpisodePattern;
import net.sourceforge.filebot.similarity.SeasonEpisodeMatcher.SxE; import net.sourceforge.filebot.similarity.SeasonEpisodeMatcher.SxE;
import net.sourceforge.filebot.similarity.SequenceMatchSimilarity; import net.sourceforge.filebot.similarity.SequenceMatchSimilarity;
import net.sourceforge.filebot.similarity.SeriesNameMatcher; import net.sourceforge.filebot.similarity.SeriesNameMatcher;
@ -167,7 +168,15 @@ public class MediaDetection {
// divide file set per complete series set // divide file set per complete series set
Map<Object, List<File>> filesByEpisode = new LinkedHashMap<Object, List<File>>(); Map<Object, List<File>> filesByEpisode = new LinkedHashMap<Object, List<File>>();
for (File file : combinedFileSet) { for (File file : combinedFileSet) {
Object eid = getEpisodeIdentifier(file.getPath(), true); Object eid = getEpisodeIdentifier(file.getName(), true);
// SPECIAL CASE: 101, 201, 202, etc 3-digit SxE pattern
if (eid == null) {
List<SxE> d3sxe = new SeasonEpisodePattern(null, "(?<!\\p{Alnum})(\\d)(\\d{2})(?!\\p{Alnum})").match(file.getName());
if (d3sxe != null && d3sxe.size() > 0) {
eid = d3sxe;
}
}
// merge specials into first SxE group // merge specials into first SxE group
if (eid == null) { if (eid == null) {