1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Fixed: Searching specials with NNTMux-based usenet indexers

This commit is contained in:
Taloth Saldono 2021-02-16 21:57:11 +01:00
parent 82da38941e
commit 28ba037630

View File

@ -167,7 +167,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearch
{
AddTvIdPageableRequests(pageableRequests, Settings.Categories, searchCriteria,
string.Format("&season={0}&ep={1}",
searchCriteria.SeasonNumber,
NewznabifySeasonNumber(searchCriteria.SeasonNumber),
searchCriteria.EpisodeNumber));
}
@ -175,7 +175,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearch
{
AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria,
string.Format("&season={0}&ep={1}",
searchCriteria.SeasonNumber,
NewznabifySeasonNumber(searchCriteria.SeasonNumber),
searchCriteria.EpisodeNumber));
}
@ -185,7 +185,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearch
{
AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria,
string.Format("&season={0}&ep={1}",
searchCriteria.SeasonNumber,
NewznabifySeasonNumber(searchCriteria.SeasonNumber),
searchCriteria.EpisodeNumber));
}
@ -200,14 +200,14 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteri
{
AddTvIdPageableRequests(pageableRequests, Settings.Categories, searchCriteria,
string.Format("&season={0}",
searchCriteria.SeasonNumber));
NewznabifySeasonNumber(searchCriteria.SeasonNumber)));
}
if (searchCriteria.SearchMode.HasFlag(SearchMode.SearchTitle))
{
AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria,
string.Format("&season={0}",
searchCriteria.SeasonNumber));
NewznabifySeasonNumber(searchCriteria.SeasonNumber)));
}
pageableRequests.AddTier();
@ -216,7 +216,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteri
{
AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria,
string.Format("&season={0}",
searchCriteria.SeasonNumber));
NewznabifySeasonNumber(searchCriteria.SeasonNumber)));
}
return pageableRequests;
@ -438,5 +438,12 @@ private static string NewsnabifyTitle(string title)
{
return title.Replace("+", "%20");
}
// Temporary workaround for NNTMux considering season=0 -> null. '00' should work on existing newznab indexers.
private static string NewznabifySeasonNumber(int seasonNumber)
{
return seasonNumber == 0 ? "00" : seasonNumber.ToString();
}
}
}