From 33dc0d7ca51583e61cf42bac92d5d4774f6049fb Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 13 Mar 2016 19:32:44 +0000 Subject: [PATCH] Refactor --- source/net/filebot/CachedResource.java | 2 +- source/net/filebot/media/MediaDetection.java | 2 +- test/net/filebot/media/MediaDetectionTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/CachedResource.java b/source/net/filebot/CachedResource.java index 85f33a67..10de0347 100644 --- a/source/net/filebot/CachedResource.java +++ b/source/net/filebot/CachedResource.java @@ -87,7 +87,7 @@ public class CachedResource implements Resource { return parse.transform(data); } catch (IOException e) { - debug.warning(format("Fetch failed: %s => %s", url, e)); + debug.warning(format("Fetch failed: %s", e.getMessage())); // use previously cached data if possible if (element == null || element.getObjectValue() == null) { diff --git a/source/net/filebot/media/MediaDetection.java b/source/net/filebot/media/MediaDetection.java index bda8a03d..42f068d6 100644 --- a/source/net/filebot/media/MediaDetection.java +++ b/source/net/filebot/media/MediaDetection.java @@ -407,7 +407,7 @@ public class MediaDetection { for (File path : listPathTail(f, 2, true)) { String fn = getName(path); // ignore non-strict series name parsing if there are movie year patterns - if (!strict && parseMovieYear(fn).equals(matchIntegers(fn))) { + if (!strict && parseMovieYear(fn).equals(matchIntegers(stripFormatInfo(fn)))) { break; } String sn = seriesNameMatcher.matchByEpisodeIdentifier(fn); diff --git a/test/net/filebot/media/MediaDetectionTest.java b/test/net/filebot/media/MediaDetectionTest.java index 7a78f156..945d5b01 100644 --- a/test/net/filebot/media/MediaDetectionTest.java +++ b/test/net/filebot/media/MediaDetectionTest.java @@ -23,7 +23,7 @@ public class MediaDetectionTest { @Test public void detectSeriesName() throws Exception { - assertEquals(null, MediaDetection.detectSeriesNames(singleton(new File("Movie/3.Idiots.PAL.DVD.DD5.1.x264")), true, false, Locale.ENGLISH)); + assertEquals("[]", MediaDetection.detectSeriesNames(singleton(new File("Movie/LOTR.2001.AVC-1080")), true, false, Locale.ENGLISH).toString()); } }