From 72e28299f0fdd2e45e6f3309a204807940a713c0 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 26 Nov 2011 15:41:58 +0000 Subject: [PATCH] * update RG info less often --- .../net/sourceforge/filebot/mediainfo/ReleaseInfo.java | 7 ++++--- .../filebot/ui/rename/EpisodeListMatcher.java | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/net/sourceforge/filebot/mediainfo/ReleaseInfo.java b/source/net/sourceforge/filebot/mediainfo/ReleaseInfo.java index fb5f6896..36520bb4 100644 --- a/source/net/sourceforge/filebot/mediainfo/ReleaseInfo.java +++ b/source/net/sourceforge/filebot/mediainfo/ReleaseInfo.java @@ -3,6 +3,7 @@ package net.sourceforge.filebot.mediainfo; import static java.util.ResourceBundle.*; +import static java.util.concurrent.TimeUnit.*; import static java.util.regex.Pattern.*; import static net.sourceforge.tuned.StringUtilities.*; @@ -108,12 +109,12 @@ public class ReleaseInfo { } - // fetch release group names online and try to update the data once per day - protected final CachedResource releaseGroupResource = new CachedResource(getBundle(getClass().getName()).getString("url.release-groups"), 24 * 60 * 60 * 1000) { + // fetch release group names online and try to update the data every other day + protected final CachedResource releaseGroupResource = new CachedResource(getBundle(getClass().getName()).getString("url.release-groups"), DAYS.toMillis(2)) { @Override public String[] process(ByteBuffer data) { - return compile("\\s").split(Charset.forName("UTF-8").decode(data)); + return compile("\\s+").split(Charset.forName("UTF-8").decode(data)); } }; diff --git a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java index bdb584bb..b6c978bf 100644 --- a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java @@ -231,13 +231,14 @@ class EpisodeListMatcher implements AutoCompleteMatcher { // require user input if auto-detection has failed or has been disabled if (episodes.isEmpty()) { String suggestion = new SeriesNameMatcher().matchBySeasonEpisodePattern(getName(files.get(0))); - if (suggestion == null) { + if (suggestion != null) { + // clean media info / release group info / etc + suggestion = new ReleaseInfo().cleanRG(suggestion); + } else { + // use folder name suggestion = files.get(0).getParentFile().getName(); } - // clean media info / release group info / etc - suggestion = new ReleaseInfo().cleanRG(suggestion); - String input = null; synchronized (this) { input = showInputDialog("Enter series name:", suggestion, files.get(0).getParentFile().getName(), window);