* fix performance / blocking issues
This commit is contained in:
parent
1f0efe713f
commit
2793321715
|
@ -16,8 +16,6 @@ import java.awt.geom.Rectangle2D;
|
||||||
import java.awt.geom.RoundRectangle2D;
|
import java.awt.geom.RoundRectangle2D;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.swing.DefaultListCellRenderer;
|
import javax.swing.DefaultListCellRenderer;
|
||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
|
@ -26,7 +24,6 @@ import javax.swing.border.EmptyBorder;
|
||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import net.sourceforge.filebot.ResourceManager;
|
import net.sourceforge.filebot.ResourceManager;
|
||||||
import net.sourceforge.filebot.media.MediaDetection;
|
|
||||||
import net.sourceforge.filebot.similarity.Match;
|
import net.sourceforge.filebot.similarity.Match;
|
||||||
import net.sourceforge.filebot.similarity.MetricCascade;
|
import net.sourceforge.filebot.similarity.MetricCascade;
|
||||||
import net.sourceforge.filebot.similarity.MetricMin;
|
import net.sourceforge.filebot.similarity.MetricMin;
|
||||||
|
@ -225,14 +222,6 @@ class RenameListCellRenderer extends DefaultFancyListCellRenderer {
|
||||||
return "Folder";
|
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);
|
String extension = FileUtilities.getExtension(file);
|
||||||
if (extension != null) {
|
if (extension != null) {
|
||||||
return extension.toLowerCase();
|
return extension.toLowerCase();
|
||||||
|
|
|
@ -94,7 +94,7 @@ public abstract class CachedResource<T extends Serializable> {
|
||||||
try {
|
try {
|
||||||
long lastModified = element != null ? lastUpdateTime : 0;
|
long lastModified = element != null ? lastUpdateTime : 0;
|
||||||
URL url = new URL(resource);
|
URL url = new URL(resource);
|
||||||
data = fetch(url, lastModified);
|
data = fetch(url, lastModified, element != null ? 0 : retryCountLimit);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
networkException = e;
|
networkException = e;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -140,15 +140,17 @@ public abstract class CachedResource<T extends Serializable> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected ByteBuffer fetch(URL url, long lastModified) throws IOException, InterruptedException {
|
protected ByteBuffer fetch(URL url, long lastModified, int retries) throws IOException, InterruptedException {
|
||||||
for (int i = 0; retryCountLimit < 0 || i <= retryCountLimit; i++) {
|
for (int i = 0; retries < 0 || i <= retries; i++) {
|
||||||
try {
|
try {
|
||||||
|
if (i > 0) {
|
||||||
|
Thread.sleep(retryWaitTime);
|
||||||
|
}
|
||||||
return fetchData(url, lastModified);
|
return fetchData(url, lastModified);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (i >= 0 && i >= retryCountLimit) {
|
if (i >= 0 && i >= retries) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
Thread.sleep(retryWaitTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // can't happen
|
return null; // can't happen
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="screenshot screencast">
|
<div class="screenshot screencast">
|
||||||
<a onclick="_gaq.push(['_trackPageview', '/video/tutorial'])" href="http://www.youtube.com/watch?v=zcSFKiwFLZw" title="How to use FileBot" target="_blank">
|
<a onclick="_gaq.push(['_trackPageview', '/video/tutorial'])" href="http://www.youtube.com/watch?v=zcSFKiwFLZw&list=PLAeKsKcI7rapWVLl-Oy4wx_-5RoMclWPt" title="How to use FileBot" target="_blank">
|
||||||
<img class="play" alt="play" src="images/play.png" width="16" height="16" />
|
<img class="play" alt="play" src="images/play.png" width="16" height="16" />
|
||||||
<img alt="screenshot" src="screenshots/medium/panel.rename.png" width="300" height="238" />
|
<img alt="screenshot" src="screenshots/medium/panel.rename.png" width="300" height="238" />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -89,6 +89,11 @@
|
||||||
"date": "2011-02-18",
|
"date": "2011-02-18",
|
||||||
"text": "best app on series renaming i could find"
|
"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",
|
"user": "Jan",
|
||||||
"date": "2013-03-21",
|
"date": "2013-03-21",
|
||||||
|
|
Loading…
Reference in New Issue