mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Added RescanSeries command
This commit is contained in:
parent
cdbd7273b7
commit
f9b0b2206c
17
src/NzbDrone.Core/MediaFiles/Commands/RescanSeriesCommand.cs
Normal file
17
src/NzbDrone.Core/MediaFiles/Commands/RescanSeriesCommand.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
|
||||
namespace NzbDrone.Core.MediaFiles.Commands
|
||||
{
|
||||
public class RescanSeriesCommand : Command
|
||||
{
|
||||
public int SeriesId { get; set; }
|
||||
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
@ -21,13 +22,15 @@ public interface IDiskScanService
|
||||
|
||||
public class DiskScanService :
|
||||
IDiskScanService,
|
||||
IHandle<SeriesUpdatedEvent>
|
||||
IHandle<SeriesUpdatedEvent>,
|
||||
IExecute<RescanSeriesCommand>
|
||||
{
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
private readonly IMakeImportDecision _importDecisionMaker;
|
||||
private readonly IImportApprovedEpisodes _importApprovedEpisodes;
|
||||
private readonly ICommandExecutor _commandExecutor;
|
||||
private readonly IConfigService _configService;
|
||||
private readonly ISeriesService _seriesService;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public DiskScanService(IDiskProvider diskProvider,
|
||||
@ -35,6 +38,7 @@ public DiskScanService(IDiskProvider diskProvider,
|
||||
IImportApprovedEpisodes importApprovedEpisodes,
|
||||
ICommandExecutor commandExecutor,
|
||||
IConfigService configService,
|
||||
ISeriesService seriesService,
|
||||
Logger logger)
|
||||
{
|
||||
_diskProvider = diskProvider;
|
||||
@ -42,6 +46,7 @@ public DiskScanService(IDiskProvider diskProvider,
|
||||
_importApprovedEpisodes = importApprovedEpisodes;
|
||||
_commandExecutor = commandExecutor;
|
||||
_configService = configService;
|
||||
_seriesService = seriesService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@ -90,5 +95,12 @@ public void Handle(SeriesUpdatedEvent message)
|
||||
{
|
||||
Scan(message.Series);
|
||||
}
|
||||
|
||||
public void Execute(RescanSeriesCommand message)
|
||||
{
|
||||
var series = _seriesService.GetSeries(message.SeriesId);
|
||||
|
||||
Scan(series);
|
||||
}
|
||||
}
|
||||
}
|
@ -289,6 +289,7 @@
|
||||
<Compile Include="Instrumentation\Commands\DeleteLogFilesCommand.cs" />
|
||||
<Compile Include="Instrumentation\Commands\TrimLogCommand.cs" />
|
||||
<Compile Include="Instrumentation\DeleteLogFilesService.cs" />
|
||||
<Compile Include="MediaFiles\Commands\RescanSeriesCommand.cs" />
|
||||
<Compile Include="MediaFiles\Commands\RenameFilesCommand.cs" />
|
||||
<Compile Include="MediaFiles\EpisodeFileMoveResult.cs" />
|
||||
<Compile Include="MediaFiles\EpisodeImport\Specifications\FullSeasonSpecification.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user