mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-04 16:35:08 -05:00
* ignore duplicate SxE interpretations for 101 pattern
This commit is contained in:
parent
a3745893fd
commit
0a80002230
@ -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().
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user