Skip to content

Commit

Permalink
Fixed: Error checking if files should be deleted after import won't l…
Browse files Browse the repository at this point in the history
…eave import in limbo

(cherry picked from commit 88ad6f9544110a2e825ebe6b2cde17e9f05475cc)

Closes Lidarr#2003
  • Loading branch information
markus101 authored and zhangdoa committed Jan 6, 2024
1 parent c0c6f19 commit 3f3b5d3
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3f3b5d3

Please sign in to comment.