ScanLibrary now respects the library a series belongs to, doesn't reset series every run but updates/removes/inserts as needed.

This commit is contained in:
Joseph Milazzo 2021-01-19 14:35:24 -06:00
parent 44ebca36ec
commit e180032a8e
5 changed files with 54 additions and 29 deletions

View file

@ -170,7 +170,7 @@ namespace API.Controllers
{
var username = User.GetUsername();
_logger.LogInformation($"Library {libraryId} is being deleted by {username}.");
var series = await _unitOfWork.SeriesRepository.GetSeriesDtoForLibraryIdAsync(libraryId);
var series = await _unitOfWork.SeriesRepository.GetSeriesForLibraryIdAsync(libraryId);
var volumes = (await _unitOfWork.SeriesRepository.GetVolumesForSeriesAsync(series.Select(x => x.Id).ToArray()))
.Select(x => x.Id).ToArray();
var result = await _unitOfWork.LibraryRepository.DeleteLibrary(libraryId);