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

Closes #4318
  • Loading branch information
markus101 committed Feb 10, 2021
1 parent 54c386d commit 88ad6f9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public bool ShouldDeleteFolder(DirectoryInfo directoryInfo, Series series)
{
var videoFiles = _diskScanService.GetVideoFiles(directoryInfo.FullName);
var rarFiles = _diskProvider.GetFiles(directoryInfo.FullName, SearchOption.AllDirectories).Where(f =>
Path.GetExtension(f).Equals(".rar", StringComparison.OrdinalIgnoreCase));
Path.GetExtension(f).Equals(".rar",
StringComparison.OrdinalIgnoreCase));

foreach (var videoFile in videoFiles)
{
Expand Down Expand Up @@ -144,6 +145,11 @@ public bool ShouldDeleteFolder(DirectoryInfo directoryInfo, Series series)
_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(DirectoryInfo directoryInfo, ImportMode importMode, DownloadClientItem downloadClientItem)
Expand Down

1 comment on commit 88ad6f9

@Archmonger
Copy link

@Archmonger Archmonger commented on 88ad6f9 May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necroing this a bit. Seems like it didn't fully resolve the issue, especially in cases where Sonarr's data drive is a network SMB share.

Downloads still periodically get stuck as "Importing..." despite a successful download & move.

EDIT: I'm realizing this commit was solely logging. I suppose a full resolution was never merged?

Please sign in to comment.