UpdateMetadata now finishes correctly.
This commit is contained in:
parent
45c0f19a9d
commit
77f93d87f9
@ -26,6 +26,9 @@ public class UpdateMetadata : Job
|
|||||||
Manga? possibleUpdatedManga = mangaConnector.GetMangaFromId(manga.publicationId);
|
Manga? possibleUpdatedManga = mangaConnector.GetMangaFromId(manga.publicationId);
|
||||||
if (possibleUpdatedManga is { } updatedManga)
|
if (possibleUpdatedManga is { } updatedManga)
|
||||||
{
|
{
|
||||||
|
if(updatedManga.Equals(this.manga))
|
||||||
|
return Array.Empty<Job>();
|
||||||
|
|
||||||
cachedPublications.Remove(this.manga);
|
cachedPublications.Remove(this.manga);
|
||||||
this.manga = updatedManga;
|
this.manga = updatedManga;
|
||||||
cachedPublications.Add(updatedManga);
|
cachedPublications.Add(updatedManga);
|
||||||
@ -38,12 +41,15 @@ public class UpdateMetadata : Job
|
|||||||
throw new Exception("Jobtype has to be DownloadNewChapters");
|
throw new Exception("Jobtype has to be DownloadNewChapters");
|
||||||
dncJob.manga = updatedManga;
|
dncJob.manga = updatedManga;
|
||||||
}
|
}
|
||||||
|
this.progressToken.Complete();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log($"Could not find Manga {manga}");
|
Log($"Could not find Manga {manga}");
|
||||||
|
this.progressToken.Cancel();
|
||||||
return Array.Empty<Job>();
|
return Array.Empty<Job>();
|
||||||
}
|
}
|
||||||
|
this.progressToken.Cancel();
|
||||||
return Array.Empty<Job>();
|
return Array.Empty<Job>();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user