Reading List Bug (#1943)

* Refactored how we calculate start and end dates for a reading list generated from Scan.

* Cleaned up the logging messages a bit

* By default, allow DB statements to include params, since there's no PPI involved.
This commit is contained in:
Joe Milazzo 2023-04-24 18:51:15 -05:00 committed by GitHub
parent 868d20a18e
commit 19198beadf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 5 deletions

View file

@ -297,7 +297,7 @@ public class ReadingListService : IReadingListService
/// <summary>
/// Calculates the Start month/year and Ending month/year
/// </summary>
/// <param name="readingListWithItems">Reading list should have all items</param>
/// <param name="readingListWithItems">Reading list should have all items and Chapters</param>
public async Task CalculateStartAndEndDates(ReadingList readingListWithItems)
{
var items = readingListWithItems.Items;
@ -497,11 +497,12 @@ public class ReadingListService : IReadingListService
readingList.Items = items;
await CalculateReadingListAgeRating(readingList);
await CalculateStartAndEndDates(readingList);
if (_unitOfWork.HasChanges())
{
await _unitOfWork.CommitAsync();
}
await CalculateStartAndEndDates(await _unitOfWork.ReadingListRepository.GetReadingListByTitleAsync(arcPair.Item1, user.Id, ReadingListIncludes.Items | ReadingListIncludes.ItemChapter));
await _unitOfWork.CommitAsync();
}
}
}