diff --git a/API/Data/DataContext.cs b/API/Data/DataContext.cs index c83ff2fa1..714e29fdf 100644 --- a/API/Data/DataContext.cs +++ b/API/Data/DataContext.cs @@ -71,6 +71,7 @@ public sealed class DataContext : IdentityDbContext ExternalSeriesMetadata { get; set; } = null!; public DbSet ExternalRecommendation { get; set; } = null!; public DbSet ManualMigrationHistory { get; set; } = null!; + [Obsolete] public DbSet SeriesBlacklist { get; set; } = null!; public DbSet AppUserCollection { get; set; } = null!; public DbSet ChapterPeople { get; set; } = null!; diff --git a/API/Data/Repositories/SeriesRepository.cs b/API/Data/Repositories/SeriesRepository.cs index 31ddc22f1..572273d16 100644 --- a/API/Data/Repositories/SeriesRepository.cs +++ b/API/Data/Repositories/SeriesRepository.cs @@ -563,7 +563,13 @@ public class SeriesRepository : ISeriesRepository if (!fullSeries) return await query.ToListAsync(); - return await query.Include(s => s.Volumes) + return await query + .Include(s => s.Volumes) + .ThenInclude(v => v.Chapters) + .ThenInclude(c => c.ExternalRatings) + .Include(s => s.Volumes) + .ThenInclude(v => v.Chapters) + .ThenInclude(c => c.ExternalReviews) .Include(s => s.Relations) .Include(s => s.Metadata) diff --git a/API/Services/SeriesService.cs b/API/Services/SeriesService.cs index b51ed2df6..2de1c6ee8 100644 --- a/API/Services/SeriesService.cs +++ b/API/Services/SeriesService.cs @@ -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(); 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)