diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs
index ffb79ea..81108ce 100644
--- a/Tranga/TaskManager.cs
+++ b/Tranga/TaskManager.cs
@@ -371,6 +371,31 @@ public class TaskManager
{
return this.chapterCollection.Keys.ToArray();
}
+
+
+ ///
+ /// Updates the available Chapters of a Publication
+ ///
+ /// Connector to use
+ /// Publication to check
+ /// Language to receive chapters for
+ /// List of Chapters that were previously not in collection
+ public List GetNewChaptersList(Connector connector, Publication publication, string language)
+ {
+ List newChaptersList = new();
+ chapterCollection.TryAdd(publication, newChaptersList); //To ensure publication is actually in collection
+
+ Chapter[] newChapters = connector.GetChapters(publication, language);
+ newChaptersList = newChapters.Where(nChapter => !connector.CheckChapterIsDownloaded(publication, nChapter)).ToList();
+
+ return newChaptersList;
+ }
+
+ public List GetExistingChaptersList(Connector connector, Publication publication, string language)
+ {
+ Chapter[] newChapters = connector.GetChapters(publication, language);
+ return newChapters.Where(nChapter => connector.CheckChapterIsDownloaded(publication, nChapter)).ToList();
+ }
///
/// Return Connector with given Name
diff --git a/Tranga/TrangaTasks/DownloadNewChaptersTask.cs b/Tranga/TrangaTasks/DownloadNewChaptersTask.cs
index 7ab78b8..df46409 100644
--- a/Tranga/TrangaTasks/DownloadNewChaptersTask.cs
+++ b/Tranga/TrangaTasks/DownloadNewChaptersTask.cs
@@ -24,7 +24,7 @@ public class DownloadNewChaptersTask : TrangaTask
//Check if Publication already has a Folder
pub.CreatePublicationFolder(taskManager.settings.downloadLocation);
- List newChapters = GetNewChaptersList(connector, pub, language!, ref taskManager.chapterCollection);
+ List newChapters = taskManager.GetNewChaptersList(connector, pub, language!);
connector.CopyCoverFromCacheToDownloadLocation(pub, taskManager.settings);
@@ -37,25 +37,6 @@ public class DownloadNewChaptersTask : TrangaTask
this.childTasks.Add(newTask);
}
}
-
- ///
- /// Updates the available Chapters of a Publication
- ///
- /// Connector to use
- /// Publication to check
- /// Language to receive chapters for
- ///
- /// List of Chapters that were previously not in collection
- private static List GetNewChaptersList(Connector connector, Publication publication, string language, ref Dictionary> chapterCollection)
- {
- List newChaptersList = new();
- chapterCollection.TryAdd(publication, newChaptersList); //To ensure publication is actually in collection
-
- Chapter[] newChapters = connector.GetChapters(publication, language);
- newChaptersList = newChapters.Where(nChapter => !connector.CheckChapterIsDownloaded(publication, nChapter)).ToList();
-
- return newChaptersList;
- }
public override string ToString()
{