job structure cleanup.

pull/3113/head
kay.one 12 years ago
parent 5e77d51510
commit eaf6f94c02

@ -8,6 +8,7 @@ using Nancy;
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 @@ namespace NzbDrone.Api.Series
{
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 @@ namespace NzbDrone.Api.Series
//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 @@ namespace NzbDrone.Api.Series
_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 @@ namespace NzbDrone.Api.Series
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 };
}
}

@ -7,6 +7,7 @@ using Moq;
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;

@ -10,6 +10,7 @@ using NCrunch.Framework;
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;

@ -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

@ -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

@ -3,6 +3,7 @@ using System.Collections.Generic;
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;

@ -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;

@ -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;

@ -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;

@ -3,6 +3,7 @@ using System.Collections.Generic;
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;

@ -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;

@ -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;

@ -2,7 +2,7 @@
using System.Linq;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Jobs
namespace NzbDrone.Core.Jobs.Framework
{
public interface IJob
{

@ -6,11 +6,10 @@ using System.Linq;
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
{

@ -2,7 +2,7 @@
using System;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Jobs
namespace NzbDrone.Core.Jobs.Framework
{
public class JobDefinition : ModelBase
{

@ -1,6 +1,7 @@
using System;
using System.Linq;
using System;
namespace NzbDrone.Core.Model
namespace NzbDrone.Core.Jobs.Framework
{
public class JobQueueItem : IEquatable<JobQueueItem>
{

@ -5,7 +5,7 @@ using NLog;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Lifecycle;
namespace NzbDrone.Core.Jobs
namespace NzbDrone.Core.Jobs.Framework
{
public interface IJobRepository : IInitializable, IBasicRepository<JobDefinition>
{

@ -4,6 +4,7 @@ using System.IO;
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;

@ -3,6 +3,7 @@ using System.Collections.Generic;
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;

@ -3,6 +3,7 @@ using System;
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;

@ -3,6 +3,7 @@ using System.Collections.Generic;
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;

@ -3,6 +3,7 @@ using System.Linq;
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;

@ -5,6 +5,7 @@ using NLog;
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;

@ -4,6 +4,7 @@ using System;
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;

@ -6,6 +6,7 @@ using NLog;
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;

@ -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;

@ -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;

@ -4,6 +4,7 @@ using System.Linq;
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;

@ -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;

@ -3,6 +3,7 @@ using System.Collections.Generic;
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;

@ -3,6 +3,7 @@ using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Lifecycle

@ -3,6 +3,7 @@ using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Lifecycle

@ -5,6 +5,7 @@ using System.IO;
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;

@ -14,14 +14,14 @@
/// <summary>
/// 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
/// </summary>
Missing,
/// <summary>
/// Episode airs today, but no episode
/// files are avilable
/// files are available
/// </summary>
AirsToday,

@ -224,7 +224,7 @@
<Compile Include="Instrumentation\LogInjectionModule.cs" />
<Compile Include="Instrumentation\LogRepository.cs" />
<Compile Include="Jobs\CleanupRecycleBinJob.cs" />
<Compile Include="Jobs\JobRepository.cs" />
<Compile Include="Jobs\Framework\JobRepository.cs" />
<Compile Include="Lifecycle\AppShutdownJob.cs" />
<Compile Include="Lifecycle\AppRestartJob.cs" />
<Compile Include="Jobs\XemUpdateJob.cs" />
@ -253,7 +253,7 @@
<Compile Include="Model\Nzbx\NzbxRecentItem.cs" />
<Compile Include="Model\Nzbx\NzbxVotesModel.cs" />
<Compile Include="Model\PostDownloadStatusType.cs" />
<Compile Include="Model\JobQueueItem.cs" />
<Compile Include="Jobs\Framework\JobQueueItem.cs" />
<Compile Include="Model\LanguageType.cs" />
<Compile Include="Model\MisnamedEpisodeModel.cs" />
<Compile Include="Qualities\QualitySizeRepository.cs" />
@ -318,7 +318,7 @@
<Compile Include="Tv\SeasonService.cs" />
<Compile Include="Jobs\RecentBacklogSearchJob.cs" />
<Compile Include="Instrumentation\TrimLogsJob.cs" />
<Compile Include="Jobs\JobController.cs" />
<Compile Include="Jobs\Framework\JobController.cs" />
<Compile Include="Jobs\RenameSeasonJob.cs" />
<Compile Include="Jobs\RenameSeriesJob.cs" />
<Compile Include="Lifecycle\AppUpdateJob.cs" />
@ -335,7 +335,7 @@
<Compile Include="Jobs\DeleteSeriesJob.cs" />
<Compile Include="Jobs\DiskScanJob.cs" />
<Compile Include="Jobs\ImportNewSeriesJob.cs" />
<Compile Include="Jobs\IJob.cs" />
<Compile Include="Jobs\Framework\IJob.cs" />
<Compile Include="Jobs\RssSyncJob.cs" />
<Compile Include="Jobs\UpdateInfoJob.cs" />
<Compile Include="MetadataSource\TvRageMappingProvider.cs" />
@ -525,7 +525,7 @@
</Compile>
<Compile Include="Indexers\NewznabDefinition.cs" />
<Compile Include="ExternalNotification\ExternalNotificationDefinition.cs" />
<Compile Include="Jobs\JobDefinition.cs" />
<Compile Include="Jobs\Framework\JobDefinition.cs" />
<Compile Include="Indexers\Indexer.cs" />
<Compile Include="Model\EpisodeParseResult.cs" />
<Compile Include="Model\EpisodeSortingType.cs" />

Loading…
Cancel
Save