Fixed a bug where series weren't delete-able

This commit is contained in:
Joseph Milazzo 2025-04-29 13:33:29 -05:00
parent 3a0d33ca13
commit 01f9cea86f
3 changed files with 11 additions and 5 deletions

View file

@ -450,7 +450,7 @@ public class SeriesService : ISeriesService
try
{
var chapterMappings =
await _unitOfWork.SeriesRepository.GetChapterIdWithSeriesIdForSeriesAsync(seriesIds.ToArray());
await _unitOfWork.SeriesRepository.GetChapterIdWithSeriesIdForSeriesAsync([.. seriesIds]);
var allChapterIds = new List<int>();
foreach (var mapping in chapterMappings)
@ -458,9 +458,8 @@ public class SeriesService : ISeriesService
allChapterIds.AddRange(mapping.Value);
}
// NOTE: This isn't getting all the people and whatnot currently
// BUG: This isn't getting all the people and whatnot currently
var series = await _unitOfWork.SeriesRepository.GetSeriesByIdsAsync(seriesIds);
_unitOfWork.SeriesRepository.Remove(series);
var libraryIds = series.Select(s => s.LibraryId);
@ -481,7 +480,7 @@ public class SeriesService : ISeriesService
await _unitOfWork.AppUserProgressRepository.CleanupAbandonedChapters();
await _unitOfWork.CollectionTagRepository.RemoveCollectionsWithoutSeries();
_taskScheduler.CleanupChapters(allChapterIds.ToArray());
_taskScheduler.CleanupChapters([.. allChapterIds]);
return true;
}
catch (Exception ex)