1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

diskscan will not fully fail if a single file fails to be imported.

This commit is contained in:
kay.one 2013-05-20 21:30:54 -07:00
parent 6936f042f5
commit 8e89847f30
2 changed files with 19 additions and 2 deletions

View File

@ -55,7 +55,14 @@ private void Scan(Series series)
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 @@ public void Execute(DiskScanCommand message)
foreach (var series in seriesToScan)
{
Scan(series);
try
{
Scan(series);
}
catch (Exception e)
{
Logger.ErrorException("Diskscan failed for " + series.Title, e);
}
}
}

View File

@ -98,6 +98,9 @@ private List<Episode> GetEpisodes(ParsedEpisodeInfo parsedEpisodeInfo, Series se
return new List<Episode>();
}
//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)