* use the mirrors.xml server for search as well
This commit is contained in:
parent
173d5e95c6
commit
ffae3be997
|
@ -106,7 +106,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
|
||||||
@Override
|
@Override
|
||||||
public List<SearchResult> fetchSearchResult(String query, Locale locale) throws Exception {
|
public List<SearchResult> fetchSearchResult(String query, Locale locale) throws Exception {
|
||||||
// perform online search
|
// 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);
|
Document dom = getDocument(url);
|
||||||
|
|
||||||
List<Node> nodes = selectNodes("Data/Series", dom);
|
List<Node> nodes = selectNodes("Data/Series", dom);
|
||||||
|
@ -375,9 +375,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
|
||||||
|
|
||||||
|
|
||||||
protected static enum MirrorType {
|
protected static enum MirrorType {
|
||||||
XML(1),
|
XML(1), BANNER(2), ZIP(4), SEARCH(1);
|
||||||
BANNER(2),
|
|
||||||
ZIP(4);
|
|
||||||
|
|
||||||
private final int bitMask;
|
private final int bitMask;
|
||||||
|
|
||||||
|
@ -390,14 +388,12 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
|
||||||
public static EnumSet<MirrorType> fromTypeMask(int typeMask) {
|
public static EnumSet<MirrorType> fromTypeMask(int typeMask) {
|
||||||
// initialize enum set with all types
|
// initialize enum set with all types
|
||||||
EnumSet<MirrorType> enumSet = EnumSet.allOf(MirrorType.class);
|
EnumSet<MirrorType> enumSet = EnumSet.allOf(MirrorType.class);
|
||||||
|
|
||||||
for (MirrorType type : values()) {
|
for (MirrorType type : values()) {
|
||||||
if ((typeMask & type.bitMask) == 0) {
|
if ((typeMask & type.bitMask) == 0) {
|
||||||
// remove types that are not set
|
// remove types that are not set
|
||||||
enumSet.remove(type);
|
enumSet.remove(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return enumSet;
|
return enumSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue