mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 20:42:37 +01:00
fixed disk not being scanned during series refresh.
This commit is contained in:
parent
4a324cc31a
commit
4456d3cbe0
@ -1,17 +0,0 @@
|
|||||||
using NzbDrone.Common.Messaging;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.MediaFiles.Commands
|
|
||||||
{
|
|
||||||
public class DiskScanCommand : ICommand
|
|
||||||
{
|
|
||||||
public int? SeriesId { get; private set; }
|
|
||||||
|
|
||||||
public DiskScanCommand(int seriesId = 0)
|
|
||||||
{
|
|
||||||
if (seriesId != 0)
|
|
||||||
{
|
|
||||||
SeriesId = seriesId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,8 +7,6 @@
|
|||||||
using NzbDrone.Common.Messaging;
|
using NzbDrone.Common.Messaging;
|
||||||
using NzbDrone.Core.MediaFiles.Commands;
|
using NzbDrone.Core.MediaFiles.Commands;
|
||||||
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
||||||
using NzbDrone.Core.Parser;
|
|
||||||
using NzbDrone.Core.Providers;
|
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
using NzbDrone.Core.Tv.Events;
|
using NzbDrone.Core.Tv.Events;
|
||||||
|
|
||||||
@ -19,7 +17,9 @@ public interface IDiskScanService
|
|||||||
string[] GetVideoFiles(string path, bool allDirectories = true);
|
string[] GetVideoFiles(string path, bool allDirectories = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DiskScanService : IDiskScanService, IExecute<DiskScanCommand>, IHandle<EpisodeInfoAddedEvent>
|
public class DiskScanService :
|
||||||
|
IDiskScanService,
|
||||||
|
IHandle<SeriesUpdatedEvent>
|
||||||
{
|
{
|
||||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
private static readonly string[] MediaExtensions = new[] { ".mkv", ".avi", ".wmv", ".mp4", ".mpg", ".mpeg", ".xvid", ".flv", ".mov", ".rm", ".rmvb", ".divx", ".dvr-ms", ".ts", ".ogm", ".m4v", ".strm" };
|
private static readonly string[] MediaExtensions = new[] { ".mkv", ".avi", ".wmv", ".mp4", ".mpg", ".mpeg", ".xvid", ".flv", ".mov", ".rm", ".rmvb", ".divx", ".dvr-ms", ".ts", ".ogm", ".m4v", ".strm" };
|
||||||
@ -71,33 +71,7 @@ public string[] GetVideoFiles(string path, bool allDirectories = true)
|
|||||||
return mediaFileList.ToArray();
|
return mediaFileList.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute(DiskScanCommand message)
|
public void Handle(SeriesUpdatedEvent message)
|
||||||
{
|
|
||||||
var seriesToScan = new List<Series>();
|
|
||||||
|
|
||||||
if (message.SeriesId.HasValue)
|
|
||||||
{
|
|
||||||
seriesToScan.Add(_seriesService.GetSeries(message.SeriesId.Value));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
seriesToScan.AddRange(_seriesService.GetAllSeries());
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var series in seriesToScan)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Scan(series);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.ErrorException("Disk scan failed for " + series, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Handle(EpisodeInfoAddedEvent message)
|
|
||||||
{
|
{
|
||||||
Scan(message.Series);
|
Scan(message.Series);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,6 @@
|
|||||||
<Compile Include="MediaFiles\Commands\CleanMediaFileDb.cs" />
|
<Compile Include="MediaFiles\Commands\CleanMediaFileDb.cs" />
|
||||||
<Compile Include="MediaFiles\Commands\CleanUpRecycleBinCommand.cs" />
|
<Compile Include="MediaFiles\Commands\CleanUpRecycleBinCommand.cs" />
|
||||||
<Compile Include="MediaFiles\Commands\DownloadedEpisodesScanCommand.cs" />
|
<Compile Include="MediaFiles\Commands\DownloadedEpisodesScanCommand.cs" />
|
||||||
<Compile Include="MediaFiles\Commands\DiskScanCommand.cs" />
|
|
||||||
<Compile Include="MediaFiles\EpisodeImport\ImportDecision.cs" />
|
<Compile Include="MediaFiles\EpisodeImport\ImportDecision.cs" />
|
||||||
<Compile Include="MediaFiles\EpisodeImport\IImportDecisionEngineSpecification.cs" />
|
<Compile Include="MediaFiles\EpisodeImport\IImportDecisionEngineSpecification.cs" />
|
||||||
<Compile Include="MediaFiles\EpisodeImport\ImportDecisionMaker.cs" />
|
<Compile Include="MediaFiles\EpisodeImport\ImportDecisionMaker.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user