searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDetails(item.getRssGuid().getGuid()); Matcher matcher = GUID_PATTERN.matcher(item.getRssGuid().getGuid()); if (matcher.matches()) { searchResultItem.setIndexerGuid(matcher.group(2)); } else { searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); searchResultItem.setIndexerGuid(item.getRssGuid().getGuid());
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { item.getRssGuid().setPermaLink(true); //Not set in RSS but actually always true SearchResultItem searchResultItem = super.createSearchResultItem(item); searchResultItem.setGrabs(item.getGrabs()); searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); for (NewznabAttribute attribute : item.getTorznabAttributes()) { searchResultItem.getAttributes().put(attribute.getName(), attribute.getValue());
@Override protected List<SearchResultItem> getSearchResultItems(NewznabXmlRoot rssRoot) throws IndexerParsingException { List<SearchResultItem> items = new ArrayList<>(); for (NewznabXmlItem rssItem : rssRoot.getRssChannel().getItems()) { SearchResultItem item = new SearchResultItem(); item.setOriginalCategory("Anime"); item.setTitle(rssItem.getTitle()); item.setLink(rssItem.getLink()); item.setIndexerGuid(rssItem.getRssGuid().getGuid()); item.setSize(rssItem.getEnclosure().getLength()); item.setPubDate(rssItem.getPubDate()); item.setIndexerScore(config.getScore().orElse(0)); item.setHasNfo(HasNfo.NO); item.setAgePrecise(true); item.setCategory(categoryProvider.getByInternalName("Anime")); item.setIndexer(this); item.setDownloadType(DownloadType.NZB); items.add(item); } return items; }
rssRoot.getRssChannel().getItems().forEach(x -> x.setTitle(rssRoot.getRssChannel().getItems().get(0).getTitle())); rssRoot.getRssChannel().getItems().forEach(x -> x.setLink(rssRoot.getRssChannel().getItems().get(0).getLink())); rssRoot.getRssChannel().getItems().forEach(x -> x.setRssGuid(rssRoot.getRssChannel().getItems().get(0).getRssGuid())); rssRoot.getRssChannel().getItems().forEach(x -> x.setNewznabAttributes(rssRoot.getRssChannel().getItems().get(0).getNewznabAttributes())); return new ResponseEntity<Object>(rssRoot, HttpStatus.OK);