* EpisodeFormatDialog: initialize selectedOption with Option.CANCEL
* RenameListCellRenderer: don't display type label in name list * EpisodeFormatBindingBean: get cache only when needed
This commit is contained in:
parent
d5a5b93b3b
commit
4c926c076e
@ -200,12 +200,12 @@ public class EpisodeFormatBindingBean {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final Cache checksumCache = CacheManager.getInstance().getCache("checksum");
|
||||
|
||||
|
||||
|
||||
private String crc32(File file) throws IOException, InterruptedException {
|
||||
// try to get checksum from cache
|
||||
Element cacheEntry = checksumCache.get(file);
|
||||
Cache cache = CacheManager.getInstance().getCache("checksum");
|
||||
|
||||
Element cacheEntry = cache.get(file);
|
||||
|
||||
if (cacheEntry != null) {
|
||||
return (String) cacheEntry.getValue();
|
||||
@ -232,7 +232,7 @@ public class EpisodeFormatBindingBean {
|
||||
|
||||
String checksum = String.format("%08X", crc.getValue());
|
||||
|
||||
checksumCache.put(new Element(file, checksum));
|
||||
cache.put(new Element(file, checksum));
|
||||
return checksum;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ import net.sourceforge.tuned.ui.notification.SeparatorBorder.Position;
|
||||
|
||||
public class EpisodeFormatDialog extends JDialog {
|
||||
|
||||
private Option selectedOption = null;
|
||||
private Option selectedOption = Option.CANCEL;
|
||||
|
||||
private JLabel preview = new JLabel();
|
||||
|
||||
|
@ -19,9 +19,7 @@ import javax.swing.border.EmptyBorder;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import net.sourceforge.filebot.ResourceManager;
|
||||
import net.sourceforge.filebot.similarity.Match;
|
||||
import net.sourceforge.filebot.ui.panel.rename.RenameModel.FormattedFuture;
|
||||
import net.sourceforge.filebot.web.Episode;
|
||||
import net.sourceforge.tuned.FileUtilities;
|
||||
import net.sourceforge.tuned.ui.DefaultFancyListCellRenderer;
|
||||
|
||||
@ -73,8 +71,6 @@ class RenameListCellRenderer extends DefaultFancyListCellRenderer {
|
||||
setIcon(ResourceManager.getIcon("worker.started"));
|
||||
break;
|
||||
}
|
||||
|
||||
typeLabel.setText(getType(future.getMatch()));
|
||||
}
|
||||
|
||||
if (!renameModel.hasComplement(index)) {
|
||||
@ -101,21 +97,6 @@ class RenameListCellRenderer extends DefaultFancyListCellRenderer {
|
||||
return "File";
|
||||
}
|
||||
|
||||
|
||||
protected String getType(Match<Object, File> match) {
|
||||
Object source = match.getValue();
|
||||
|
||||
if (source instanceof Episode) {
|
||||
return "Episode";
|
||||
} else if (source instanceof AbstractFileEntry) {
|
||||
return "Torrent";
|
||||
} else if (source instanceof File) {
|
||||
return "File";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private class TypeLabel extends JLabel {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user