From 8e89847f305ebbea36942fad1ad96088979ac919 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 20 May 2013 21:30:54 -0700 Subject: [PATCH] diskscan will not fully fail if a single file fails to be imported. --- NzbDrone.Core/MediaFiles/DiskScanService.cs | 18 ++++++++++++++++-- NzbDrone.Core/Parser/ParsingService.cs | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Core/MediaFiles/DiskScanService.cs b/NzbDrone.Core/MediaFiles/DiskScanService.cs index d8d07e967..d876ac723 100644 --- a/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -55,7 +55,14 @@ namespace NzbDrone.Core.MediaFiles foreach (var filePath in mediaFileList) { - ImportFile(series, filePath); + try + { + ImportFile(series, filePath); + } + catch (Exception e) + { + Logger.ErrorException("Couldn't import file " + filePath, e); + } } //Todo: Find the "best" episode file for all found episodes and import that one @@ -141,7 +148,14 @@ namespace NzbDrone.Core.MediaFiles foreach (var series in seriesToScan) { - Scan(series); + try + { + Scan(series); + } + catch (Exception e) + { + Logger.ErrorException("Diskscan failed for " + series.Title, e); + } } } diff --git a/NzbDrone.Core/Parser/ParsingService.cs b/NzbDrone.Core/Parser/ParsingService.cs index 9eb562a6c..79995d75a 100644 --- a/NzbDrone.Core/Parser/ParsingService.cs +++ b/NzbDrone.Core/Parser/ParsingService.cs @@ -98,6 +98,9 @@ namespace NzbDrone.Core.Parser return new List(); } + + //TODO: this will fail since parsed date will be local, and stored date will be UTC + //which means they will probebly end up on diffrent dates var episodeInfo = _episodeService.GetEpisode(series.Id, parsedEpisodeInfo.AirDate.Value); if (episodeInfo != null)