Don't log exceptions to Sentry when debugging locally. Fixed a constraint issue with collection tags that prevented deleting series. Ensure when we scan we add SeriesMetadata objects to existing series. (#265)

This commit is contained in:
Joseph Milazzo 2021-06-04 17:49:19 -05:00 committed by GitHub
parent 606e4c8b12
commit aa7439178c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 51 deletions

View file

@ -172,10 +172,11 @@ namespace API.Controllers
var username = User.GetUsername();
_logger.LogInformation("Library {LibraryId} is being deleted by {UserName}", libraryId, username);
var series = await _unitOfWork.SeriesRepository.GetSeriesForLibraryIdAsync(libraryId);
var seriesIds = series.Select(x => x.Id).ToArray();
var chapterIds =
await _unitOfWork.SeriesRepository.GetChapterIdsForSeriesAsync(series.Select(x => x.Id).ToArray());
var result = await _unitOfWork.LibraryRepository.DeleteLibrary(libraryId);
await _unitOfWork.SeriesRepository.GetChapterIdsForSeriesAsync(seriesIds);
var result = await _unitOfWork.LibraryRepository.DeleteLibrary(libraryId);
if (result && chapterIds.Any())
{
_taskScheduler.CleanupChapters(chapterIds);