diff --git a/NzbDrone.Api/Series/SeriesModule.cs b/NzbDrone.Api/Series/SeriesModule.cs index 1ddf6e595b..02ed3638b7 100644 --- a/NzbDrone.Api/Series/SeriesModule.cs +++ b/NzbDrone.Api/Series/SeriesModule.cs @@ -8,6 +8,7 @@ using NzbDrone.Api.Extensions; using NzbDrone.Common; using NzbDrone.Core.Datastore; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Jobs; using NzbDrone.Core.Model; @@ -18,9 +19,9 @@ public class SeriesModule : NzbDroneApiModule { private readonly ISeriesService _seriesService; private readonly ISeriesRepository _seriesRepository; - private readonly JobController _jobProvider; + private readonly IJobController _jobProvider; - public SeriesModule(ISeriesService seriesService,ISeriesRepository seriesRepository, JobController jobProvider) + public SeriesModule(ISeriesService seriesService,ISeriesRepository seriesRepository, IJobController jobProvider) : base("/Series") { _seriesService = seriesService; @@ -60,7 +61,7 @@ private Response AddSeries() //We also need to remove any special characters from the filename before attempting to create it _seriesService.AddSeries(request.Title, request.Path, request.TvDbId, request.QualityProfileId, null); - _jobProvider.QueueJob(typeof(ImportNewSeriesJob)); + _jobProvider.Enqueue(typeof(ImportNewSeriesJob)); return new Response { StatusCode = HttpStatusCode.Created }; } @@ -89,7 +90,7 @@ private Response UpdateSeries() _seriesRepository.Update(series); if (oldPath != series.Path) - _jobProvider.QueueJob(typeof(DiskScanJob), new { SeriesId = series.Id }); + _jobProvider.Enqueue(typeof(DiskScanJob), new { SeriesId = series.Id }); _seriesRepository.Update(series); @@ -99,7 +100,7 @@ private Response UpdateSeries() private Response DeleteSeries(int id) { var deleteFiles = Convert.ToBoolean(Request.Headers["deleteFiles"].FirstOrDefault()); - _jobProvider.QueueJob(typeof(DeleteSeriesJob), new { SeriesId = id, DeleteFiles = deleteFiles }); + _jobProvider.Enqueue(typeof(DeleteSeriesJob), new { SeriesId = id, DeleteFiles = deleteFiles }); return new Response { StatusCode = HttpStatusCode.OK }; } } diff --git a/NzbDrone.Core.Test/JobTests/JobControllerFixture.cs b/NzbDrone.Core.Test/JobTests/JobControllerFixture.cs index 263b4343f0..68c70067d6 100644 --- a/NzbDrone.Core.Test/JobTests/JobControllerFixture.cs +++ b/NzbDrone.Core.Test/JobTests/JobControllerFixture.cs @@ -7,6 +7,7 @@ using NCrunch.Framework; using NUnit.Framework; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model; using NzbDrone.Core.Test.Framework; using NzbDrone.Test.Common; diff --git a/NzbDrone.Core.Test/JobTests/JobRepositoryFixture.cs b/NzbDrone.Core.Test/JobTests/JobRepositoryFixture.cs index 7d0685c660..60bb405276 100644 --- a/NzbDrone.Core.Test/JobTests/JobRepositoryFixture.cs +++ b/NzbDrone.Core.Test/JobTests/JobRepositoryFixture.cs @@ -10,6 +10,7 @@ using NUnit.Framework; using NzbDrone.Common; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model; using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; diff --git a/NzbDrone.Core.Test/JobTests/TestJobs.cs b/NzbDrone.Core.Test/JobTests/TestJobs.cs index fe3a05ca02..3cba3bff12 100644 --- a/NzbDrone.Core.Test/JobTests/TestJobs.cs +++ b/NzbDrone.Core.Test/JobTests/TestJobs.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; namespace NzbDrone.Core.Test.JobTests diff --git a/NzbDrone.Core/Instrumentation/TrimLogsJob.cs b/NzbDrone.Core/Instrumentation/TrimLogsJob.cs index f25ff4ddaf..057176de97 100644 --- a/NzbDrone.Core/Instrumentation/TrimLogsJob.cs +++ b/NzbDrone.Core/Instrumentation/TrimLogsJob.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; namespace NzbDrone.Core.Instrumentation diff --git a/NzbDrone.Core/Jobs/BacklogSearchJob.cs b/NzbDrone.Core/Jobs/BacklogSearchJob.cs index b30a77174d..aa8a3d9cc7 100644 --- a/NzbDrone.Core/Jobs/BacklogSearchJob.cs +++ b/NzbDrone.Core/Jobs/BacklogSearchJob.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/CleanupRecycleBinJob.cs b/NzbDrone.Core/Jobs/CleanupRecycleBinJob.cs index 6c8ea00fea..cdbf4165e7 100644 --- a/NzbDrone.Core/Jobs/CleanupRecycleBinJob.cs +++ b/NzbDrone.Core/Jobs/CleanupRecycleBinJob.cs @@ -1,6 +1,7 @@ using System.Linq; using System; using NLog; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Converting; diff --git a/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs b/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs index 94b0b5fb7a..e5044553c0 100644 --- a/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs +++ b/NzbDrone.Core/Jobs/ConvertEpisodeJob.cs @@ -1,6 +1,7 @@ using System.Linq; using System; using NLog; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; diff --git a/NzbDrone.Core/Jobs/DeleteSeriesJob.cs b/NzbDrone.Core/Jobs/DeleteSeriesJob.cs index b01cb0cf53..db9a92e147 100644 --- a/NzbDrone.Core/Jobs/DeleteSeriesJob.cs +++ b/NzbDrone.Core/Jobs/DeleteSeriesJob.cs @@ -2,6 +2,7 @@ using System; using NLog; using NzbDrone.Common; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; diff --git a/NzbDrone.Core/Jobs/DiskScanJob.cs b/NzbDrone.Core/Jobs/DiskScanJob.cs index 87f2a4b988..e2cdaf6cf7 100644 --- a/NzbDrone.Core/Jobs/DiskScanJob.cs +++ b/NzbDrone.Core/Jobs/DiskScanJob.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Helpers; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/EmptyRecycleBinJob.cs b/NzbDrone.Core/Jobs/EmptyRecycleBinJob.cs index 9d586993e9..b9ee8e6417 100644 --- a/NzbDrone.Core/Jobs/EmptyRecycleBinJob.cs +++ b/NzbDrone.Core/Jobs/EmptyRecycleBinJob.cs @@ -1,6 +1,7 @@ using System.Linq; using System; using NLog; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Converting; diff --git a/NzbDrone.Core/Jobs/EpisodeSearchJob.cs b/NzbDrone.Core/Jobs/EpisodeSearchJob.cs index 406f645502..85fb1a8813 100644 --- a/NzbDrone.Core/Jobs/EpisodeSearchJob.cs +++ b/NzbDrone.Core/Jobs/EpisodeSearchJob.cs @@ -1,6 +1,7 @@ using System.Linq; using System; using NLog; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; diff --git a/NzbDrone.Core/Jobs/IJob.cs b/NzbDrone.Core/Jobs/Framework/IJob.cs similarity index 96% rename from NzbDrone.Core/Jobs/IJob.cs rename to NzbDrone.Core/Jobs/Framework/IJob.cs index 6b8dcb8f72..585fbfcf77 100644 --- a/NzbDrone.Core/Jobs/IJob.cs +++ b/NzbDrone.Core/Jobs/Framework/IJob.cs @@ -2,7 +2,7 @@ using System.Linq; using NzbDrone.Core.Model.Notification; -namespace NzbDrone.Core.Jobs +namespace NzbDrone.Core.Jobs.Framework { public interface IJob { diff --git a/NzbDrone.Core/Jobs/JobController.cs b/NzbDrone.Core/Jobs/Framework/JobController.cs similarity index 99% rename from NzbDrone.Core/Jobs/JobController.cs rename to NzbDrone.Core/Jobs/Framework/JobController.cs index c85d5be63a..4b40422126 100644 --- a/NzbDrone.Core/Jobs/JobController.cs +++ b/NzbDrone.Core/Jobs/Framework/JobController.cs @@ -6,11 +6,10 @@ using System.Threading; using System.Threading.Tasks; using NLog; -using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; -namespace NzbDrone.Core.Jobs +namespace NzbDrone.Core.Jobs.Framework { public interface IJobController { diff --git a/NzbDrone.Core/Jobs/JobDefinition.cs b/NzbDrone.Core/Jobs/Framework/JobDefinition.cs similarity index 91% rename from NzbDrone.Core/Jobs/JobDefinition.cs rename to NzbDrone.Core/Jobs/Framework/JobDefinition.cs index 056b655bf4..0c7d02814c 100644 --- a/NzbDrone.Core/Jobs/JobDefinition.cs +++ b/NzbDrone.Core/Jobs/Framework/JobDefinition.cs @@ -2,7 +2,7 @@ using System; using NzbDrone.Core.Datastore; -namespace NzbDrone.Core.Jobs +namespace NzbDrone.Core.Jobs.Framework { public class JobDefinition : ModelBase { diff --git a/NzbDrone.Core/Model/JobQueueItem.cs b/NzbDrone.Core/Jobs/Framework/JobQueueItem.cs similarity index 88% rename from NzbDrone.Core/Model/JobQueueItem.cs rename to NzbDrone.Core/Jobs/Framework/JobQueueItem.cs index 69f562e9d5..06ee45ced4 100644 --- a/NzbDrone.Core/Model/JobQueueItem.cs +++ b/NzbDrone.Core/Jobs/Framework/JobQueueItem.cs @@ -1,6 +1,7 @@ -using System; +using System.Linq; +using System; -namespace NzbDrone.Core.Model +namespace NzbDrone.Core.Jobs.Framework { public class JobQueueItem : IEquatable { diff --git a/NzbDrone.Core/Jobs/JobRepository.cs b/NzbDrone.Core/Jobs/Framework/JobRepository.cs similarity index 98% rename from NzbDrone.Core/Jobs/JobRepository.cs rename to NzbDrone.Core/Jobs/Framework/JobRepository.cs index 1286454fa5..4bb8a1987f 100644 --- a/NzbDrone.Core/Jobs/JobRepository.cs +++ b/NzbDrone.Core/Jobs/Framework/JobRepository.cs @@ -5,7 +5,7 @@ using NzbDrone.Core.Datastore; using NzbDrone.Core.Lifecycle; -namespace NzbDrone.Core.Jobs +namespace NzbDrone.Core.Jobs.Framework { public interface IJobRepository : IInitializable, IBasicRepository { diff --git a/NzbDrone.Core/Jobs/ImportNewSeriesJob.cs b/NzbDrone.Core/Jobs/ImportNewSeriesJob.cs index 28204a1344..67da7106b4 100644 --- a/NzbDrone.Core/Jobs/ImportNewSeriesJob.cs +++ b/NzbDrone.Core/Jobs/ImportNewSeriesJob.cs @@ -4,6 +4,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Datastore; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/PastWeekBacklogSearchJob.cs b/NzbDrone.Core/Jobs/PastWeekBacklogSearchJob.cs index 27a3e8be97..29a1aeb33a 100644 --- a/NzbDrone.Core/Jobs/PastWeekBacklogSearchJob.cs +++ b/NzbDrone.Core/Jobs/PastWeekBacklogSearchJob.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/PostDownloadScanJob.cs b/NzbDrone.Core/Jobs/PostDownloadScanJob.cs index 43879a5e49..04d409110c 100644 --- a/NzbDrone.Core/Jobs/PostDownloadScanJob.cs +++ b/NzbDrone.Core/Jobs/PostDownloadScanJob.cs @@ -3,6 +3,7 @@ using NLog; using NzbDrone.Common; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Core; diff --git a/NzbDrone.Core/Jobs/RecentBacklogSearchJob.cs b/NzbDrone.Core/Jobs/RecentBacklogSearchJob.cs index 8ddf178f8a..0863f23e0b 100644 --- a/NzbDrone.Core/Jobs/RecentBacklogSearchJob.cs +++ b/NzbDrone.Core/Jobs/RecentBacklogSearchJob.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/RefreshEpsiodeMetadata.cs b/NzbDrone.Core/Jobs/RefreshEpsiodeMetadata.cs index 9ba842aa4d..9e83982140 100644 --- a/NzbDrone.Core/Jobs/RefreshEpsiodeMetadata.cs +++ b/NzbDrone.Core/Jobs/RefreshEpsiodeMetadata.cs @@ -3,6 +3,7 @@ using System; using NLog; using NzbDrone.Core.Datastore; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/RenameSeasonJob.cs b/NzbDrone.Core/Jobs/RenameSeasonJob.cs index da01a1d2f3..24e3aa264e 100644 --- a/NzbDrone.Core/Jobs/RenameSeasonJob.cs +++ b/NzbDrone.Core/Jobs/RenameSeasonJob.cs @@ -5,6 +5,7 @@ using NzbDrone.Common.Eventing; using NzbDrone.Core.Download; using NzbDrone.Core.ExternalNotification; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/RenameSeriesJob.cs b/NzbDrone.Core/Jobs/RenameSeriesJob.cs index fa11bf111a..8e8aab6f50 100644 --- a/NzbDrone.Core/Jobs/RenameSeriesJob.cs +++ b/NzbDrone.Core/Jobs/RenameSeriesJob.cs @@ -4,6 +4,7 @@ using NLog; using NzbDrone.Common.Eventing; using NzbDrone.Core.Download; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Jobs/RssSyncJob.cs b/NzbDrone.Core/Jobs/RssSyncJob.cs index a9c86a88cf..1b48b37b6b 100644 --- a/NzbDrone.Core/Jobs/RssSyncJob.cs +++ b/NzbDrone.Core/Jobs/RssSyncJob.cs @@ -6,6 +6,7 @@ using NzbDrone.Core.Configuration; using NzbDrone.Core.Download; using NzbDrone.Core.Indexers; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; diff --git a/NzbDrone.Core/Jobs/SeasonSearchJob.cs b/NzbDrone.Core/Jobs/SeasonSearchJob.cs index f2a0be6a14..982e537655 100644 --- a/NzbDrone.Core/Jobs/SeasonSearchJob.cs +++ b/NzbDrone.Core/Jobs/SeasonSearchJob.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using NLog; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; diff --git a/NzbDrone.Core/Jobs/SeriesSearchJob.cs b/NzbDrone.Core/Jobs/SeriesSearchJob.cs index 900ef6ca3f..cf4bebdd13 100644 --- a/NzbDrone.Core/Jobs/SeriesSearchJob.cs +++ b/NzbDrone.Core/Jobs/SeriesSearchJob.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using NLog; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Tv; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; diff --git a/NzbDrone.Core/Jobs/UpdateInfoJob.cs b/NzbDrone.Core/Jobs/UpdateInfoJob.cs index 6a37c72310..f26fedc2f4 100644 --- a/NzbDrone.Core/Jobs/UpdateInfoJob.cs +++ b/NzbDrone.Core/Jobs/UpdateInfoJob.cs @@ -4,6 +4,7 @@ using NLog; using NzbDrone.Core.Configuration; using NzbDrone.Core.Datastore; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.ReferenceData; using NzbDrone.Core.Tv; using NzbDrone.Core.Helpers; diff --git a/NzbDrone.Core/Jobs/UpdateSceneMappingsJob.cs b/NzbDrone.Core/Jobs/UpdateSceneMappingsJob.cs index ada62d5f65..4f6a609751 100644 --- a/NzbDrone.Core/Jobs/UpdateSceneMappingsJob.cs +++ b/NzbDrone.Core/Jobs/UpdateSceneMappingsJob.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.ReferenceData; diff --git a/NzbDrone.Core/Jobs/XemUpdateJob.cs b/NzbDrone.Core/Jobs/XemUpdateJob.cs index 50f1d902d5..d7f524f100 100644 --- a/NzbDrone.Core/Jobs/XemUpdateJob.cs +++ b/NzbDrone.Core/Jobs/XemUpdateJob.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Helpers; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; diff --git a/NzbDrone.Core/Lifecycle/AppRestartJob.cs b/NzbDrone.Core/Lifecycle/AppRestartJob.cs index 33643e5aef..de761b08ec 100644 --- a/NzbDrone.Core/Lifecycle/AppRestartJob.cs +++ b/NzbDrone.Core/Lifecycle/AppRestartJob.cs @@ -3,6 +3,7 @@ using NLog; using NzbDrone.Common; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; namespace NzbDrone.Core.Lifecycle diff --git a/NzbDrone.Core/Lifecycle/AppShutdownJob.cs b/NzbDrone.Core/Lifecycle/AppShutdownJob.cs index 62ef370cd8..36f62e9d9b 100644 --- a/NzbDrone.Core/Lifecycle/AppShutdownJob.cs +++ b/NzbDrone.Core/Lifecycle/AppShutdownJob.cs @@ -3,6 +3,7 @@ using NLog; using NzbDrone.Common; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; namespace NzbDrone.Core.Lifecycle diff --git a/NzbDrone.Core/Lifecycle/AppUpdateJob.cs b/NzbDrone.Core/Lifecycle/AppUpdateJob.cs index 3563754de9..c775958ccf 100644 --- a/NzbDrone.Core/Lifecycle/AppUpdateJob.cs +++ b/NzbDrone.Core/Lifecycle/AppUpdateJob.cs @@ -5,6 +5,7 @@ using NLog; using NzbDrone.Common; using NzbDrone.Core.Jobs; +using NzbDrone.Core.Jobs.Framework; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Core; diff --git a/NzbDrone.Core/Model/EpisodeStatusType.cs b/NzbDrone.Core/Model/EpisodeStatusType.cs index 12a260073d..7c6fa61d0c 100644 --- a/NzbDrone.Core/Model/EpisodeStatusType.cs +++ b/NzbDrone.Core/Model/EpisodeStatusType.cs @@ -14,14 +14,14 @@ public enum EpisodeStatusType /// /// Episode has aired, but no episode - /// files are avilable + /// files are available /// Todo: We shouldn't set missing until the episode has past the actual airtime + runtime, including UtcOffset /// Missing, /// /// Episode airs today, but no episode - /// files are avilable + /// files are available /// AirsToday, diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 056f81ff3b..d48898936e 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -224,7 +224,7 @@ - + @@ -253,7 +253,7 @@ - + @@ -318,7 +318,7 @@ - + @@ -335,7 +335,7 @@ - + @@ -525,7 +525,7 @@ - +