diff --git a/source/net/filebot/similarity/EpisodeMatcher.java b/source/net/filebot/similarity/EpisodeMatcher.java index cbf0fea2..2abe381f 100644 --- a/source/net/filebot/similarity/EpisodeMatcher.java +++ b/source/net/filebot/similarity/EpisodeMatcher.java @@ -102,12 +102,20 @@ public class EpisodeMatcher extends Matcher { } private Set normalizeIdentifierSet(Set numbers) { + // check if any episode exceeds the episodes per season limit + int limit = 100; + for (SxE it : numbers) { + while (it.season > 0 && it.episode >= limit) { + limit *= 10; + } + } + // SxE 1x01 => 101 // Absolute 101 => 101 Set identifier = new HashSet(numbers.size()); for (SxE it : numbers) { - if (it.season > 0 && it.episode > 0 && it.episode < 100) { - identifier.add(it.season * 100 + it.episode); + if (it.season > 0 && it.episode > 0 && it.episode < limit) { + identifier.add(it.season * limit + it.episode); } else if (it.season <= 0 && it.episode > 0) { identifier.add(it.episode); }