@Test public void shouldGetDetailsLinkFromRssGuidIfPermalink() throws Exception { NewznabXmlItem rssItem = buildBasicRssItem(); rssItem.setRssGuid(new NewznabXmlGuid("detailsLink", true)); rssItem.setComments("http: SearchResultItem item = testee.createSearchResultItem(rssItem); assertThat(item.getDetails(), is("detailsLink")); }
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); 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()); } } else { searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); } if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) { searchResultItem.setDetails(item.getComments().replace("#comments", "")); } searchResultItem.setFirstFound(Instant.now()); searchResultItem.setIndexer(this); searchResultItem.setTitle(cleanUpTitle(item.getTitle())); searchResultItem.setSize(item.getEnclosure().getLength()); searchResultItem.setPubDate(item.getPubDate()); searchResultItem.setIndexerScore(config.getScore()); searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem)); searchResultItem.setAgePrecise(true); searchResultItem.setDescription(item.getDescription()); searchResultItem.setDownloadType(DownloadType.NZB); searchResultItem.setCommentsLink(item.getComments()); searchResultItem.setOriginalCategory(item.getCategory()); parseAttributes(item, searchResultItem); return searchResultItem; }
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); 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()); } } else { searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); } if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) { searchResultItem.setDetails(item.getComments().replace("#comments", "")); } searchResultItem.setFirstFound(Instant.now()); searchResultItem.setIndexer(this); searchResultItem.setTitle(cleanUpTitle(item.getTitle())); searchResultItem.setSize(item.getEnclosure().getLength()); searchResultItem.setPubDate(item.getPubDate()); searchResultItem.setIndexerScore(config.getScore()); searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem)); searchResultItem.setAgePrecise(true); searchResultItem.setDescription(item.getDescription()); searchResultItem.setDownloadType(DownloadType.NZB); searchResultItem.setCommentsLink(item.getComments()); searchResultItem.setOriginalCategory(item.getCategory()); parseAttributes(item, searchResultItem); return searchResultItem; } }
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); 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()); } } else { searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); } if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) { searchResultItem.setDetails(item.getComments().replace("#comments", "")); } searchResultItem.setFirstFound(Instant.now()); searchResultItem.setIndexer(this); searchResultItem.setTitle(cleanUpTitle(item.getTitle())); searchResultItem.setSize(item.getEnclosure().getLength()); searchResultItem.setPubDate(item.getPubDate()); searchResultItem.setIndexerScore(config.getScore()); searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem)); searchResultItem.setAgePrecise(true); searchResultItem.setDescription(item.getDescription()); searchResultItem.setDownloadType(DownloadType.NZB); searchResultItem.setCommentsLink(item.getComments()); searchResultItem.setOriginalCategory(item.getCategory()); parseAttributes(item, searchResultItem); return searchResultItem; }  }
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); 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()); } } else { searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); } if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) { searchResultItem.setDetails(item.getComments().replace("#comments", "")); } searchResultItem.setFirstFound(Instant.now()); searchResultItem.setIndexer(this); searchResultItem.setTitle(cleanUpTitle(item.getTitle())); searchResultItem.setSize(item.getEnclosure().getLength()); searchResultItem.setPubDate(item.getPubDate()); searchResultItem.setIndexerScore(config.getScore()); searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem)); searchResultItem.setAgePrecise(true); searchResultItem.setDescription(item.getDescription()); searchResultItem.setDownloadType(DownloadType.NZB); searchResultItem.setCommentsLink(item.getComments()); searchResultItem.setOriginalCategory(item.getCategory()); parseAttributes(item, searchResultItem); return searchResultItem; }  @Override NfoResult getNfo(String guid); }
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); 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()); } } else { searchResultItem.setIndexerGuid(item.getRssGuid().getGuid()); } if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) { searchResultItem.setDetails(item.getComments().replace("#comments", "")); } searchResultItem.setFirstFound(Instant.now()); searchResultItem.setIndexer(this); searchResultItem.setTitle(cleanUpTitle(item.getTitle())); searchResultItem.setSize(item.getEnclosure().getLength()); searchResultItem.setPubDate(item.getPubDate()); searchResultItem.setIndexerScore(config.getScore()); searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem)); searchResultItem.setAgePrecise(true); searchResultItem.setDescription(item.getDescription()); searchResultItem.setDownloadType(DownloadType.NZB); searchResultItem.setCommentsLink(item.getComments()); searchResultItem.setOriginalCategory(item.getCategory()); parseAttributes(item, searchResultItem); return searchResultItem; }  @Override NfoResult getNfo(String guid);  }