refactor out most of TransitionalFileLocator. Almost done with new stateful is-liberated paradigm

This commit is contained in:
Robert McRackan 2021-08-20 20:51:37 -04:00
parent a639857ec6
commit aa56bb74a1
13 changed files with 82 additions and 107 deletions

View file

@ -15,7 +15,7 @@ namespace FileLiberator
{
public override bool Validate(LibraryBook libraryBook)
=> !string.IsNullOrWhiteSpace(getdownloadUrl(libraryBook))
&& !ApplicationServices.TransitionalFileLocator.PDF_Exists(libraryBook.Book);
&& !libraryBook.Book.PDF_Exists;
public override async Task<StatusHandler> ProcessItemAsync(LibraryBook libraryBook)
{
@ -39,7 +39,7 @@ namespace FileLiberator
return Path.Combine(existingPath, Path.GetFileName(file));
var full = FileUtility.GetValidFilename(
AudibleFileStorage.PDF.StorageDirectory,
AudibleFileStorage.PdfStorageDirectory,
libraryBook.Book.Title,
Path.GetExtension(file),
libraryBook.Book.AudibleProductId);
@ -61,7 +61,7 @@ namespace FileLiberator
}
private static StatusHandler verifyDownload(LibraryBook libraryBook)
=> !ApplicationServices.TransitionalFileLocator.PDF_Exists(libraryBook.Book)
=> !libraryBook.Book.PDF_Exists
? new StatusHandler { "Downloaded PDF cannot be found" }
: new StatusHandler();
}