diff --git a/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 79b14d45e..fcf15463b 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, episode.Series.TvRageId, DateTime.ParseExact(episode.AirDate, Episode.AIR_DATE_FORMAT, CultureInfo.InvariantCulture)); + return SearchDaily(series, 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, series.TvRageId, episode.SeasonNumber); + var searchSpec = Get(series, 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, int rageTvId, DateTime airDate) + private List SearchDaily(Series series, DateTime airDate) { - var searchSpec = Get(seriesId, rageTvId); + var searchSpec = Get(series); searchSpec.Airtime = airDate; return Dispatch(indexer => _feedFetcher.Fetch(indexer, searchSpec), searchSpec); @@ -102,40 +102,20 @@ private List SearchDaily(int seriesId, int rageTvId, DateTime public List SeasonSearch(int seriesId, int seasonNumber) { - var searchSpec = Get(seriesId, seasonNumber); + var series = _seriesService.GetSeries(seriesId); + + var searchSpec = Get(series, seasonNumber); searchSpec.SeasonNumber = seasonNumber; return Dispatch(indexer => _feedFetcher.Fetch(indexer, searchSpec), searchSpec); } - private List PartialSeasonSearch(SeasonSearchCriteria search) - { - var episodesNumbers = _episodeService.GetEpisodesBySeason(search.SeriesId, search.SeasonNumber).Select(c => c.EpisodeNumber); - var prefixes = episodesNumbers - .Select(i => i / 10) - .Distinct() - .Select(prefix => new PartialSeasonSearchCriteria(search, prefix)); - - var result = new List(); - - foreach (var partialSeasonSearchSpec in prefixes) - { - var spec = partialSeasonSearchSpec; - result.AddRange(Dispatch(indexer => _feedFetcher.Fetch(indexer, spec), partialSeasonSearchSpec)); - } - - - return result; - } - - private TSpec Get(int seriesId, int rageTvId, int seasonNumber = -1) where TSpec : SearchCriteriaBase, new() + private TSpec Get(Series series, int seasonNumber = -1) where TSpec : SearchCriteriaBase, new() { var spec = new TSpec(); - var series = _seriesService.GetSeries(seriesId); - - spec.SeriesId = seriesId; - spec.SeriesTvRageId = rageTvId; + spec.SeriesId = series.Id; + spec.SeriesTvRageId = series.TvRageId; 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 d43659eed..ddef6db0f 100644 --- a/NzbDrone.Core/Indexers/IIndexer.cs +++ b/NzbDrone.Core/Indexers/IIndexer.cs @@ -20,6 +20,5 @@ public interface IIndexer 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 02a084670..c75eab2f8 100644 --- a/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/NzbDrone.Core/Indexers/IndexerBase.cs @@ -37,8 +37,5 @@ public virtual IParseFeed Parser 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); } - - } \ No newline at end of file diff --git a/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 7a42c2b41..c85c29943 100644 --- a/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -114,16 +114,6 @@ public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int 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) - { - 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 { get diff --git a/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs b/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs index c1ca60e59..b070ccad6 100644 --- a/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs +++ b/NzbDrone.Core/Indexers/NzbClub/NzbClub.cs @@ -70,17 +70,5 @@ public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle return searchUrls; } - - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) - { - var searchUrls = new List(); - - foreach (var url in RecentFeed) - { - searchUrls.Add(String.Format("{0}+{1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard)); - } - - return searchUrls; - } } } \ No newline at end of file diff --git a/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs b/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs index 3b2814333..dfdaf8c01 100644 --- a/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs +++ b/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs @@ -63,17 +63,5 @@ public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int return searchUrls; } - - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) - { - var searchUrls = new List(); - - foreach (var url in RecentFeed) - { - searchUrls.Add(String.Format("{0}&search={1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard)); - } - - return searchUrls; - } } } diff --git a/NzbDrone.Core/Indexers/Wombles/Wombles.cs b/NzbDrone.Core/Indexers/Wombles/Wombles.cs index 29a787088..eda0b9e75 100644 --- a/NzbDrone.Core/Indexers/Wombles/Wombles.cs +++ b/NzbDrone.Core/Indexers/Wombles/Wombles.cs @@ -37,10 +37,5 @@ public override IEnumerable GetDailyEpisodeSearchUrls(string seriesTitle { return new List(); } - - public override IEnumerable GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard) - { - return new List(); - } } } \ No newline at end of file diff --git a/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs b/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs new file mode 100644 index 000000000..19776e76d --- /dev/null +++ b/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs @@ -0,0 +1,8 @@ +using NzbDrone.Common.Messaging; + +namespace NzbDrone.Core.Instrumentation.Commands +{ + public class ClearLogCommand : ICommand + { + } +} \ No newline at end of file