From f29eb49c7f5bc4051bc0639dd603338f6607dc6f Mon Sep 17 00:00:00 2001 From: faush01 Date: Tue, 6 Aug 2013 15:26:09 +1000 Subject: [PATCH 1/3] use Rage TV ID for newznab search api calls --- .../Definitions/SearchCriteriaBase.cs | 1 + .../IndexerSearch/NzbSearchService.cs | 11 ++--- NzbDrone.Core/Indexers/IIndexer.cs | 8 ++-- NzbDrone.Core/Indexers/IndexerBase.cs | 8 ++-- NzbDrone.Core/Indexers/IndexerFetchService.cs | 8 ++-- NzbDrone.Core/Indexers/Newznab/Newznab.cs | 44 +++++++++++++++---- .../Indexers/Newznab/NewznabSettings.cs | 3 ++ NzbDrone.Core/Indexers/NzbClub/NzbClub.cs | 8 ++-- .../Indexers/Omgwtfnzbs/Omgwtfnzbs.cs | 8 ++-- NzbDrone.Core/Indexers/Wombles/Wombles.cs | 8 ++-- 10 files changed, 70 insertions(+), 37 deletions(-) diff --git a/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index 0018be941..211db3cae 100644 --- a/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -10,6 +10,7 @@ public abstract class SearchCriteriaBase private static readonly Regex BeginningThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); public int SeriesId { get; set; } + public int SeriesRageTvId { get; set; } public string SceneTitle { get; set; } public string QueryTitle diff --git a/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 03502fc82..0103456e9 100644 --- a/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -59,7 +59,7 @@ public List EpisodeSearch(int episodeId) throw new InvalidOperationException("Daily episode is missing AirDate. Try to refresh series info."); } - return SearchDaily(episode.SeriesId, DateTime.ParseExact(episode.AirDate, Episode.AIR_DATE_FORMAT, CultureInfo.InvariantCulture)); + return SearchDaily(episode.SeriesId, episode.Series.TvRageId, DateTime.ParseExact(episode.AirDate, Episode.AIR_DATE_FORMAT, CultureInfo.InvariantCulture)); } return SearchSingle(series, episode); @@ -67,7 +67,7 @@ public List EpisodeSearch(int episodeId) private List SearchSingle(Series series, Episode episode) { - var searchSpec = Get(series.Id, episode.SeasonNumber); + var searchSpec = Get(series.Id, series.TvRageId, episode.SeasonNumber); if (series.UseSceneNumbering) { @@ -92,9 +92,9 @@ private List SearchSingle(Series series, Episode episode) return Dispatch(indexer => _feedFetcher.Fetch(indexer, searchSpec), searchSpec); } - private List SearchDaily(int seriesId, DateTime airDate) + private List SearchDaily(int seriesId, int rageTvId, DateTime airDate) { - var searchSpec = Get(seriesId); + var searchSpec = Get(seriesId, rageTvId); searchSpec.Airtime = airDate; return Dispatch(indexer => _feedFetcher.Fetch(indexer, searchSpec), searchSpec); @@ -128,13 +128,14 @@ private List PartialSeasonSearch(SeasonSearchCriteria search) return result; } - private TSpec Get(int seriesId, int seasonNumber = -1) where TSpec : SearchCriteriaBase, new() + private TSpec Get(int seriesId, int rageTvId, int seasonNumber = -1) where TSpec : SearchCriteriaBase, new() { var spec = new TSpec(); var series = _seriesService.GetSeries(seriesId); spec.SeriesId = seriesId; + spec.SeriesRageTvId = rageTvId; spec.SceneTitle = _sceneMapping.GetSceneName(series.TvdbId, seasonNumber); if (string.IsNullOrWhiteSpace(spec.SceneTitle)) diff --git a/NzbDrone.Core/Indexers/IIndexer.cs b/NzbDrone.Core/Indexers/IIndexer.cs index 2d95e490e..ef59bd08e 100644 --- a/NzbDrone.Core/Indexers/IIndexer.cs +++ b/NzbDrone.Core/Indexers/IIndexer.cs @@ -17,9 +17,9 @@ public interface IIndexer IParseFeed Parser { get; } - IEnumerable GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber); - IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date); - IEnumerable GetSeasonSearchUrls(string seriesTitle, int seasonNumber); - IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard); + IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber); + IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date); + IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber); + IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard); } } \ No newline at end of file diff --git a/NzbDrone.Core/Indexers/IndexerBase.cs b/NzbDrone.Core/Indexers/IndexerBase.cs index 229c420dd..11cbe8bc2 100644 --- a/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/NzbDrone.Core/Indexers/IndexerBase.cs @@ -34,10 +34,10 @@ public virtual IParseFeed Parser } public abstract IEnumerable RecentFeed { get; } - public abstract IEnumerable GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber); - public abstract IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date); - public abstract IEnumerable GetSeasonSearchUrls(string seriesTitle, int seasonNumber); - public abstract IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard); + public abstract IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber); + public abstract IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date); + public abstract IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber); + public abstract IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard); } diff --git a/NzbDrone.Core/Indexers/IndexerFetchService.cs b/NzbDrone.Core/Indexers/IndexerFetchService.cs index 29a634661..b947cc53e 100644 --- a/NzbDrone.Core/Indexers/IndexerFetchService.cs +++ b/NzbDrone.Core/Indexers/IndexerFetchService.cs @@ -46,7 +46,7 @@ public IList Fetch(IIndexer indexer, SeasonSearchCriteria searchCrit { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeasonNumber); + var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.SeasonNumber); var result = Fetch(indexer, searchUrls); @@ -58,7 +58,7 @@ public IList Fetch(IIndexer indexer, SingleEpisodeSearchCriteria sea { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber); + var searchUrls = indexer.GetEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber); var result = Fetch(indexer, searchUrls); @@ -71,7 +71,7 @@ public IList Fetch(IIndexer indexer, PartialSeasonSearchCriteria sea { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeasonNumber); + var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.SeasonNumber); var result = Fetch(indexer, searchUrls); @@ -83,7 +83,7 @@ public IList Fetch(IIndexer indexer, DailyEpisodeSearchCriteria sear { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetDailyEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.Airtime); + var searchUrls = indexer.GetDailyEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.Airtime); var result = Fetch(indexer, searchUrls); _logger.Info("Finished searching {0} on {1}. Found {2}", indexer.Name, searchCriteria, result.Count); diff --git a/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 0f5261448..5f18f3417 100644 --- a/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -84,24 +84,52 @@ public override IEnumerable RecentFeed } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}&ep={3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeNumber)); + if (Settings.UseRageTvId) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, rageTvId, seasonNumber, episodeNumber)); + } + else + { + 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, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2:yyyy}&ep={2:MM/dd}", url, NewsnabifyTitle(seriesTitle), date)).ToList(); + if (Settings.UseRageTvId) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, rageTvId, date)).ToList(); + } + else + { + 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 seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}", url, NewsnabifyTitle(seriesTitle), seasonNumber)); + if (Settings.UseRageTvId) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, rageTvId, seasonNumber)); + } + else + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}", url, NewsnabifyTitle(seriesTitle), seasonNumber)); + } } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}+S{2:00}E{3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeWildcard)); + if (Settings.UseRageTvId) + { + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, rageTvId, seasonNumber, episodeWildcard)); + } + else + { + 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 diff --git a/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs b/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs index 10291e2c6..c728f1fae 100644 --- a/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs +++ b/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs @@ -10,6 +10,7 @@ public class NewznabSettings : IIndexerSetting public NewznabSettings() { Categories = new [] { 5030, 5040 }; + UseRageTvId = true; } [FieldDefinition(0, Label = "URL")] @@ -20,6 +21,8 @@ public NewznabSettings() public IEnumerable Categories { get; set; } + public bool UseRageTvId { get; set; } + public bool IsValid { get diff --git a/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs b/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs index 7ce9022e2..d7dbb9d92 100644 --- a/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs +++ b/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs @@ -35,7 +35,7 @@ public override IEnumerable RecentFeed } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) { var searchUrls = new List(); @@ -47,7 +47,7 @@ public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) { var searchUrls = new List(); @@ -59,7 +59,7 @@ public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) { var searchUrls = new List(); @@ -71,7 +71,7 @@ public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle return searchUrls; } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) { var searchUrls = new List(); diff --git a/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs b/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs index a25478659..f01f17df4 100644 --- a/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs +++ b/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs @@ -20,7 +20,7 @@ public override IEnumerable RecentFeed } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) { var searchUrls = new List(); @@ -32,7 +32,7 @@ public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) { var searchUrls = new List(); @@ -44,7 +44,7 @@ public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle return searchUrls; } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) { var searchUrls = new List(); @@ -56,7 +56,7 @@ public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) { var searchUrls = new List(); diff --git a/NzbDrone.Core/Indexers/Wombles/Wombles.cs b/NzbDrone.Core/Indexers/Wombles/Wombles.cs index eca0b72f1..9fa42dff6 100644 --- a/NzbDrone.Core/Indexers/Wombles/Wombles.cs +++ b/NzbDrone.Core/Indexers/Wombles/Wombles.cs @@ -23,22 +23,22 @@ public override IEnumerable RecentFeed get { yield return "http://nzb.isasecret.com/rss/?sec=TV&fr=false"; } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) { return new List(); } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) { return new List(); } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) { return new List(); } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) { return new List(); } From 9f4dfa16d19da846018b32e446671c1a254afccf Mon Sep 17 00:00:00 2001 From: faush01 Date: Tue, 6 Aug 2013 17:38:16 +1000 Subject: [PATCH 2/3] remove query selection logic and rename param to tvRageId --- NzbDrone.Core/Indexers/IIndexer.cs | 8 ++-- NzbDrone.Core/Indexers/IndexerBase.cs | 8 ++-- NzbDrone.Core/Indexers/Newznab/Newznab.cs | 44 ++++--------------- .../Indexers/Newznab/NewznabSettings.cs | 3 -- NzbDrone.Core/Indexers/NzbClub/NzbClub.cs | 8 ++-- .../Indexers/Omgwtfnzbs/Omgwtfnzbs.cs | 8 ++-- NzbDrone.Core/Indexers/Wombles/Wombles.cs | 8 ++-- 7 files changed, 28 insertions(+), 59 deletions(-) diff --git a/NzbDrone.Core/Indexers/IIndexer.cs b/NzbDrone.Core/Indexers/IIndexer.cs index ef59bd08e..d43659eed 100644 --- a/NzbDrone.Core/Indexers/IIndexer.cs +++ b/NzbDrone.Core/Indexers/IIndexer.cs @@ -17,9 +17,9 @@ public interface IIndexer IParseFeed Parser { get; } - IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber); - IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date); - IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber); - IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard); + IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber); + IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date); + IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber); + IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard); } } \ No newline at end of file diff --git a/NzbDrone.Core/Indexers/IndexerBase.cs b/NzbDrone.Core/Indexers/IndexerBase.cs index 11cbe8bc2..02a084670 100644 --- a/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/NzbDrone.Core/Indexers/IndexerBase.cs @@ -34,10 +34,10 @@ public virtual IParseFeed Parser } public abstract IEnumerable RecentFeed { get; } - public abstract IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber); - public abstract IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date); - public abstract IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber); - public abstract IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard); + public abstract IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber); + public abstract IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date); + public abstract IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber); + public abstract IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard); } diff --git a/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 5f18f3417..7036f01e5 100644 --- a/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -84,52 +84,24 @@ public override IEnumerable RecentFeed } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber) { - if (Settings.UseRageTvId) - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, rageTvId, seasonNumber, episodeNumber)); - } - else - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}&ep={3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeNumber)); - } + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, tvRageId, seasonNumber, episodeNumber)); } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date) { - if (Settings.UseRageTvId) - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, rageTvId, date)).ToList(); - } - else - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2:yyyy}&ep={2:MM/dd}", url, NewsnabifyTitle(seriesTitle), date)).ToList(); - } + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, tvRageId, date)).ToList(); } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber) { - if (Settings.UseRageTvId) - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, rageTvId, seasonNumber)); - } - else - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}", url, NewsnabifyTitle(seriesTitle), seasonNumber)); - } + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, tvRageId, seasonNumber)); } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) { - if (Settings.UseRageTvId) - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, rageTvId, seasonNumber, episodeWildcard)); - } - else - { - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}+S{2:00}E{3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeWildcard)); - } + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, tvRageId, seasonNumber, episodeWildcard)); } public override string Name diff --git a/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs b/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs index c728f1fae..10291e2c6 100644 --- a/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs +++ b/NzbDrone.Core/Indexers/Newznab/NewznabSettings.cs @@ -10,7 +10,6 @@ public class NewznabSettings : IIndexerSetting public NewznabSettings() { Categories = new [] { 5030, 5040 }; - UseRageTvId = true; } [FieldDefinition(0, Label = "URL")] @@ -21,8 +20,6 @@ public NewznabSettings() public IEnumerable Categories { get; set; } - public bool UseRageTvId { get; set; } - public bool IsValid { get diff --git a/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs b/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs index d7dbb9d92..c1ca60e59 100644 --- a/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs +++ b/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs @@ -35,7 +35,7 @@ public override IEnumerable RecentFeed } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber) { var searchUrls = new List(); @@ -47,7 +47,7 @@ public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber) { var searchUrls = new List(); @@ -59,7 +59,7 @@ public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date) { var searchUrls = new List(); @@ -71,7 +71,7 @@ public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle return searchUrls; } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) { var searchUrls = new List(); diff --git a/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs b/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs index f01f17df4..445744c66 100644 --- a/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs +++ b/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs @@ -20,7 +20,7 @@ public override IEnumerable RecentFeed } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber) { var searchUrls = new List(); @@ -32,7 +32,7 @@ public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date) { var searchUrls = new List(); @@ -44,7 +44,7 @@ public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle return searchUrls; } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber) { var searchUrls = new List(); @@ -56,7 +56,7 @@ public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int return searchUrls; } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) { var searchUrls = new List(); diff --git a/NzbDrone.Core/Indexers/Wombles/Wombles.cs b/NzbDrone.Core/Indexers/Wombles/Wombles.cs index 9fa42dff6..29a787088 100644 --- a/NzbDrone.Core/Indexers/Wombles/Wombles.cs +++ b/NzbDrone.Core/Indexers/Wombles/Wombles.cs @@ -23,22 +23,22 @@ public override IEnumerable RecentFeed get { yield return "http://nzb.isasecret.com/rss/?sec=TV&fr=false"; } } - public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) + public override IEnumerable GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber) { return new List(); } - public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) + public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber) { return new List(); } - public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) + public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date) { return new List(); } - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) + public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) { return new List(); } From 0608871f766362d2eddf5b4aa6c62df9eab45464 Mon Sep 17 00:00:00 2001 From: faush01 Date: Tue, 6 Aug 2013 18:15:24 +1000 Subject: [PATCH 3/3] more param changes --- .../IndexerSearch/Definitions/SearchCriteriaBase.cs | 2 +- NzbDrone.Core/IndexerSearch/NzbSearchService.cs | 2 +- NzbDrone.Core/Indexers/IndexerFetchService.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index 211db3cae..11d3d4d79 100644 --- a/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -10,7 +10,7 @@ public abstract class SearchCriteriaBase private static readonly Regex BeginningThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); public int SeriesId { get; set; } - public int SeriesRageTvId { get; set; } + public int SeriesTvRageId { get; set; } public string SceneTitle { get; set; } public string QueryTitle diff --git a/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 0103456e9..79b14d45e 100644 --- a/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -135,7 +135,7 @@ private List PartialSeasonSearch(SeasonSearchCriteria search) var series = _seriesService.GetSeries(seriesId); spec.SeriesId = seriesId; - spec.SeriesRageTvId = rageTvId; + spec.SeriesTvRageId = rageTvId; spec.SceneTitle = _sceneMapping.GetSceneName(series.TvdbId, seasonNumber); if (string.IsNullOrWhiteSpace(spec.SceneTitle)) diff --git a/NzbDrone.Core/Indexers/IndexerFetchService.cs b/NzbDrone.Core/Indexers/IndexerFetchService.cs index b947cc53e..c9deb0f3d 100644 --- a/NzbDrone.Core/Indexers/IndexerFetchService.cs +++ b/NzbDrone.Core/Indexers/IndexerFetchService.cs @@ -46,7 +46,7 @@ public IList Fetch(IIndexer indexer, SeasonSearchCriteria searchCrit { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.SeasonNumber); + var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesTvRageId, searchCriteria.SeasonNumber); var result = Fetch(indexer, searchUrls); @@ -58,7 +58,7 @@ public IList Fetch(IIndexer indexer, SingleEpisodeSearchCriteria sea { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber); + var searchUrls = indexer.GetEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesTvRageId, searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber); var result = Fetch(indexer, searchUrls); @@ -71,7 +71,7 @@ public IList Fetch(IIndexer indexer, PartialSeasonSearchCriteria sea { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.SeasonNumber); + var searchUrls = indexer.GetSeasonSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesTvRageId, searchCriteria.SeasonNumber); var result = Fetch(indexer, searchUrls); @@ -83,7 +83,7 @@ public IList Fetch(IIndexer indexer, DailyEpisodeSearchCriteria sear { _logger.Debug("Searching for {0}", searchCriteria); - var searchUrls = indexer.GetDailyEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesRageTvId, searchCriteria.Airtime); + var searchUrls = indexer.GetDailyEpisodeSearchUrls(searchCriteria.QueryTitle, searchCriteria.SeriesTvRageId, searchCriteria.Airtime); var result = Fetch(indexer, searchUrls); _logger.Info("Finished searching {0} on {1}. Found {2}", indexer.Name, searchCriteria, result.Count);