Add field "url" to Chapter to know where to download.
This commit is contained in:
parent
317d1435f3
commit
d13a7c3e49
@ -6,12 +6,14 @@ public struct Chapter
|
||||
public string? name { get; }
|
||||
public string? volumeNumber { get; }
|
||||
public string? chapterNumber { get; }
|
||||
public string url { get; }
|
||||
|
||||
public Chapter(Publication publication, string? name, string? volumeNumber, string? chapterNumber)
|
||||
public Chapter(Publication publication, string? name, string? volumeNumber, string? chapterNumber, string url)
|
||||
{
|
||||
this.publication = publication;
|
||||
this.name = name;
|
||||
this.volumeNumber = volumeNumber;
|
||||
this.chapterNumber = chapterNumber;
|
||||
this.url = url;
|
||||
}
|
||||
}
|
@ -123,6 +123,8 @@ public class MangaDex : Connector
|
||||
foreach (JsonObject chapter in chaptersInResult)
|
||||
{
|
||||
JsonObject attributes = chapter!["attributes"]!.AsObject();
|
||||
string chapterId = attributes["id"]!.GetValue<string>();
|
||||
|
||||
string? title = attributes.ContainsKey("title") && attributes["title"] is not null
|
||||
? attributes["title"]!.GetValue<string>()
|
||||
: null;
|
||||
@ -135,7 +137,7 @@ public class MangaDex : Connector
|
||||
? attributes["chapter"]!.GetValue<string>()
|
||||
: null;
|
||||
|
||||
chapters.Add(new Chapter(publication, title, volume, chapterNum));
|
||||
chapters.Add(new Chapter(publication, title, volume, chapterNum, chapterId));
|
||||
}
|
||||
}
|
||||
return chapters.OrderBy(chapter => chapter.chapterNumber).ToArray();
|
||||
|
Loading…
Reference in New Issue
Block a user