1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-31 11:22:06 +00:00

Fixed: Error checking if files should be deleted after import won't leave import in limbo

(cherry picked from commit 88ad6f9544110a2e825ebe6b2cde17e9f05475cc)

Closes #2003
This commit is contained in:
Mark McDowall 2021-02-09 17:03:41 -08:00 committed by Bogdan
parent d819fd1bd1
commit 234d277eae

View file

@ -116,7 +116,9 @@ public bool ShouldDeleteFolder(IDirectoryInfo directoryInfo, Artist artist)
try
{
var audioFiles = _diskScanService.GetAudioFiles(directoryInfo.FullName);
var rarFiles = _diskProvider.GetFiles(directoryInfo.FullName, true).Where(f => Path.GetExtension(f).Equals(".rar", StringComparison.OrdinalIgnoreCase));
var rarFiles = _diskProvider.GetFiles(directoryInfo.FullName, true).Where(f =>
Path.GetExtension(f).Equals(".rar",
StringComparison.OrdinalIgnoreCase));
foreach (var audioFile in audioFiles)
{
@ -145,6 +147,11 @@ public bool ShouldDeleteFolder(IDirectoryInfo directoryInfo, Artist artist)
_logger.Debug(e, "Folder {0} has already been removed", directoryInfo.FullName);
return false;
}
catch (Exception e)
{
_logger.Debug(e, "Unable to determine whether folder {0} should be removed", directoryInfo.FullName);
return false;
}
}
private List<ImportResult> ProcessFolder(IDirectoryInfo directoryInfo, ImportMode importMode, DownloadClientItem downloadClientItem)