Release Bugfixes (#2470)

This commit is contained in:
Joe Milazzo 2023-12-03 11:54:57 -06:00 committed by GitHub
parent d796d06fd1
commit bdcd3965fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 194 additions and 25 deletions

View file

@ -26,6 +26,7 @@ public interface ICleanupService
Task CleanupBackups();
Task CleanupLogs();
void CleanupTemp();
Task EnsureChapterProgressIsCapped();
/// <summary>
/// Responsible to remove Series from Want To Read when user's have fully read the series and the series has Publication Status of Completed or Cancelled.
/// </summary>
@ -89,6 +90,8 @@ public class CleanupService : ICleanupService
await DeleteReadingListCoverImages();
await SendProgress(0.8F, "Cleaning old logs");
await CleanupLogs();
await SendProgress(0.9F, "Cleaning progress events that exceed 100%");
await EnsureChapterProgressIsCapped();
await SendProgress(1F, "Cleanup finished");
_logger.LogInformation("Cleanup finished");
}
@ -243,6 +246,17 @@ public class CleanupService : ICleanupService
_logger.LogInformation("Temp directory purged");
}
/// <summary>
/// Ensures that each chapter's progress (pages read) is capped at the total pages. This can get out of sync when a chapter is replaced after being read with one with lower page count.
/// </summary>
/// <returns></returns>
public async Task EnsureChapterProgressIsCapped()
{
_logger.LogInformation("Cleaning up any progress rows that exceed chapter page count");
await _unitOfWork.AppUserProgressRepository.UpdateAllProgressThatAreMoreThanChapterPages();
_logger.LogInformation("Cleaning up any progress rows that exceed chapter page count - complete");
}
/// <summary>
/// This does not cleanup any Series that are not Completed or Cancelled
/// </summary>