diff --git a/core/src/main/java/org/nzbhydra/indexers/IndexerWebAccess.java b/core/src/main/java/org/nzbhydra/indexers/IndexerWebAccess.java index 05f9509b6..50cb4df8e 100644 --- a/core/src/main/java/org/nzbhydra/indexers/IndexerWebAccess.java +++ b/core/src/main/java/org/nzbhydra/indexers/IndexerWebAccess.java @@ -13,7 +13,7 @@ import org.nzbhydra.indexers.exceptions.IndexerProgramErrorException; import org.nzbhydra.indexers.exceptions.IndexerUnreachableException; import org.nzbhydra.logging.MdcThreadPoolExecutor; -import org.nzbhydra.mapping.IndexerResponseTypeHolder; +import org.nzbhydra.mapping.nzbindex.NzbIndexRoot; import org.nzbhydra.springnative.ReflectionMarker; import org.nzbhydra.web.WebConfiguration; import org.nzbhydra.webaccess.WebAccess; @@ -80,16 +80,10 @@ public T get(URI uri, IndexerConfig indexerConfig, Class responseType) throw if (responseType == String.class) { return (T) response; } - if (responseType != null && IndexerResponseTypeHolder.class.isAssignableFrom(responseType)) { - IndexerResponseTypeHolder responseTypeHolder = (IndexerResponseTypeHolder) responseType.getDeclaredConstructor().newInstance(); - if (responseTypeHolder.getType() == IndexerResponseTypeHolder.ResponseType.JSON) { - return (T) Jackson.JSON_MAPPER.readValue(response, responseType); - } else if (responseTypeHolder.getType() == IndexerResponseTypeHolder.ResponseType.XML) { - return unmarshalXml(response); - - } else { - throw new RuntimeException("Unexpected responseTypeHolder type " + responseTypeHolder.getType()); - } + if (responseType == NzbIndexRoot.class) { + // TODO sist 23.03.2024: Make more generic + return (T) Jackson.JSON_MAPPER.readValue(response, responseType); + } //Fall back to XML return unmarshalXml(response);