Bug fix #225 : SaferEnumerateFiles will skip files with UnauthorizedAccessException

This commit is contained in:
Robert McRackan 2022-04-08 09:11:36 -04:00
parent 962e379642
commit d6601fed83
5 changed files with 42 additions and 8 deletions

View file

@ -73,8 +73,8 @@ namespace LibationFileManager
protected override string GetFilePathCustom(string productId)
{
var regex = GetBookSearchRegex(productId);
return Directory
.EnumerateFiles(DownloadsInProgressDirectory, "*.*", SearchOption.AllDirectories)
return FileUtility
.SaferEnumerateFiles(DownloadsInProgressDirectory, "*.*", SearchOption.AllDirectories)
.FirstOrDefault(s => regex.IsMatch(s));
}