feat: say so when the Books folder is there but cannot be read

A pulled or failing drive still answers that it is a directory, and a listing of
it comes back empty rather than refusing, so Libation would start a download
against an unreadable folder and report a full library as having nothing
downloaded. Check before queueing and name the drive as the likely cause.

See issue #1984.

Co-authored-by: rmcrackan <rmcrackan@gmail.com>
This commit is contained in:
Cursor Agentandrmcrackan committed 2026-08-24 14:22:08 +00:00
1 parent 75f1d753b1
commit 1839eebb20
1 file changed
+14 -1
@@ -296,7 +296,7 @@ public class ProcessQueueViewModel : ReactiveObject
MessageBoxIcon.Error);
return false;
}
else if (AudibleFileStorage.BooksDirectory is null)
else if (AudibleFileStorage.BooksDirectory is not FileManager.LongPath booksDirectory)
{
Serilog.Log.Logger.Error("Failed to create books directory: {booksDir}", config.Books?.Path);
await MessageBoxBase.Show(
@@ -306,6 +306,19 @@ public class ProcessQueueViewModel : ReactiveObject
MessageBoxIcon.Error);
return false;
}
// A removable or failing drive can still answer that it is a directory while every read of it fails, so
// existing is not the same as usable. Without this the download would begin against an unreadable folder
// and fail book by book, and Libation would report the library as having nothing downloaded.
else if (!FileManager.FileUtility.CanEnumerate(booksDirectory))
{
Serilog.Log.Logger.Error("Books directory exists but cannot be read: {booksDir}", (string)booksDirectory);
await MessageBoxBase.Show(
$"Libation was unable to read the \"Books location\" folder at:\n{booksDirectory}\n\nIf it is on a removable or network drive, check that the drive is connected and working. Otherwise, change the Books location in the settings menu.",
"Unable to Read Books Directory",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return false;
}
else if (AudibleFileStorage.DownloadsInProgressDirectory is null)
{
Serilog.Log.Logger.Error("Failed to create DownloadsInProgressDirectory in {InProgress}", config.InProgress);