diff --git a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java index a09f6d5e..ce31c271 100644 --- a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java @@ -5,6 +5,7 @@ package net.sourceforge.filebot.ui.rename; import static java.util.Collections.*; import static javax.swing.JOptionPane.*; import static net.sourceforge.filebot.MediaTypes.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import static net.sourceforge.tuned.FileUtilities.*; import static net.sourceforge.tuned.ui.TunedUtilities.*; @@ -65,7 +66,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher { // find probable matches using name similarity > 0.9 for (SearchResult result : searchResults) { - if (metric.getSimilarity(normalize(query), normalize(result.getName())) > 0.9) { + if (metric.getSimilarity(normalizeName(query), normalizeName(result.getName())) > 0.9) { probableMatches.add(result); } } @@ -107,9 +108,9 @@ class EpisodeListMatcher implements AutoCompleteMatcher { } - private String normalize(String value) { + private String normalizeName(String value) { // remove trailing braces, e.g. Doctor Who (2005) -> doctor who - return value.replaceAll("[(]([^)]*)[)]", "").trim().toLowerCase(); + return removeTrailingBraces(value).toLowerCase(); } diff --git a/source/net/sourceforge/filebot/ui/rename/MatchSimilarityMetric.java b/source/net/sourceforge/filebot/ui/rename/MatchSimilarityMetric.java index 199ed119..aa77947f 100644 --- a/source/net/sourceforge/filebot/ui/rename/MatchSimilarityMetric.java +++ b/source/net/sourceforge/filebot/ui/rename/MatchSimilarityMetric.java @@ -4,6 +4,7 @@ package net.sourceforge.filebot.ui.rename; import static java.lang.Math.*; import static net.sourceforge.filebot.hash.VerificationUtilities.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import static net.sourceforge.tuned.FileUtilities.*; import java.io.File; @@ -22,6 +23,7 @@ import net.sourceforge.filebot.similarity.SeasonEpisodeMatcher.SxE; import net.sourceforge.filebot.vfs.AbstractFile; import net.sourceforge.filebot.web.Date; import net.sourceforge.filebot.web.Episode; +import net.sourceforge.filebot.web.Movie; public enum MatchSimilarityMetric implements SimilarityMetric { @@ -121,8 +123,8 @@ public enum MatchSimilarityMetric implements SimilarityMetric { protected String[] fields(Object object) { if (object instanceof Episode) { - Episode e = (Episode) object; - return new String[] { e.getSeriesName(), e.getTitle() }; + Episode episode = (Episode) object; + return new String[] { removeTrailingBraces(episode.getSeriesName()), episode.getTitle() }; } if (object instanceof File) { @@ -130,6 +132,16 @@ public enum MatchSimilarityMetric implements SimilarityMetric { return new String[] { getName(file.getParentFile()), getName(file) }; } + if (object instanceof Movie) { + Movie movie = (Movie) object; + return new String[] { movie.getName(), Integer.toString(movie.getYear()) }; + } + + if (object instanceof AbstractFile) { + AbstractFile file = (AbstractFile) object; + return new String[] { getNameWithoutExtension(file.getName()) }; + } + return new String[] { object.toString() }; } diff --git a/source/net/sourceforge/filebot/web/AbstractEpisodeListProvider.java b/source/net/sourceforge/filebot/web/AbstractEpisodeListProvider.java index c5618885..0be09a7e 100644 --- a/source/net/sourceforge/filebot/web/AbstractEpisodeListProvider.java +++ b/source/net/sourceforge/filebot/web/AbstractEpisodeListProvider.java @@ -2,7 +2,7 @@ package net.sourceforge.filebot.web; -import static net.sourceforge.filebot.web.EpisodeListUtilities.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import java.util.List; import java.util.Locale; diff --git a/source/net/sourceforge/filebot/web/AnidbClient.java b/source/net/sourceforge/filebot/web/AnidbClient.java index 6273e328..e96827d1 100644 --- a/source/net/sourceforge/filebot/web/AnidbClient.java +++ b/source/net/sourceforge/filebot/web/AnidbClient.java @@ -2,7 +2,7 @@ package net.sourceforge.filebot.web; -import static net.sourceforge.filebot.web.EpisodeListUtilities.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import static net.sourceforge.filebot.web.WebRequest.*; import static net.sourceforge.tuned.XPathUtilities.*; diff --git a/source/net/sourceforge/filebot/web/SerienjunkiesClient.java b/source/net/sourceforge/filebot/web/SerienjunkiesClient.java index 2b6284ea..f59f4ecd 100644 --- a/source/net/sourceforge/filebot/web/SerienjunkiesClient.java +++ b/source/net/sourceforge/filebot/web/SerienjunkiesClient.java @@ -2,7 +2,7 @@ package net.sourceforge.filebot.web; -import static net.sourceforge.filebot.web.EpisodeListUtilities.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import static net.sourceforge.filebot.web.WebRequest.*; import java.io.IOException; diff --git a/source/net/sourceforge/filebot/web/TVRageClient.java b/source/net/sourceforge/filebot/web/TVRageClient.java index 828efb2c..067d1b9d 100644 --- a/source/net/sourceforge/filebot/web/TVRageClient.java +++ b/source/net/sourceforge/filebot/web/TVRageClient.java @@ -2,7 +2,7 @@ package net.sourceforge.filebot.web; -import static net.sourceforge.filebot.web.EpisodeListUtilities.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import static net.sourceforge.filebot.web.WebRequest.*; import static net.sourceforge.tuned.XPathUtilities.*; diff --git a/source/net/sourceforge/filebot/web/TheTVDBClient.java b/source/net/sourceforge/filebot/web/TheTVDBClient.java index 6e3318f0..b58ec217 100644 --- a/source/net/sourceforge/filebot/web/TheTVDBClient.java +++ b/source/net/sourceforge/filebot/web/TheTVDBClient.java @@ -2,7 +2,7 @@ package net.sourceforge.filebot.web; -import static net.sourceforge.filebot.web.EpisodeListUtilities.*; +import static net.sourceforge.filebot.web.EpisodeUtilities.*; import static net.sourceforge.filebot.web.WebRequest.*; import static net.sourceforge.tuned.XPathUtilities.*; diff --git a/source/net/sourceforge/tuned/StringUtilities.java b/source/net/sourceforge/tuned/StringUtilities.java index 2a0a809c..63ea277e 100644 --- a/source/net/sourceforge/tuned/StringUtilities.java +++ b/source/net/sourceforge/tuned/StringUtilities.java @@ -37,11 +37,6 @@ public final class StringUtilities { } - public static boolean isNullOrEmpty(String value) { - return value == null || value.isEmpty(); - } - - /** * Dummy constructor to prevent instantiation. */ diff --git a/website/data/release-groups.txt b/website/data/release-groups.txt index d9b43d32..bdb8565a 100644 --- a/website/data/release-groups.txt +++ b/website/data/release-groups.txt @@ -12,6 +12,7 @@ AiRWAVES ALLiANCE ANiHLS ARiGOLD +ASAP AW aWake aXXo @@ -72,6 +73,7 @@ DiVERSiTY DivXNL-Team DMT DnB +DNL DOT DOWN ELECTRiC @@ -80,6 +82,7 @@ EnDoR ESiR ETM EUHD +EuReKA ExtraTorrentRG FHM FLAiTE @@ -110,6 +113,7 @@ HDFiRE HDFL HDi HDL +HDMaNiAcS HDMI HDQ HDVD @@ -140,6 +144,7 @@ JAVLiU k2 KaKa KOENiG +KRaLiMaRKo KYR Larceny LEViTY @@ -262,6 +267,7 @@ VanRay VCDVaULT ViNYL ViSiON +ViSTA VOA VoMiT VoX