diff --git a/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 7bab09629..7a42c2b41 100644 --- a/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -86,22 +86,42 @@ public override IEnumerable RecentFeed public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, tvRageId, seasonNumber, episodeNumber)); + if (tvRageId > 0) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, tvRageId, seasonNumber, episodeNumber)); + } + + return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}&ep={3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeNumber)); } public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, tvRageId, date)).ToList(); + if (tvRageId > 0) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, tvRageId, date)).ToList(); + } + + return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2:yyyy}&ep={2:MM/dd}", url, NewsnabifyTitle(seriesTitle), date)).ToList(); } public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, tvRageId, seasonNumber)); + if (tvRageId > 0) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, tvRageId, seasonNumber)); + } + + return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}", url, NewsnabifyTitle(seriesTitle), seasonNumber)); } public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, tvRageId, seasonNumber, episodeWildcard)); + if (tvRageId > 0) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, tvRageId, seasonNumber, episodeWildcard)); + } + + return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}+S{2:00}E{3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeWildcard)); } public override string Name