* ignore duplicate SxE interpretations for 101 pattern

This commit is contained in:
Reinhard Pointner 2009-08-06 11:51:30 +00:00
parent a3745893fd
commit 0a80002230
2 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,10 @@ importPackage(java.lang);
// Collection, Scanner, Random, UUID, etc.
importPackage(java.util);
// other useful classes
importClass(net.sourceforge.filebot.similarity.SeriesNameMatcher);
importClass(net.sourceforge.filebot.similarity.SeasonEpisodeMatcher);
/**
* Convenience methods for String.toLowerCase() and String.toUpperCase().

View File

@ -37,7 +37,8 @@ public class SeasonEpisodeMatcher {
// interpret match as episode number only
SxE episodeOnly = new SxE(null, match.group(1) + match.group(2));
return Arrays.asList(seasonEpisode, episodeOnly);
// return both matches, unless they are one and the same
return seasonEpisode.equals(episodeOnly) ? Collections.singleton(episodeOnly) : Arrays.asList(seasonEpisode, episodeOnly);
}
};
}
@ -141,7 +142,7 @@ public class SeasonEpisodeMatcher {
@Override
public String toString() {
return String.format("%dx%02d", season, episode);
return season >= 0 ? String.format("%dx%02d", season, episode) : String.format("%02d", episode);
}
}