mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
failed disk scan doesn't kill the whole job anymore
This commit is contained in:
parent
ce63f05512
commit
f3be5fa08e
2 changed files with 43 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model.Notification;
|
||||
using NzbDrone.Core.Repository;
|
||||
|
||||
|
@ -11,6 +12,7 @@ namespace NzbDrone.Core.Providers.Jobs
|
|||
{
|
||||
private readonly SeriesProvider _seriesProvider;
|
||||
private readonly MediaFileProvider _mediaFileProvider;
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public DiskScanJob(SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider)
|
||||
{
|
||||
|
@ -46,9 +48,16 @@ namespace NzbDrone.Core.Providers.Jobs
|
|||
|
||||
foreach (var series in seriesToScan.Where(c => c.Episodes.Count != 0))
|
||||
{
|
||||
notification.CurrentMessage = string.Format("Scanning disk for '{0}'", series.Title);
|
||||
_mediaFileProvider.Scan(series);
|
||||
notification.CurrentMessage = string.Format("Media File Scan completed for '{0}'", series.Title);
|
||||
try
|
||||
{
|
||||
notification.CurrentMessage = string.Format("Scanning disk for '{0}'", series.Title);
|
||||
_mediaFileProvider.Scan(series);
|
||||
notification.CurrentMessage = string.Format("Media File Scan completed for '{0}'", series.Title);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.ErrorException("An error has occured while scanning " + series.Title, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue