mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
JobProvider.Initialize will now update existing jobs.
This commit is contained in:
parent
ac5296e0ab
commit
f56bf62991
2 changed files with 40 additions and 13 deletions
|
@ -86,23 +86,23 @@ namespace NzbDrone.Core.Jobs
|
|||
foreach (var job in _jobs)
|
||||
{
|
||||
var jobLocal = job;
|
||||
if (!currentJobs.Exists(c => c.TypeName == jobLocal.GetType().ToString()))
|
||||
|
||||
var settings = new JobDefinition
|
||||
{
|
||||
var settings = new JobDefinition
|
||||
{
|
||||
Enable = jobLocal.DefaultInterval > 0,
|
||||
TypeName = job.GetType().ToString(),
|
||||
Name = jobLocal.Name,
|
||||
Interval = jobLocal.DefaultInterval,
|
||||
LastExecution = DateTime.Now
|
||||
};
|
||||
Enable = jobLocal.DefaultInterval > 0,
|
||||
TypeName = job.GetType().ToString(),
|
||||
Name = jobLocal.Name,
|
||||
Interval = jobLocal.DefaultInterval,
|
||||
LastExecution = DateTime.Now
|
||||
};
|
||||
|
||||
SaveDefinition(settings);
|
||||
if (currentJobs.Exists(c => c.TypeName == jobLocal.GetType().ToString()))
|
||||
{
|
||||
settings.Id = currentJobs.Single(c => c.TypeName == jobLocal.GetType().ToString()).Id;
|
||||
}
|
||||
|
||||
SaveDefinition(settings);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue