Ony load necessary References and Collections

This commit is contained in:
Glax 2025-05-18 15:16:55 +02:00
parent 84aecda916
commit 96d5b09391
6 changed files with 0 additions and 6 deletions

View File

@ -15,7 +15,6 @@ public class LibraryContext(DbContextOptions<LibraryContext> options) : DbContex
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.EnableSensitiveDataLogging();
optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTrackingWithIdentityResolution);
optionsBuilder.LogTo(s =>
{
Log.Debug(s);

View File

@ -15,7 +15,6 @@ public class NotificationsContext(DbContextOptions<NotificationsContext> options
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.EnableSensitiveDataLogging();
optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTrackingWithIdentityResolution);
optionsBuilder.LogTo(s =>
{
Log.Debug(s);

View File

@ -21,7 +21,6 @@ public class PgsqlContext(DbContextOptions<PgsqlContext> options) : DbContext(op
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.EnableSensitiveDataLogging();
optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTrackingWithIdentityResolution);
optionsBuilder.LogTo(s =>
{
Log.Debug(s);

View File

@ -42,7 +42,6 @@ public class MoveMangaLibraryJob : Job
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
{
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
context.Entry(Manga).Reference<LocalLibrary>(m => m.Library).Load();
Dictionary<Chapter, string> oldPath = Manga.Chapters.ToDictionary(c => c, c => c.FullArchiveFilePath);
Manga.Library = ToLibrary;

View File

@ -40,7 +40,6 @@ public class RetrieveChaptersJob : Job
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
{
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
// This gets all chapters that are not downloaded
Chapter[] allChapters = Manga.MangaConnector.GetChapters(Manga, Language).DistinctBy(c => c.ChapterId).ToArray();
Chapter[] newChapters = allChapters.Where(chapter => Manga.Chapters.Select(c => c.ChapterId).Contains(chapter.ChapterId) == false).ToArray();

View File

@ -36,7 +36,6 @@ public class UpdateChaptersDownloadedJob : Job
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
{
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
return Manga.Chapters.Select(c => new UpdateSingleChapterDownloadedJob(c, this));
}
}