From 0794affae0f05a4fb945adae3f67a07f451a06cc Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 16 Sep 2013 22:16:16 -0700 Subject: [PATCH] removed dead code. --- .../Qualities/QualityProfileModule.cs | 4 +-- NzbDrone.Api/Qualities/QualitySizeModule.cs | 4 +-- .../DownloadedEpisodesImportService.cs | 1 - .../MediaFiles/MediaFileRepository.cs | 11 -------- NzbDrone.Core/MediaFiles/MediaFileService.cs | 12 --------- NzbDrone.Core/NzbDrone.Core.csproj | 1 - .../Qualities/QualityProfileRepository.cs | 1 - .../Qualities/QualityProfileService.cs | 1 - NzbDrone.Core/Qualities/QualitySizeService.cs | 6 ----- NzbDrone.Core/Tv/EpisodeRepository.cs | 18 ------------- NzbDrone.Core/Tv/EpisodeService.cs | 27 +------------------ NzbDrone.Core/Tv/SeasonRepository.cs | 27 ------------------- NzbDrone.Core/Tv/SeriesRepository.cs | 18 ------------- 13 files changed, 5 insertions(+), 126 deletions(-) delete mode 100644 NzbDrone.Core/Tv/SeasonRepository.cs diff --git a/NzbDrone.Api/Qualities/QualityProfileModule.cs b/NzbDrone.Api/Qualities/QualityProfileModule.cs index 1ff4379a6..a08fdb12c 100644 --- a/NzbDrone.Api/Qualities/QualityProfileModule.cs +++ b/NzbDrone.Api/Qualities/QualityProfileModule.cs @@ -8,9 +8,9 @@ namespace NzbDrone.Api.Qualities { public class QualityProfileModule : NzbDroneRestModule { - private readonly QualityProfileService _qualityProfileService; + private readonly IQualityProfileService _qualityProfileService; - public QualityProfileModule(QualityProfileService qualityProfileService) + public QualityProfileModule(IQualityProfileService qualityProfileService) : base("/qualityprofiles") { _qualityProfileService = qualityProfileService; diff --git a/NzbDrone.Api/Qualities/QualitySizeModule.cs b/NzbDrone.Api/Qualities/QualitySizeModule.cs index 27d3b329e..206bc9c51 100644 --- a/NzbDrone.Api/Qualities/QualitySizeModule.cs +++ b/NzbDrone.Api/Qualities/QualitySizeModule.cs @@ -6,9 +6,9 @@ namespace NzbDrone.Api.Qualities { public class QualitySizeModule : NzbDroneRestModule { - private readonly QualitySizeService _qualityTypeProvider; + private readonly IQualitySizeService _qualityTypeProvider; - public QualitySizeModule(QualitySizeService qualityTypeProvider) + public QualitySizeModule(IQualitySizeService qualityTypeProvider) { _qualityTypeProvider = qualityTypeProvider; diff --git a/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs b/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs index 55c6f4638..5f36b5910 100644 --- a/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs +++ b/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs @@ -8,7 +8,6 @@ using NzbDrone.Core.Configuration; using NzbDrone.Core.MediaFiles.Commands; using NzbDrone.Core.MediaFiles.EpisodeImport; using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications; -using NzbDrone.Core.Messaging; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Parser; using NzbDrone.Core.Tv; diff --git a/NzbDrone.Core/MediaFiles/MediaFileRepository.cs b/NzbDrone.Core/MediaFiles/MediaFileRepository.cs index 7a0839594..48c507c98 100644 --- a/NzbDrone.Core/MediaFiles/MediaFileRepository.cs +++ b/NzbDrone.Core/MediaFiles/MediaFileRepository.cs @@ -9,10 +9,8 @@ namespace NzbDrone.Core.MediaFiles { public interface IMediaFileRepository : IBasicRepository { - EpisodeFile GetFileByPath(string path); List GetFilesBySeries(int seriesId); List GetFilesBySeason(int seriesId, int seasonNumber); - bool Exists(string path); } @@ -23,11 +21,6 @@ namespace NzbDrone.Core.MediaFiles { } - public EpisodeFile GetFileByPath(string path) - { - return Query.SingleOrDefault(c => c.Path == path); - } - public List GetFilesBySeries(int seriesId) { return Query.Where(c => c.SeriesId == seriesId).ToList(); @@ -40,9 +33,5 @@ namespace NzbDrone.Core.MediaFiles .ToList(); } - public bool Exists(string path) - { - return Query.Any(c => c.Path == path); - } } } \ No newline at end of file diff --git a/NzbDrone.Core/MediaFiles/MediaFileService.cs b/NzbDrone.Core/MediaFiles/MediaFileService.cs index b963b408e..cb2e44ea8 100644 --- a/NzbDrone.Core/MediaFiles/MediaFileService.cs +++ b/NzbDrone.Core/MediaFiles/MediaFileService.cs @@ -14,8 +14,6 @@ namespace NzbDrone.Core.MediaFiles EpisodeFile Add(EpisodeFile episodeFile); void Update(EpisodeFile episodeFile); void Delete(EpisodeFile episodeFile, bool forUpgrade = false); - bool Exists(string path); - EpisodeFile GetFileByPath(string path); List GetFilesBySeries(int seriesId); List GetFilesBySeason(int seriesId, int seasonNumber); List FilterExistingFiles(List files, int seriesId); @@ -54,16 +52,6 @@ namespace NzbDrone.Core.MediaFiles _eventAggregator.PublishEvent(new EpisodeFileDeletedEvent(episodeFile, forUpgrade)); } - public bool Exists(string path) - { - return _mediaFileRepository.Exists(path); - } - - public EpisodeFile GetFileByPath(string path) - { - return _mediaFileRepository.GetFileByPath(path.Normalize()); - } - public List GetFilesBySeries(int seriesId) { return _mediaFileRepository.GetFilesBySeries(seriesId); diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index acb50ac6d..8d8c65364 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -407,7 +407,6 @@ - diff --git a/NzbDrone.Core/Qualities/QualityProfileRepository.cs b/NzbDrone.Core/Qualities/QualityProfileRepository.cs index 64e36b70b..408cc009e 100644 --- a/NzbDrone.Core/Qualities/QualityProfileRepository.cs +++ b/NzbDrone.Core/Qualities/QualityProfileRepository.cs @@ -1,5 +1,4 @@ using NzbDrone.Core.Datastore; -using NzbDrone.Core.Messaging; using NzbDrone.Core.Messaging.Events; diff --git a/NzbDrone.Core/Qualities/QualityProfileService.cs b/NzbDrone.Core/Qualities/QualityProfileService.cs index de79e36e9..82baaaa39 100644 --- a/NzbDrone.Core/Qualities/QualityProfileService.cs +++ b/NzbDrone.Core/Qualities/QualityProfileService.cs @@ -2,7 +2,6 @@ using System.Linq; using NLog; using NzbDrone.Core.Lifecycle; -using NzbDrone.Core.Messaging; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Tv; diff --git a/NzbDrone.Core/Qualities/QualitySizeService.cs b/NzbDrone.Core/Qualities/QualitySizeService.cs index c7719ef8b..0671a6c10 100644 --- a/NzbDrone.Core/Qualities/QualitySizeService.cs +++ b/NzbDrone.Core/Qualities/QualitySizeService.cs @@ -2,7 +2,6 @@ using System.Linq; using NLog; using NzbDrone.Core.Lifecycle; -using NzbDrone.Core.Messaging; using NzbDrone.Core.Messaging.Events; namespace NzbDrone.Core.Qualities @@ -10,7 +9,6 @@ namespace NzbDrone.Core.Qualities public interface IQualitySizeService { void Update(QualitySize qualitySize); - void UpdateAll(List qualitySizes); List All(); QualitySize Get(int qualityId); } @@ -31,10 +29,6 @@ namespace NzbDrone.Core.Qualities _qualitySizeRepository.Update(qualitySize); } - public virtual void UpdateAll(List qualitySizes) - { - _qualitySizeRepository.UpdateMany(qualitySizes); - } public virtual List All() { diff --git a/NzbDrone.Core/Tv/EpisodeRepository.cs b/NzbDrone.Core/Tv/EpisodeRepository.cs index cd12016ed..3a9ade8d9 100644 --- a/NzbDrone.Core/Tv/EpisodeRepository.cs +++ b/NzbDrone.Core/Tv/EpisodeRepository.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using Marr.Data.QGen; using NzbDrone.Core.Datastore; -using NzbDrone.Core.Messaging; using NzbDrone.Core.Messaging.Events; @@ -11,7 +10,6 @@ namespace NzbDrone.Core.Tv { public interface IEpisodeRepository : IBasicRepository { - Episode Get(int seriesId, int season, int episodeNumber); Episode Find(int seriesId, int season, int episodeNumber); Episode Get(int seriesId, DateTime date); Episode Find(int seriesId, DateTime date); @@ -19,9 +17,7 @@ namespace NzbDrone.Core.Tv List GetEpisodes(int seriesId, int seasonNumber); List GetEpisodeByFileId(int fileId); PagingSpec EpisodesWithoutFiles(PagingSpec pagingSpec, bool includeSpecials); - Episode GetEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber); Episode FindEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber); - List EpisodesWithFiles(); List EpisodesBetweenDates(DateTime startDate, DateTime endDate); void SetMonitoredFlat(Episode episode, bool monitored); void SetMonitoredBySeason(int seriesId, int seasonNumber, bool monitored); @@ -38,11 +34,6 @@ namespace NzbDrone.Core.Tv _database = database; } - public Episode Get(int seriesId, int season, int episodeNumber) - { - return Query.Single(s => s.SeriesId == seriesId && s.SeasonNumber == season && s.EpisodeNumber == episodeNumber); - } - public Episode Find(int seriesId, int season, int episodeNumber) { return Query.SingleOrDefault(s => s.SeriesId == seriesId && s.SeasonNumber == season && s.EpisodeNumber == episodeNumber); @@ -89,20 +80,11 @@ namespace NzbDrone.Core.Tv return pagingSpec; } - public Episode GetEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber) - { - return Query.Single(s => s.SeriesId == seriesId && s.SceneSeasonNumber == seasonNumber && s.SceneEpisodeNumber == episodeNumber); - } - public Episode FindEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber) { return Query.SingleOrDefault(s => s.SeriesId == seriesId && s.SceneSeasonNumber == seasonNumber && s.SceneEpisodeNumber == episodeNumber); } - public List EpisodesWithFiles() - { - return Query.Where(s => s.EpisodeFileId != 0).ToList(); - } public List EpisodesBetweenDates(DateTime startDate, DateTime endDate) { diff --git a/NzbDrone.Core/Tv/EpisodeService.cs b/NzbDrone.Core/Tv/EpisodeService.cs index 8d3f3ccd2..2e83cc659 100644 --- a/NzbDrone.Core/Tv/EpisodeService.cs +++ b/NzbDrone.Core/Tv/EpisodeService.cs @@ -6,7 +6,6 @@ using NzbDrone.Common.Instrumentation; using NzbDrone.Core.Configuration; using NzbDrone.Core.Datastore; using NzbDrone.Core.MediaFiles.Events; -using NzbDrone.Core.Messaging; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Tv.Events; @@ -15,7 +14,6 @@ namespace NzbDrone.Core.Tv public interface IEpisodeService { Episode GetEpisode(int id); - Episode GetEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useScene = false); Episode FindEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useScene = false); Episode GetEpisode(int seriesId, DateTime date); Episode FindEpisode(int seriesId, DateTime date); @@ -23,9 +21,7 @@ namespace NzbDrone.Core.Tv List GetEpisodesBySeason(int seriesId, int seasonNumber); PagingSpec EpisodesWithoutFiles(PagingSpec pagingSpec); List GetEpisodesByFileId(int episodeFileId); - List EpisodesWithFiles(); void UpdateEpisode(Episode episode); - List GetEpisodeNumbersBySeason(int seriesId, int seasonNumber); void SetEpisodeMonitored(int episodeId, bool monitored); bool IsFirstOrLastEpisodeOfSeason(int episodeId); void UpdateEpisodes(List episodes); @@ -42,8 +38,6 @@ namespace NzbDrone.Core.Tv IHandleAsync { - private static readonly Logger logger = NzbDroneLogger.GetLogger(); - private readonly IEpisodeRepository _episodeRepository; private readonly IConfigService _configService; private readonly Logger _logger; @@ -60,15 +54,6 @@ namespace NzbDrone.Core.Tv return _episodeRepository.Get(id); } - public Episode GetEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useSceneNumbering = false) - { - if (useSceneNumbering) - { - return _episodeRepository.GetEpisodeBySceneNumbering(seriesId, seasonNumber, episodeNumber); - } - return _episodeRepository.Find(seriesId, seasonNumber, episodeNumber); - } - public Episode FindEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useSceneNumbering = false) { if (useSceneNumbering) @@ -110,27 +95,17 @@ namespace NzbDrone.Core.Tv return _episodeRepository.GetEpisodeByFileId(episodeFileId); } - public List EpisodesWithFiles() - { - return _episodeRepository.EpisodesWithFiles(); - } - public void UpdateEpisode(Episode episode) { _episodeRepository.Update(episode); } - public List GetEpisodeNumbersBySeason(int seriesId, int seasonNumber) - { - return GetEpisodesBySeason(seriesId, seasonNumber).Select(c => c.Id).ToList(); - } - public void SetEpisodeMonitored(int episodeId, bool monitored) { var episode = _episodeRepository.Get(episodeId); _episodeRepository.SetMonitoredFlat(episode, monitored); - logger.Debug("Monitored flag for Episode:{0} was set to {1}", episodeId, monitored); + _logger.Debug("Monitored flag for Episode:{0} was set to {1}", episodeId, monitored); } public void SetEpisodeMonitoredBySeason(int seriesId, int seasonNumber, bool monitored) diff --git a/NzbDrone.Core/Tv/SeasonRepository.cs b/NzbDrone.Core/Tv/SeasonRepository.cs deleted file mode 100644 index 470c2e5ca..000000000 --- a/NzbDrone.Core/Tv/SeasonRepository.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using NzbDrone.Core.Datastore; -using NzbDrone.Core.Messaging; -using NzbDrone.Core.Messaging.Events; - - -namespace NzbDrone.Core.Tv -{ - public interface ISeasonRepository : IBasicRepository - { - List GetSeasonBySeries(int seriesId); - } - - public class SeasonRepository : BasicRepository, ISeasonRepository - { - public SeasonRepository(IDatabase database, IEventAggregator eventAggregator) - : base(database, eventAggregator) - { - } - - public List GetSeasonBySeries(int seriesId) - { - return Query.Single(s => s.Id == seriesId).Seasons; - } - } -} \ No newline at end of file diff --git a/NzbDrone.Core/Tv/SeriesRepository.cs b/NzbDrone.Core/Tv/SeriesRepository.cs index 161ebbac2..86f74ece3 100644 --- a/NzbDrone.Core/Tv/SeriesRepository.cs +++ b/NzbDrone.Core/Tv/SeriesRepository.cs @@ -11,13 +11,10 @@ namespace NzbDrone.Core.Tv public interface ISeriesRepository : IBasicRepository { bool SeriesPathExists(string path); - List Search(string title); Series FindByTitle(string cleanTitle); Series FindByTvdbId(int tvdbId); Series FindByTvRageId(int tvRageId); void SetSeriesType(int seriesId, SeriesTypes seriesTypes); - Series FindBySlug(string slug); - List GetSeriesPaths(); } public class SeriesRepository : BasicRepository, ISeriesRepository @@ -32,11 +29,6 @@ namespace NzbDrone.Core.Tv return Query.Any(c => c.Path == path); } - public List Search(string title) - { - return Query.Where(s => s.Title.Contains(title)); - } - public Series FindByTitle(string cleanTitle) { return Query.SingleOrDefault(s => s.CleanTitle.Equals(cleanTitle, StringComparison.InvariantCultureIgnoreCase)); @@ -56,15 +48,5 @@ namespace NzbDrone.Core.Tv { SetFields(new Series { Id = seriesId, SeriesType = seriesType }, s => s.SeriesType); } - - public Series FindBySlug(string slug) - { - return Query.SingleOrDefault(c => c.TitleSlug == slug.ToLower()); - } - - public List GetSeriesPaths() - { - return Query.Select(s => s.Path).ToList(); - } } } \ No newline at end of file