mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-22 06:03:01 +02:00
Remove unnecessary Attachments
This commit is contained in:
parent
622198a09e
commit
6258e07f20
@ -36,7 +36,6 @@ public class DownloadAvailableChaptersJob : Job
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Manga);
|
||||
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
|
||||
return Manga.Chapters.Select(chapter => new DownloadSingleChapterJob(chapter, this));
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ public class DownloadMangaCoverJob : Job
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Manga);
|
||||
try
|
||||
{
|
||||
Manga.CoverFileNameInCache = Manga.MangaConnector.SaveCoverImageToCache(Manga);
|
||||
|
@ -45,8 +45,6 @@ public class DownloadSingleChapterJob : Job
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Chapter);
|
||||
context.Attach(Chapter.ParentManga);
|
||||
string[] imageUrls = Chapter.ParentManga.MangaConnector.GetChapterImageUrls(Chapter);
|
||||
if (imageUrls.Length < 1)
|
||||
{
|
||||
@ -107,8 +105,7 @@ public class DownloadSingleChapterJob : Job
|
||||
Chapter.Downloaded = true;
|
||||
context.SaveChanges();
|
||||
|
||||
context.Jobs.Load();
|
||||
if (context.Jobs.AsEnumerable().Any(j =>
|
||||
if (context.Jobs.ToList().Any(j =>
|
||||
{
|
||||
if (j.JobType != JobType.UpdateChaptersDownloadedJob)
|
||||
return false;
|
||||
|
@ -40,7 +40,6 @@ public class RetrieveChaptersJob : Job
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Manga);
|
||||
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
|
||||
// This gets all chapters that are not downloaded
|
||||
Chapter[] allChapters = Manga.MangaConnector.GetChapters(Manga, Language);
|
||||
|
@ -36,7 +36,6 @@ public class UpdateChaptersDownloadedJob : Job
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Manga);
|
||||
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
|
||||
return Manga.Chapters.Select(c => new UpdateSingleChapterDownloadedJob(c, this));
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ public class UpdateSingleChapterDownloadedJob : Job
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Chapter);
|
||||
Chapter.Downloaded = Chapter.CheckDownloaded();
|
||||
|
||||
try
|
||||
|
Loading…
x
Reference in New Issue
Block a user