NoTracking() to simplify confusing EF Core state. Tracking is now only used during mass import, not in UI

This commit is contained in:
Robert McRackan 2021-07-28 14:51:35 -04:00
parent 3c1db55a95
commit 85c18c8334
9 changed files with 31 additions and 28 deletions

View file

@ -22,11 +22,6 @@ namespace FileLiberator
return verifyDownload(libraryBook);
}
private static StatusHandler verifyDownload(LibraryBook libraryBook)
=> !AudibleFileStorage.PDF.Exists(libraryBook.Book.AudibleProductId)
? new StatusHandler { "Downloaded PDF cannot be found" }
: new StatusHandler();
private static string getProposedDownloadFilePath(LibraryBook libraryBook)
{
// if audio file exists, get it's dir. else return base Book dir
@ -44,6 +39,9 @@ namespace FileLiberator
return full;
}
private static string getdownloadUrl(LibraryBook libraryBook)
=> libraryBook?.Book?.Supplements?.FirstOrDefault()?.Url;
private async Task downloadPdfAsync(LibraryBook libraryBook, string proposedDownloadFilePath)
{
var api = await GetApiAsync(libraryBook);
@ -55,7 +53,9 @@ namespace FileLiberator
(p) => client.DownloadFileAsync(downloadUrl, proposedDownloadFilePath, p));
}
private static string getdownloadUrl(LibraryBook libraryBook)
=> libraryBook?.Book?.Supplements?.FirstOrDefault()?.Url;
private static StatusHandler verifyDownload(LibraryBook libraryBook)
=> !AudibleFileStorage.PDF.Exists(libraryBook.Book.AudibleProductId)
? new StatusHandler { "Downloaded PDF cannot be found" }
: new StatusHandler();
}
}