From 10f4dd5a606e82c80fe9bd378c899b31e45a01ea Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Tue, 5 Mar 2013 11:58:53 -0800 Subject: [PATCH] removed unused dependencies. --- NzbDrone.Common/SysTray/SysTrayApp.cs | 7 ++----- .../ProviderTests/SearchTests/TestSearch.cs | 2 +- .../DecisionEngine/LanguageSpecification.cs | 12 ------------ NzbDrone.Core/Instrumentation/LogService.cs | 11 +---------- .../Jobs/Implementations/DiskScanJob.cs | 4 +--- .../Jobs/Implementations/ImportNewSeriesJob.cs | 7 +------ .../Implementations/PastWeekBacklogSearchJob.cs | 6 +----- .../Implementations/RefreshEpisodeMetadata.cs | 11 ++++------- .../Jobs/Implementations/RenameSeasonJob.cs | 2 +- NzbDrone.Core/Providers/PostDownloadProvider.cs | 3 +-- .../Providers/Search/DailyEpisodeSearch.cs | 6 ++---- NzbDrone.Core/Providers/Search/EpisodeSearch.cs | 4 ++-- .../Providers/Search/PartialSeasonSearch.cs | 4 ++-- NzbDrone.Core/Providers/Search/SearchBase.cs | 4 +--- NzbDrone.Core/Providers/SearchProvider.cs | 16 +++------------- NzbDrone.Core/Providers/XemProvider.cs | 8 +------- NzbDrone.Core/RootFolders/RootFolderService.cs | 5 +---- 17 files changed, 25 insertions(+), 87 deletions(-) diff --git a/NzbDrone.Common/SysTray/SysTrayApp.cs b/NzbDrone.Common/SysTray/SysTrayApp.cs index eda39fa22..25fc80489 100644 --- a/NzbDrone.Common/SysTray/SysTrayApp.cs +++ b/NzbDrone.Common/SysTray/SysTrayApp.cs @@ -8,7 +8,6 @@ namespace NzbDrone.Common.SysTray { public class SysTrayApp : Form { - private readonly ConfigFileProvider _configFileProvider; private readonly ProcessProvider _processProvider; private readonly IHostController _hostController; private readonly EnvironmentProvider _environmentProvider; @@ -16,10 +15,8 @@ public class SysTrayApp : Form private readonly NotifyIcon _trayIcon = new NotifyIcon(); private readonly ContextMenu _trayMenu = new ContextMenu(); - public SysTrayApp(ConfigFileProvider configFileProvider, ProcessProvider processProvider, - IHostController hostController, EnvironmentProvider environmentProvider) + public SysTrayApp(ProcessProvider processProvider, IHostController hostController, EnvironmentProvider environmentProvider) { - _configFileProvider = configFileProvider; _processProvider = processProvider; _hostController = hostController; _environmentProvider = environmentProvider; @@ -34,7 +31,7 @@ public void Create() _trayMenu.MenuItems.Add("Launch Browser", LaunchBrowser); _trayMenu.MenuItems.Add("-"); _trayMenu.MenuItems.Add("Exit", OnExit); - + _trayIcon.Text = String.Format("NzbDrone - {0}", _environmentProvider.Version); _trayIcon.Icon = new Icon(Assembly.GetEntryAssembly().GetManifestResourceStream("NzbDrone.NzbDrone.ico")); diff --git a/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs b/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs index b75e148da..39d794353 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs @@ -23,7 +23,7 @@ public class TestSearch : SearchBase public TestSearch(ISeriesService seriesService, IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, SceneMappingService sceneMappingService, AllowedDownloadSpecification allowedDownloadSpecification, ISeriesRepository seriesRepository) - : base(seriesService, seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, + : base(seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, allowedDownloadSpecification) { } diff --git a/NzbDrone.Core/DecisionEngine/LanguageSpecification.cs b/NzbDrone.Core/DecisionEngine/LanguageSpecification.cs index 5e2950a41..32bd24cf2 100644 --- a/NzbDrone.Core/DecisionEngine/LanguageSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/LanguageSpecification.cs @@ -1,25 +1,13 @@ using System.Linq; using NLog; -using NzbDrone.Core.Configuration; using NzbDrone.Core.Model; namespace NzbDrone.Core.DecisionEngine { public class LanguageSpecification { - private readonly IConfigService _configService; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public LanguageSpecification(IConfigService configService) - { - _configService = configService; - } - - public LanguageSpecification() - { - - } - public virtual bool IsSatisfiedBy(EpisodeParseResult subject) { logger.Trace("Checking if report meets language requirements. {0}", subject.Language); diff --git a/NzbDrone.Core/Instrumentation/LogService.cs b/NzbDrone.Core/Instrumentation/LogService.cs index 2905da326..bb4460d3c 100644 --- a/NzbDrone.Core/Instrumentation/LogService.cs +++ b/NzbDrone.Core/Instrumentation/LogService.cs @@ -1,6 +1,4 @@ using System.Linq; -using NLog; -using NzbDrone.Common; namespace NzbDrone.Core.Instrumentation { @@ -13,17 +11,10 @@ public interface ILogService public class LogService : ILogService { private readonly ILogRepository _logRepository; - private readonly DiskProvider _diskProvider; - private readonly EnvironmentProvider _environmentProvider; - private readonly Logger _logger; - public LogService(ILogRepository logRepository, DiskProvider diskProvider, - EnvironmentProvider environmentProvider, Logger logger) + public LogService(ILogRepository logRepository) { _logRepository = logRepository; - _diskProvider = diskProvider; - _environmentProvider = environmentProvider; - _logger = logger; } public void DeleteAll() diff --git a/NzbDrone.Core/Jobs/Implementations/DiskScanJob.cs b/NzbDrone.Core/Jobs/Implementations/DiskScanJob.cs index 8f3910a2c..47294f5c1 100644 --- a/NzbDrone.Core/Jobs/Implementations/DiskScanJob.cs +++ b/NzbDrone.Core/Jobs/Implementations/DiskScanJob.cs @@ -12,16 +12,14 @@ namespace NzbDrone.Core.Jobs.Implementations { public class DiskScanJob : IJob { - private readonly ISeriesService _seriesService; private readonly DiskScanProvider _diskScanProvider; private readonly IConfigService _configService; private readonly ISeriesRepository _seriesRepository; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - public DiskScanJob(ISeriesService seriesService, DiskScanProvider diskScanProvider, + public DiskScanJob(DiskScanProvider diskScanProvider, IConfigService configService, ISeriesRepository seriesRepository) { - _seriesService = seriesService; _diskScanProvider = diskScanProvider; _configService = configService; _seriesRepository = seriesRepository; diff --git a/NzbDrone.Core/Jobs/Implementations/ImportNewSeriesJob.cs b/NzbDrone.Core/Jobs/Implementations/ImportNewSeriesJob.cs index 57e0d106b..d989b617a 100644 --- a/NzbDrone.Core/Jobs/Implementations/ImportNewSeriesJob.cs +++ b/NzbDrone.Core/Jobs/Implementations/ImportNewSeriesJob.cs @@ -16,8 +16,6 @@ namespace NzbDrone.Core.Jobs.Implementations /// public class ImportNewSeriesJob : IJob { - private readonly ISeriesService _seriesService; - private readonly IEpisodeService _episodeService; private readonly IMediaFileService _mediaFileService; private readonly UpdateInfoJob _updateInfoJob; private readonly DiskScanJob _diskScanJob; @@ -30,13 +28,10 @@ public class ImportNewSeriesJob : IJob private List _attemptedSeries; - public ImportNewSeriesJob(ISeriesService seriesService, IEpisodeService episodeService, - IMediaFileService mediaFileService, UpdateInfoJob updateInfoJob, + public ImportNewSeriesJob(IMediaFileService mediaFileService, UpdateInfoJob updateInfoJob, DiskScanJob diskScanJob, ISeasonRepository seasonRepository, XemUpdateJob xemUpdateJob, ISeriesRepository seriesRepository, ISeasonService seasonService) { - _seriesService = seriesService; - _episodeService = episodeService; _mediaFileService = mediaFileService; _updateInfoJob = updateInfoJob; _diskScanJob = diskScanJob; diff --git a/NzbDrone.Core/Jobs/Implementations/PastWeekBacklogSearchJob.cs b/NzbDrone.Core/Jobs/Implementations/PastWeekBacklogSearchJob.cs index bc0a3ce3a..39bd09600 100644 --- a/NzbDrone.Core/Jobs/Implementations/PastWeekBacklogSearchJob.cs +++ b/NzbDrone.Core/Jobs/Implementations/PastWeekBacklogSearchJob.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using NLog; -using NzbDrone.Core.Configuration; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Tv; @@ -12,16 +11,13 @@ public class PastWeekBacklogSearchJob : IJob { private readonly IEpisodeService _episodeService; private readonly EpisodeSearchJob _episodeSearchJob; - private readonly IConfigService _configService; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - public PastWeekBacklogSearchJob(IEpisodeService episodeService, EpisodeSearchJob episodeSearchJob, - IConfigService configService) + public PastWeekBacklogSearchJob(IEpisodeService episodeService, EpisodeSearchJob episodeSearchJob) { _episodeService = episodeService; _episodeSearchJob = episodeSearchJob; - _configService = configService; } public string Name diff --git a/NzbDrone.Core/Jobs/Implementations/RefreshEpisodeMetadata.cs b/NzbDrone.Core/Jobs/Implementations/RefreshEpisodeMetadata.cs index 867d26106..95a80051e 100644 --- a/NzbDrone.Core/Jobs/Implementations/RefreshEpisodeMetadata.cs +++ b/NzbDrone.Core/Jobs/Implementations/RefreshEpisodeMetadata.cs @@ -11,16 +11,13 @@ namespace NzbDrone.Core.Jobs.Implementations public class RefreshEpisodeMetadata : IJob { private readonly IMediaFileService _mediaFileService; - private readonly ISeriesService _seriesService; private readonly ISeriesRepository _seriesRepository; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - public RefreshEpisodeMetadata(IMediaFileService mediaFileService, ISeriesService seriesService, - ISeriesRepository seriesRepository) + public RefreshEpisodeMetadata(IMediaFileService mediaFileService, ISeriesRepository seriesRepository) { _mediaFileService = mediaFileService; - _seriesService = seriesService; _seriesRepository = seriesRepository; } @@ -44,10 +41,10 @@ public void Start(ProgressNotification notification, dynamic options) else seriesToRefresh = new List { _seriesRepository.Get(options.SeriesId) }; - foreach(var series in seriesToRefresh) + foreach (var series in seriesToRefresh) { - RefreshMetadata(notification, series); - } + RefreshMetadata(notification, series); + } } private void RefreshMetadata(ProgressNotification notification, Series series) diff --git a/NzbDrone.Core/Jobs/Implementations/RenameSeasonJob.cs b/NzbDrone.Core/Jobs/Implementations/RenameSeasonJob.cs index d5e3f4e97..140a922e5 100644 --- a/NzbDrone.Core/Jobs/Implementations/RenameSeasonJob.cs +++ b/NzbDrone.Core/Jobs/Implementations/RenameSeasonJob.cs @@ -20,7 +20,7 @@ public class RenameSeasonJob : IJob private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public RenameSeasonJob(IMediaFileService mediaFileService, DiskScanProvider diskScanProvider, ISeriesService seriesService, + public RenameSeasonJob(IMediaFileService mediaFileService, DiskScanProvider diskScanProvider, ISeriesRepository seriesRepository, IEventAggregator eventAggregator) { _mediaFileService = mediaFileService; diff --git a/NzbDrone.Core/Providers/PostDownloadProvider.cs b/NzbDrone.Core/Providers/PostDownloadProvider.cs index fc2f32cfd..9adc0cddc 100644 --- a/NzbDrone.Core/Providers/PostDownloadProvider.cs +++ b/NzbDrone.Core/Providers/PostDownloadProvider.cs @@ -18,8 +18,7 @@ public class PostDownloadProvider private readonly DiskScanProvider _diskScanProvider; private readonly ISeriesRepository _seriesRepository; - public PostDownloadProvider(DiskProvider diskProvider, DiskScanProvider diskScanProvider, - ISeriesService seriesService, ISeriesRepository seriesRepository) + public PostDownloadProvider(DiskProvider diskProvider, DiskScanProvider diskScanProvider, ISeriesRepository seriesRepository) { _diskProvider = diskProvider; _diskScanProvider = diskScanProvider; diff --git a/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs b/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs index acc76bc71..6b9837b19 100644 --- a/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs +++ b/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs @@ -18,16 +18,14 @@ namespace NzbDrone.Core.Providers.Search { public class DailyEpisodeSearch : SearchBase { - private readonly ISeriesRepository _seriesRepository; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public DailyEpisodeSearch(ISeriesService seriesService, IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, + public DailyEpisodeSearch(IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, SceneMappingService sceneMappingService, AllowedDownloadSpecification allowedDownloadSpecification, ISeriesRepository seriesRepository) - : base(seriesService, seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, + : base(seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, allowedDownloadSpecification) { - _seriesRepository = seriesRepository; } public DailyEpisodeSearch() diff --git a/NzbDrone.Core/Providers/Search/EpisodeSearch.cs b/NzbDrone.Core/Providers/Search/EpisodeSearch.cs index dc2009229..264724954 100644 --- a/NzbDrone.Core/Providers/Search/EpisodeSearch.cs +++ b/NzbDrone.Core/Providers/Search/EpisodeSearch.cs @@ -20,10 +20,10 @@ public class EpisodeSearch : SearchBase { private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public EpisodeSearch(ISeriesService seriesService, IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, + public EpisodeSearch(IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, SceneMappingService sceneMappingService, AllowedDownloadSpecification allowedDownloadSpecification, ISeriesRepository seriesRepository) - : base(seriesService,seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, + : base(seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, allowedDownloadSpecification) { } diff --git a/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs b/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs index 894689609..22723bb84 100644 --- a/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs +++ b/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs @@ -20,10 +20,10 @@ public class PartialSeasonSearch : SearchBase { private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public PartialSeasonSearch(ISeriesService seriesService, IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, + public PartialSeasonSearch(IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, SceneMappingService sceneMappingService, AllowedDownloadSpecification allowedDownloadSpecification, ISeriesRepository seriesRepository) - : base(seriesService, seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, + : base(seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService, allowedDownloadSpecification) { } diff --git a/NzbDrone.Core/Providers/Search/SearchBase.cs b/NzbDrone.Core/Providers/Search/SearchBase.cs index 202e5094d..14e51f673 100644 --- a/NzbDrone.Core/Providers/Search/SearchBase.cs +++ b/NzbDrone.Core/Providers/Search/SearchBase.cs @@ -17,7 +17,6 @@ namespace NzbDrone.Core.Providers.Search { public abstract class SearchBase { - protected readonly ISeriesService _seriesService; private readonly ISeriesRepository _seriesRepository; protected readonly IEpisodeService _episodeService; protected readonly DownloadProvider _downloadProvider; @@ -27,11 +26,10 @@ public abstract class SearchBase private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - protected SearchBase(ISeriesService seriesService,ISeriesRepository seriesRepository, IEpisodeService episodeService, DownloadProvider downloadProvider, + protected SearchBase(ISeriesRepository seriesRepository, IEpisodeService episodeService, DownloadProvider downloadProvider, IIndexerService indexerService, SceneMappingService sceneMappingService, AllowedDownloadSpecification allowedDownloadSpecification) { - _seriesService = seriesService; _seriesRepository = seriesRepository; _episodeService = episodeService; _downloadProvider = downloadProvider; diff --git a/NzbDrone.Core/Providers/SearchProvider.cs b/NzbDrone.Core/Providers/SearchProvider.cs index 4049923db..0e52836ee 100644 --- a/NzbDrone.Core/Providers/SearchProvider.cs +++ b/NzbDrone.Core/Providers/SearchProvider.cs @@ -1,32 +1,22 @@ -using System; -using System.Collections; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using NLog; using NzbDrone.Core.Tv; -using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; -using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Providers.Search; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Search; namespace NzbDrone.Core.Providers { public class SearchProvider { - private readonly ISeriesService _seriesService; private readonly IEpisodeService _episodeService; private readonly PartialSeasonSearch _partialSeasonSearch; private readonly ISeriesRepository _seriesRepository; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public SearchProvider(ISeriesService seriesService, IEpisodeService episodeService, - PartialSeasonSearch partialSeasonSearch,ISeriesRepository seriesRepository) + public SearchProvider(IEpisodeService episodeService, PartialSeasonSearch partialSeasonSearch, ISeriesRepository seriesRepository) { - _seriesService = seriesService; _episodeService = episodeService; _partialSeasonSearch = partialSeasonSearch; _seriesRepository = seriesRepository; @@ -89,7 +79,7 @@ public virtual List PartialSeasonSearch(ProgressNotification notification, return new List(); } - return _partialSeasonSearch.Search(series, new {SeasonNumber = seasonNumber, Episodes = episodes}, notification); + return _partialSeasonSearch.Search(series, new { SeasonNumber = seasonNumber, Episodes = episodes }, notification); } } } diff --git a/NzbDrone.Core/Providers/XemProvider.cs b/NzbDrone.Core/Providers/XemProvider.cs index 930ae0328..5029778e2 100644 --- a/NzbDrone.Core/Providers/XemProvider.cs +++ b/NzbDrone.Core/Providers/XemProvider.cs @@ -1,27 +1,21 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using NLog; -using NzbDrone.Core.Datastore; using NzbDrone.Core.Tv; -using NzbDrone.Core.Repository; namespace NzbDrone.Core.Providers { public class XemProvider { - private readonly ISeriesService _seriesService; private readonly IEpisodeService _episodeService; private readonly XemCommunicationProvider _xemCommunicationProvider; private readonly ISeriesRepository _seriesRepository; private static readonly Logger _logger = LogManager.GetCurrentClassLogger(); - public XemProvider(ISeriesService seriesService, IEpisodeService episodeService, - XemCommunicationProvider xemCommunicationProvider,ISeriesRepository seriesRepository) + public XemProvider(IEpisodeService episodeService,XemCommunicationProvider xemCommunicationProvider,ISeriesRepository seriesRepository) { - _seriesService = seriesService; _episodeService = episodeService; _xemCommunicationProvider = xemCommunicationProvider; _seriesRepository = seriesRepository; diff --git a/NzbDrone.Core/RootFolders/RootFolderService.cs b/NzbDrone.Core/RootFolders/RootFolderService.cs index 64a91dff9..28a42f18b 100644 --- a/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -6,7 +6,6 @@ using NzbDrone.Common; using NzbDrone.Core.Datastore; using NzbDrone.Core.Tv; -using NzbDrone.Core.Providers; namespace NzbDrone.Core.RootFolders { @@ -25,14 +24,12 @@ public class RootFolderService : IRootFolderService private readonly IBasicRepository _rootFolderRepository; private readonly DiskProvider _diskProvider; private readonly ISeriesRepository _seriesRepository; - private readonly ISeriesService _seriesService; - public RootFolderService(IBasicRepository rootFolderRepository, ISeriesService seriesService, DiskProvider diskProvider,ISeriesRepository seriesRepository) + public RootFolderService(IBasicRepository rootFolderRepository, DiskProvider diskProvider,ISeriesRepository seriesRepository) { _rootFolderRepository = rootFolderRepository; _diskProvider = diskProvider; _seriesRepository = seriesRepository; - _seriesService = seriesService; } public virtual List All()