From ccfe94f49b3d6a03aa7572c5543a9cf9b1bd7902 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 27 Nov 2013 19:19:01 +0000 Subject: [PATCH] * cache compiled patterns --- source/net/sourceforge/filebot/media/MediaDetection.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index 88dbdc9e..80043af4 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -111,8 +111,11 @@ public class MediaDetection { return releaseInfo.getLanguageSuffix(getName(file)); } + private static final SeasonEpisodeMatcher seasonEpisodeMatcherStrict = new SeasonEpisodeMatcherWithFilter(true); + private static final SeasonEpisodeMatcher seasonEpisodeMatcherNonStrict = new SeasonEpisodeMatcherWithFilter(false); + public static SeasonEpisodeMatcher getSeasonEpisodeMatcher(boolean strict) { - return new SeasonEpisodeMatcherWithFilter(strict); + return strict ? seasonEpisodeMatcherStrict : seasonEpisodeMatcherNonStrict; } public static boolean isEpisode(String name, boolean strict) {