Rescan all series via RescanSeriesCommand

This commit is contained in:
Mark McDowall 2014-04-10 08:56:18 -07:00
parent 073b496197
commit 946406f456
2 changed files with 15 additions and 3 deletions

View File

@ -4,7 +4,7 @@ namespace NzbDrone.Core.MediaFiles.Commands
{
public class RescanSeriesCommand : Command
{
public int SeriesId { get; set; }
public int? SeriesId { get; set; }
public override bool SendUpdatesToClient
{

View File

@ -111,9 +111,21 @@ namespace NzbDrone.Core.MediaFiles
public void Execute(RescanSeriesCommand message)
{
var series = _seriesService.GetSeries(message.SeriesId);
if (message.SeriesId.HasValue)
{
var series = _seriesService.GetSeries(message.SeriesId.Value);
Scan(series);
}
else
{
var allSeries = _seriesService.GetAllSeries();
foreach (var series in allSeries)
{
Scan(series);
}
}
}
}
}