Cleanup bookmarks and Reading List Items (#567)

* Removed directives, ensured we delete bookmarks and reading list items when chapters are deleted.

* Added parsing support for "Kimi no Koto ga Daidaidaidaidaisuki na 100-nin no Kanojo Chapter 11-10"
This commit is contained in:
Joseph Milazzo 2021-09-08 14:41:41 -07:00 committed by GitHub
parent 6c07246980
commit c718e45f4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 27 additions and 22 deletions

View file

@ -185,7 +185,7 @@ namespace API.Services.Tasks
"There was a critical error that resulted in a failed scan. Please check logs and rescan");
}
CleanupUserProgress();
CleanupAbandonedChapters();
BackgroundJob.Enqueue(() => _metadataService.RefreshMetadata(libraryId, forceUpdate));
}
@ -193,18 +193,19 @@ namespace API.Services.Tasks
/// <summary>
/// Remove any user progress rows that no longer exist since scan library ran and deleted series/volumes/chapters
/// </summary>
private void CleanupUserProgress()
private void CleanupAbandonedChapters()
{
var cleanedUp = Task.Run(() => _unitOfWork.AppUserProgressRepository.CleanupAbandonedChapters()).Result;
_logger.LogInformation("Removed {Count} abandoned progress rows", cleanedUp);
}
/// <summary>
/// Cleans up any abandoned rows due to removals from Scan loop
/// </summary>
private void CleanupDbEntities()
{
CleanupUserProgress();
CleanupAbandonedChapters();
var cleanedUp = Task.Run( () => _unitOfWork.CollectionTagRepository.RemoveTagsWithoutSeries()).Result;
_logger.LogInformation("Removed {Count} abandoned collection tags", cleanedUp);
}