1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

* use the mirrors.xml server for search as well

This commit is contained in:
Reinhard Pointner 2013-03-09 12:33:02 +00:00
parent 173d5e95c6
commit ffae3be997

View File

@ -106,7 +106,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
@Override
public List<SearchResult> fetchSearchResult(String query, Locale locale) throws Exception {
// perform online search
URL url = getResource(null, "/api/GetSeries.php?seriesname=" + encode(query, true) + "&language=" + getLanguageCode(locale));
URL url = getResource(MirrorType.SEARCH, "/api/GetSeries.php?seriesname=" + encode(query, true) + "&language=" + getLanguageCode(locale));
Document dom = getDocument(url);
List<Node> nodes = selectNodes("Data/Series", dom);
@ -375,9 +375,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
protected static enum MirrorType {
XML(1),
BANNER(2),
ZIP(4);
XML(1), BANNER(2), ZIP(4), SEARCH(1);
private final int bitMask;
@ -390,14 +388,12 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
public static EnumSet<MirrorType> fromTypeMask(int typeMask) {
// initialize enum set with all types
EnumSet<MirrorType> enumSet = EnumSet.allOf(MirrorType.class);
for (MirrorType type : values()) {
if ((typeMask & type.bitMask) == 0) {
// remove types that are not set
enumSet.remove(type);
}
}
return enumSet;
};