2
0

Add Publication to DownloadChapter Method, to later correctly save images.

This commit is contained in:
glax 2023-05-18 16:21:02 +02:00
parent 140aac8f87
commit 317d1435f3
3 changed files with 9 additions and 4 deletions

View File

@ -7,7 +7,12 @@ public abstract class Connector
public abstract string name { get; } public abstract string name { get; }
public abstract Publication[] GetPublications(); public abstract Publication[] GetPublications();
public abstract Chapter[] GetChapters(Publication publication); public abstract Chapter[] GetChapters(Publication publication);
public abstract void DownloadChapter(Chapter chapter); //where to? public abstract void DownloadChapter(Publication publication, Chapter chapter); //where to?
internal void DownloadChapter(string url)
{
}
internal class DownloadClient internal class DownloadClient
{ {

View File

@ -141,7 +141,7 @@ public class MangaDex : Connector
return chapters.OrderBy(chapter => chapter.chapterNumber).ToArray(); return chapters.OrderBy(chapter => chapter.chapterNumber).ToArray();
} }
public override void DownloadChapter(Chapter chapter) public override void DownloadChapter(Publication publication, Chapter chapter)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -27,11 +27,11 @@ public class TrangaTask
_task.Start(); _task.Start();
} }
public static TrangaTask CreateDownloadChapterTask(Connector connector, Chapter chapter, TimeSpan reoccurrence) public static TrangaTask CreateDownloadChapterTask(Connector connector, Publication publication, Chapter chapter, TimeSpan reoccurrence)
{ {
void TaskAction() void TaskAction()
{ {
connector.DownloadChapter(chapter); connector.DownloadChapter(publication, chapter);
} }
return new TrangaTask(TaskAction, reoccurrence); return new TrangaTask(TaskAction, reoccurrence);
} }