From d722a8357b287adf9b6d6e2e0d4d87041c3622db Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Fri, 22 Feb 2013 15:55:43 -0800 Subject: [PATCH] this should fix some more tests. --- .../ProviderTests/SearchTests/TestSearch.cs | 2 +- NzbDrone.Core/Jobs/BannerDownloadJob.cs | 2 +- NzbDrone.Core/Jobs/ConvertEpisodeJob.cs | 2 +- NzbDrone.Core/Jobs/DeleteSeriesJob.cs | 2 +- NzbDrone.Core/Jobs/DiskScanJob.cs | 2 +- NzbDrone.Core/Jobs/EpisodeSearchJob.cs | 2 +- NzbDrone.Core/Jobs/RenameSeasonJob.cs | 8 ++++---- NzbDrone.Core/Jobs/RenameSeriesJob.cs | 2 +- NzbDrone.Core/Jobs/SeasonSearchJob.cs | 2 +- NzbDrone.Core/Jobs/SeriesSearchJob.cs | 4 ++-- NzbDrone.Core/Jobs/UpdateInfoJob.cs | 9 ++++++--- NzbDrone.Core/Jobs/XemUpdateJob.cs | 4 ++-- 12 files changed, 22 insertions(+), 19 deletions(-) diff --git a/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs b/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs index 972d16995..717d0c946 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchTests/TestSearch.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests private static readonly Logger logger = LogManager.GetCurrentClassLogger(); public TestSearch(ISeriesService seriesService, IEpisodeService episodeService, DownloadProvider downloadProvider, - IndexerService indexerService, SceneMappingProvider sceneMappingProvider, + IIndexerService indexerService, SceneMappingProvider sceneMappingProvider, AllowedDownloadSpecification allowedDownloadSpecification, SearchHistoryProvider searchHistoryProvider,ISeriesRepository seriesRepository) : base(seriesService, seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingProvider, allowedDownloadSpecification, searchHistoryProvider) diff --git a/NzbDrone.Core/Jobs/BannerDownloadJob.cs b/NzbDrone.Core/Jobs/BannerDownloadJob.cs index 4718b2c79..b924407dc 100644 --- a/NzbDrone.Core/Jobs/BannerDownloadJob.cs +++ b/NzbDrone.Core/Jobs/BannerDownloadJob.cs @@ -47,7 +47,7 @@ namespace NzbDrone.Core.Jobs if (options != null) { - Series series = _seriesRepository.Get(options.SeriesId); + Series series = _seriesRepository.Get((int)options.SeriesId); if (series != null && !String.IsNullOrEmpty(series.BannerUrl)) { diff --git a/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs b/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs index 4aaa8e6ea..94b0b5fb7 100644 --- a/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs +++ b/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Jobs if (options == null || options.EpisodeId <= 0) throw new ArgumentNullException(options); - Episode episode = _episodeService.GetEpisode(options.EpisodeId); + Episode episode = _episodeService.GetEpisode((int)options.EpisodeId); notification.CurrentMessage = String.Format("Starting Conversion for {0}", episode); var outputFile = _handbrakeProvider.ConvertFile(episode, notification); diff --git a/NzbDrone.Core/Jobs/DeleteSeriesJob.cs b/NzbDrone.Core/Jobs/DeleteSeriesJob.cs index b662ab10b..b01cb0cf5 100644 --- a/NzbDrone.Core/Jobs/DeleteSeriesJob.cs +++ b/NzbDrone.Core/Jobs/DeleteSeriesJob.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Jobs if (options.SeriesId == 0) throw new ArgumentNullException("options.SeriesId"); - DeleteSeries(notification, options.SeriesId, options.DeleteFiles); + DeleteSeries(notification, (int)options.SeriesId, (bool)options.DeleteFiles); } private void DeleteSeries(ProgressNotification notification, int seriesId, bool deleteFiles) diff --git a/NzbDrone.Core/Jobs/DiskScanJob.cs b/NzbDrone.Core/Jobs/DiskScanJob.cs index 0dc6e9d40..0842c4976 100644 --- a/NzbDrone.Core/Jobs/DiskScanJob.cs +++ b/NzbDrone.Core/Jobs/DiskScanJob.cs @@ -55,7 +55,7 @@ namespace NzbDrone.Core.Jobs } else { - seriesToScan = new List() { _seriesRepository.Get(options.SeriesId) }; + seriesToScan = new List() { _seriesRepository.Get((int)options.SeriesId) }; } foreach (var series in seriesToScan) diff --git a/NzbDrone.Core/Jobs/EpisodeSearchJob.cs b/NzbDrone.Core/Jobs/EpisodeSearchJob.cs index 4021f4a97..a7c462646 100644 --- a/NzbDrone.Core/Jobs/EpisodeSearchJob.cs +++ b/NzbDrone.Core/Jobs/EpisodeSearchJob.cs @@ -49,7 +49,7 @@ namespace NzbDrone.Core.Jobs if (options == null || options.EpisodeId <= 0) throw new ArgumentException("options"); - Episode episode = _episodeService.GetEpisode(options.EpisodeId); + Episode episode = _episodeService.GetEpisode((int)options.EpisodeId); if (episode == null) { diff --git a/NzbDrone.Core/Jobs/RenameSeasonJob.cs b/NzbDrone.Core/Jobs/RenameSeasonJob.cs index b3c09f8c7..f594ba55f 100644 --- a/NzbDrone.Core/Jobs/RenameSeasonJob.cs +++ b/NzbDrone.Core/Jobs/RenameSeasonJob.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.Jobs public RenameSeasonJob(MediaFileProvider mediaFileProvider, DiskScanProvider diskScanProvider, ExternalNotificationProvider externalNotificationProvider, ISeriesService seriesService, - MetadataProvider metadataProvider,ISeriesRepository seriesRepository) + MetadataProvider metadataProvider, ISeriesRepository seriesRepository) { _mediaFileProvider = mediaFileProvider; _diskScanProvider = diskScanProvider; @@ -49,12 +49,12 @@ namespace NzbDrone.Core.Jobs if (options.SeasonNumber < 0) throw new ArgumentException("options.SeasonNumber"); - var series = _seriesRepository.Get(options.SeriesId); + var series = _seriesRepository.Get((int)options.SeriesId); notification.CurrentMessage = String.Format("Renaming episodes for {0} Season {1}", series.Title, options.SeasonNumber); logger.Debug("Getting episodes from database for series: {0} and season: {1}", options.SeriesId, options.SeasonNumber); - IList episodeFiles = _mediaFileProvider.GetSeasonFiles(options.SeriesId, options.SeasonNumber); + IList episodeFiles = _mediaFileProvider.GetSeasonFiles((int)options.SeriesId, (int)options.SeasonNumber); if (episodeFiles == null || !episodeFiles.Any()) { @@ -85,7 +85,7 @@ namespace NzbDrone.Core.Jobs } } - if(!oldEpisodeFiles.Any()) + if (!oldEpisodeFiles.Any()) { logger.Trace("No episodes were renamed for: {0} Season {1}, no changes were made", series.Title, options.SeasonNumber); diff --git a/NzbDrone.Core/Jobs/RenameSeriesJob.cs b/NzbDrone.Core/Jobs/RenameSeriesJob.cs index ded5ad566..2b8d17ba8 100644 --- a/NzbDrone.Core/Jobs/RenameSeriesJob.cs +++ b/NzbDrone.Core/Jobs/RenameSeriesJob.cs @@ -53,7 +53,7 @@ namespace NzbDrone.Core.Jobs else { - seriesToRename = new List{ _seriesRepository.Get(options.SeriesId) }; + seriesToRename = new List{ _seriesRepository.Get((int)options.SeriesId) }; } foreach(var series in seriesToRename) diff --git a/NzbDrone.Core/Jobs/SeasonSearchJob.cs b/NzbDrone.Core/Jobs/SeasonSearchJob.cs index 1d838d391..ca9190aed 100644 --- a/NzbDrone.Core/Jobs/SeasonSearchJob.cs +++ b/NzbDrone.Core/Jobs/SeasonSearchJob.cs @@ -57,7 +57,7 @@ namespace NzbDrone.Core.Jobs // return; Logger.Debug("Getting episodes from database for series: {0} and season: {1}", options.SeriesId, options.SeasonNumber); - List episodes = _episodeService.GetEpisodesBySeason(options.SeriesId, options.SeasonNumber); + IList episodes = _episodeService.GetEpisodesBySeason((int)options.SeriesId, (int)options.SeasonNumber); if (episodes == null || episodes.Count == 0) { diff --git a/NzbDrone.Core/Jobs/SeriesSearchJob.cs b/NzbDrone.Core/Jobs/SeriesSearchJob.cs index 6bb06e923..900ef6ca3 100644 --- a/NzbDrone.Core/Jobs/SeriesSearchJob.cs +++ b/NzbDrone.Core/Jobs/SeriesSearchJob.cs @@ -38,11 +38,11 @@ namespace NzbDrone.Core.Jobs throw new ArgumentException("options.SeriesId"); logger.Debug("Getting seasons from database for series: {0}", options.SeriesId); - IList seasons = _seasonRepository.GetSeasonBySeries(options.SeriesId); + IList seasons = _seasonRepository.GetSeasonNumbers((int)options.SeriesId); foreach (var season in seasons.Where(s => s > 0)) { - if (!_seasonRepository.IsIgnored(options.SeriesId, season)) + if (!_seasonRepository.IsIgnored((int)options.SeriesId, season)) { _seasonSearchJob.Start(notification, new { SeriesId = options.SeriesId, SeasonNumber = season }); } diff --git a/NzbDrone.Core/Jobs/UpdateInfoJob.cs b/NzbDrone.Core/Jobs/UpdateInfoJob.cs index 79f3e520c..4cb5d1d43 100644 --- a/NzbDrone.Core/Jobs/UpdateInfoJob.cs +++ b/NzbDrone.Core/Jobs/UpdateInfoJob.cs @@ -58,7 +58,10 @@ namespace NzbDrone.Core.Jobs } else { - seriesToUpdate = new List { _seriesRepository.Get(options.SeriesId) }; + seriesToUpdate = new List + { + _seriesRepository.Get((int)options.SeriesId) + }; } //Update any Daily Series in the DB with the IsDaily flag @@ -74,11 +77,11 @@ namespace NzbDrone.Core.Jobs notification.CurrentMessage = "Update completed for " + series.Title; } - catch(Exception ex) + catch (Exception ex) { Logger.ErrorException("Failed to update episode info for series: " + series.Title, ex); } - + } } } diff --git a/NzbDrone.Core/Jobs/XemUpdateJob.cs b/NzbDrone.Core/Jobs/XemUpdateJob.cs index 251884e9e..50f1d902d 100644 --- a/NzbDrone.Core/Jobs/XemUpdateJob.cs +++ b/NzbDrone.Core/Jobs/XemUpdateJob.cs @@ -46,9 +46,9 @@ namespace NzbDrone.Core.Jobs else { _logger.Trace("Starting XEM Update for series: {0}", options.SeriesId); - _xemProvider.UpdateMappings(options.SeriesId); + _xemProvider.UpdateMappings((int)options.SeriesId); } - + _logger.Trace("XEM Update complete"); } }