Revert "Remove items from library."

This reverts commit 00f7e4b7796c724192e4246c0498e6b183782f18.
This commit is contained in:
Michael Bucari-Tovo 2021-07-02 15:24:05 -06:00
parent 35fc3581b3
commit 81195e382e

View File

@ -35,10 +35,7 @@ namespace DtoImporterService
// CURRENT SOLUTION: don't re-insert
var currentLibraryProductIds = DbContext.Library.Select(l => l.Book.AudibleProductId);
var audibleLibraryProductIds = importItems.Select(i => i.DtoItem.ProductId);
var newItems = importItems.Where(dto => !currentLibraryProductIds.Contains(dto.DtoItem.ProductId));
var removedItems = DbContext.Library.Where(l => !audibleLibraryProductIds.Contains(l.Book.AudibleProductId));
foreach (var newItem in newItems)
{
@ -58,10 +55,7 @@ namespace DtoImporterService
u.UpdateAccount(item.AccountId);
}
DbContext.Library.RemoveRange(removedItems);
var qtyNew = newItems.Count();
var qtyRemoved = removedItems.Count();
return qtyNew;
}
}