mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 10:19:41 +00:00
diskscan will not fully fail if a single file fails to be imported.
This commit is contained in:
parent
6936f042f5
commit
8e89847f30
2 changed files with 19 additions and 2 deletions
|
@ -54,9 +54,16 @@ private void Scan(Series series)
|
||||||
var mediaFileList = GetVideoFiles(series.Path);
|
var mediaFileList = GetVideoFiles(series.Path);
|
||||||
|
|
||||||
foreach (var filePath in mediaFileList)
|
foreach (var filePath in mediaFileList)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
ImportFile(series, filePath);
|
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
|
//Todo: Find the "best" episode file for all found episodes and import that one
|
||||||
//Todo: Move the episode linking to here, instead of import (or rename import)
|
//Todo: Move the episode linking to here, instead of import (or rename import)
|
||||||
|
@ -140,9 +147,16 @@ public void Execute(DiskScanCommand message)
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var series in seriesToScan)
|
foreach (var series in seriesToScan)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Scan(series);
|
Scan(series);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.ErrorException("Diskscan failed for " + series.Title, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Handle(EpisodeInfoAddedEvent message)
|
public void Handle(EpisodeInfoAddedEvent message)
|
||||||
|
|
|
@ -98,6 +98,9 @@ private List<Episode> GetEpisodes(ParsedEpisodeInfo parsedEpisodeInfo, Series se
|
||||||
return new List<Episode>();
|
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);
|
var episodeInfo = _episodeService.GetEpisode(series.Id, parsedEpisodeInfo.AirDate.Value);
|
||||||
|
|
||||||
if (episodeInfo != null)
|
if (episodeInfo != null)
|
||||||
|
|
Loading…
Reference in a new issue