Importers need access to Account
This commit is contained in:
parent
57ee150d3c
commit
c67972a327
10 changed files with 35 additions and 20 deletions
|
|
@ -13,13 +13,15 @@ namespace ApplicationServices
|
|||
{
|
||||
try
|
||||
{
|
||||
var items = await AudibleApiActions.GetAllLibraryItemsAsync(callback);
|
||||
var account = AudibleApiStorage.TEST_GetFirstAccount();
|
||||
|
||||
var items = await AudibleApiActions.GetAllLibraryItemsAsync(account, callback);
|
||||
var totalCount = items.Count;
|
||||
Serilog.Log.Logger.Information($"GetAllLibraryItems: Total count {totalCount}");
|
||||
|
||||
using var context = DbContexts.GetContext();
|
||||
var libImporter = new LibraryImporter(context);
|
||||
var newCount = await Task.Run(() => libImporter.Import(items));
|
||||
var libraryImporter = new LibraryImporter(context, account);
|
||||
var newCount = await Task.Run(() => libraryImporter.Import(items));
|
||||
context.SaveChanges();
|
||||
Serilog.Log.Logger.Information($"Import: New count {newCount}");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue