mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-17 23:05:03 -05:00
* fixed code paths that blocked the EDT
This commit is contained in:
parent
c45b6dfbd0
commit
ecf76afdb8
@ -2,8 +2,6 @@
|
|||||||
package net.sourceforge.filebot.ui.subtitle;
|
package net.sourceforge.filebot.ui.subtitle;
|
||||||
|
|
||||||
|
|
||||||
import static net.sourceforge.filebot.MediaTypes.*;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
|
|
||||||
@ -14,7 +12,6 @@ import javax.swing.border.CompoundBorder;
|
|||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import net.sourceforge.filebot.ResourceManager;
|
import net.sourceforge.filebot.ResourceManager;
|
||||||
import net.sourceforge.filebot.vfs.ArchiveType;
|
|
||||||
import net.sourceforge.tuned.ui.AbstractFancyListCellRenderer;
|
import net.sourceforge.tuned.ui.AbstractFancyListCellRenderer;
|
||||||
import net.sourceforge.tuned.ui.DashedSeparator;
|
import net.sourceforge.tuned.ui.DashedSeparator;
|
||||||
|
|
||||||
@ -63,12 +60,7 @@ class SubtitlePackageCellRenderer extends AbstractFancyListCellRenderer {
|
|||||||
private Icon getIcon(SubtitlePackage subtitle) {
|
private Icon getIcon(SubtitlePackage subtitle) {
|
||||||
switch (subtitle.getDownload().getPhase()) {
|
switch (subtitle.getDownload().getPhase()) {
|
||||||
case PENDING:
|
case PENDING:
|
||||||
if (ArchiveType.forName(subtitle.getType()) != ArchiveType.UNDEFINED || SUBTITLE_FILES.acceptExtension(subtitle.getType())) {
|
|
||||||
return ResourceManager.getIcon("bullet.green");
|
return ResourceManager.getIcon("bullet.green");
|
||||||
}
|
|
||||||
|
|
||||||
// unsupported archive or unknown subtitle type
|
|
||||||
return ResourceManager.getIcon("bullet.yellow");
|
|
||||||
case WAITING:
|
case WAITING:
|
||||||
return ResourceManager.getIcon("worker.pending");
|
return ResourceManager.getIcon("worker.pending");
|
||||||
case DOWNLOADING:
|
case DOWNLOADING:
|
||||||
|
@ -54,13 +54,10 @@ public class SubsceneSubtitleClient implements SubtitleProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchResult> search(String query) throws IOException, SAXException {
|
public List<SearchResult> search(String query) throws IOException, SAXException {
|
||||||
|
|
||||||
URL searchUrl = new URL("http", host, "/filmsearch.aspx?q=" + encode(query));
|
URL searchUrl = new URL("http", host, "/filmsearch.aspx?q=" + encode(query));
|
||||||
|
|
||||||
Document dom = getHtmlDocument(searchUrl);
|
Document dom = getHtmlDocument(searchUrl);
|
||||||
|
|
||||||
List<Node> nodes = selectNodes("id('filmSearch')/A", dom);
|
List<Node> nodes = selectNodes("id('filmSearch')/A", dom);
|
||||||
|
|
||||||
List<SearchResult> searchResults = new ArrayList<SearchResult>(nodes.size());
|
List<SearchResult> searchResults = new ArrayList<SearchResult>(nodes.size());
|
||||||
|
|
||||||
for (Node node : nodes) {
|
for (Node node : nodes) {
|
||||||
@ -98,7 +95,6 @@ public class SubsceneSubtitleClient implements SubtitleProvider {
|
|||||||
@Override
|
@Override
|
||||||
public List<SubtitleDescriptor> getSubtitleList(SearchResult searchResult, String languageName) throws Exception {
|
public List<SubtitleDescriptor> getSubtitleList(SearchResult searchResult, String languageName) throws Exception {
|
||||||
URL subtitleListUrl = getSubtitleListLink(searchResult, languageName).toURL();
|
URL subtitleListUrl = getSubtitleListLink(searchResult, languageName).toURL();
|
||||||
|
|
||||||
String languageFilter = null;
|
String languageFilter = null;
|
||||||
|
|
||||||
if (languageName != null) {
|
if (languageName != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user