mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Converted jobs to dynamic
This commit is contained in:
parent
93402f4932
commit
a4dde81ceb
42 changed files with 166 additions and 170 deletions
|
@ -1,8 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model.Notification;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Repository;
|
||||
|
||||
namespace NzbDrone.Core.Jobs
|
||||
{
|
||||
|
@ -30,19 +32,19 @@ namespace NzbDrone.Core.Jobs
|
|||
get { return TimeSpan.FromTicks(0); }
|
||||
}
|
||||
|
||||
public void Start(ProgressNotification notification, int targetId, int secondaryTargetId)
|
||||
public void Start(ProgressNotification notification, dynamic options)
|
||||
{
|
||||
if (targetId <= 0)
|
||||
throw new ArgumentOutOfRangeException("targetId");
|
||||
if (options == null || options.SeriesId <= 0)
|
||||
throw new ArgumentException("options.SeriesId");
|
||||
|
||||
logger.Debug("Getting seasons from database for series: {0}", targetId);
|
||||
var seasons = _seasonProvider.GetSeasons(targetId).Where(s => s > 0);
|
||||
logger.Debug("Getting seasons from database for series: {0}", options.SeriesId);
|
||||
IList<int> seasons = _seasonProvider.GetSeasons(options.SeriesId);
|
||||
|
||||
foreach (var season in seasons)
|
||||
foreach (var season in seasons.Where(s => s > 0))
|
||||
{
|
||||
if (!_seasonProvider.IsIgnored(targetId, season))
|
||||
if (!_seasonProvider.IsIgnored(options.SeriesId, season))
|
||||
{
|
||||
_seasonSearchJob.Start(notification, targetId, season);
|
||||
_seasonSearchJob.Start(notification, new { SeriesId = options.SeriesId, SeasonNumber = season });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue