From 279332171598e424c5686309e4fccd7eb4df3f28 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 31 Mar 2013 11:36:28 +0000 Subject: [PATCH] * fix performance / blocking issues --- .../filebot/ui/rename/RenameListCellRenderer.java | 11 ----------- .../net/sourceforge/filebot/web/CachedResource.java | 12 +++++++----- website/index.html | 2 +- website/reviews.json | 5 +++++ 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/source/net/sourceforge/filebot/ui/rename/RenameListCellRenderer.java b/source/net/sourceforge/filebot/ui/rename/RenameListCellRenderer.java index c65bbc34..7ff0c29f 100644 --- a/source/net/sourceforge/filebot/ui/rename/RenameListCellRenderer.java +++ b/source/net/sourceforge/filebot/ui/rename/RenameListCellRenderer.java @@ -16,8 +16,6 @@ import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; import java.io.File; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.DefaultListCellRenderer; import javax.swing.JList; @@ -26,7 +24,6 @@ import javax.swing.border.EmptyBorder; import net.miginfocom.swing.MigLayout; import net.sourceforge.filebot.ResourceManager; -import net.sourceforge.filebot.media.MediaDetection; import net.sourceforge.filebot.similarity.Match; import net.sourceforge.filebot.similarity.MetricCascade; import net.sourceforge.filebot.similarity.MetricMin; @@ -225,14 +222,6 @@ class RenameListCellRenderer extends DefaultFancyListCellRenderer { return "Folder"; } - try { - if (MediaDetection.getClutterFileFilter().accept(file)) { - return "Sample"; - } - } catch (Exception e) { - Logger.getLogger(getClass().getName()).log(Level.WARNING, e.getMessage()); - } - String extension = FileUtilities.getExtension(file); if (extension != null) { return extension.toLowerCase(); diff --git a/source/net/sourceforge/filebot/web/CachedResource.java b/source/net/sourceforge/filebot/web/CachedResource.java index 0361155d..ea919131 100644 --- a/source/net/sourceforge/filebot/web/CachedResource.java +++ b/source/net/sourceforge/filebot/web/CachedResource.java @@ -94,7 +94,7 @@ public abstract class CachedResource { try { long lastModified = element != null ? lastUpdateTime : 0; URL url = new URL(resource); - data = fetch(url, lastModified); + data = fetch(url, lastModified, element != null ? 0 : retryCountLimit); } catch (IOException e) { networkException = e; } catch (InterruptedException e) { @@ -140,15 +140,17 @@ public abstract class CachedResource { } - protected ByteBuffer fetch(URL url, long lastModified) throws IOException, InterruptedException { - for (int i = 0; retryCountLimit < 0 || i <= retryCountLimit; i++) { + protected ByteBuffer fetch(URL url, long lastModified, int retries) throws IOException, InterruptedException { + for (int i = 0; retries < 0 || i <= retries; i++) { try { + if (i > 0) { + Thread.sleep(retryWaitTime); + } return fetchData(url, lastModified); } catch (IOException e) { - if (i >= 0 && i >= retryCountLimit) { + if (i >= 0 && i >= retries) { throw e; } - Thread.sleep(retryWaitTime); } } return null; // can't happen diff --git a/website/index.html b/website/index.html index 10c328f0..b29eddb1 100644 --- a/website/index.html +++ b/website/index.html @@ -136,7 +136,7 @@
- + play screenshot diff --git a/website/reviews.json b/website/reviews.json index 51df347a..1469ad1c 100644 --- a/website/reviews.json +++ b/website/reviews.json @@ -89,6 +89,11 @@ "date": "2011-02-18", "text": "best app on series renaming i could find" }, + { + "user": "Camping chair reviews", + "date": "2013-03-23", + "text": "One of the best (if not the best) multiplatform episode renamer/subtitle downloader" + }, { "user": "Jan", "date": "2013-03-21",