Persist keys to db. Necessary in the event that download succeeds then decrypt fails.

This commit is contained in:
Robert McRackan 2021-06-22 11:25:18 -04:00
parent 0306c958d1
commit 9416f4e040
2 changed files with 10 additions and 0 deletions

View File

@ -119,5 +119,13 @@ namespace ApplicationServices
throw; throw;
} }
} }
// I hate how unintuitive this is to use/remember. Will hopefully be cleaned up in a future comprehensive data strategy overhaul
public static void UpdateBook(Book book)
{
using var context = DbContexts.GetContext();
context.Update(book);
context.SaveChanges();
}
} }
} }

View File

@ -51,6 +51,8 @@ namespace FileLiberator
libraryBook.Book.AudibleKey = dlLic.AudibleKey; libraryBook.Book.AudibleKey = dlLic.AudibleKey;
libraryBook.Book.AudibleIV = dlLic.AudibleIV; libraryBook.Book.AudibleIV = dlLic.AudibleIV;
// persist changes
ApplicationServices.LibraryCommands.UpdateBook(libraryBook.Book);
var client = new HttpClient(); var client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent", Resources.UserAgent); client.DefaultRequestHeaders.Add("User-Agent", Resources.UserAgent);