Merge pull request '#67 prevent crash if xml document does not exist' (!60) from cuttingedge into master
Reviewed-on: #60
This commit is contained in:
commit
ca9c0b22c1
@ -121,6 +121,8 @@ public class Mangasee : MangaConnector
|
||||
public override Chapter[] GetChapters(Manga manga, string language="en")
|
||||
{
|
||||
Log($"Getting chapters {manga}");
|
||||
try
|
||||
{
|
||||
XDocument doc = XDocument.Load($"https://mangasee123.com/rss/{manga.publicationId}.xml");
|
||||
XElement[] chapterItems = doc.Descendants("item").ToArray();
|
||||
List<Chapter> chapters = new();
|
||||
@ -138,6 +140,12 @@ public class Mangasee : MangaConnector
|
||||
Log($"Got {chapters.Count} chapters. {manga}");
|
||||
return chapters.OrderBy(chapter => Convert.ToSingle(chapter.chapterNumber, numberFormatDecimalPoint)).ToArray();
|
||||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
Log($"Failed to load XML\n\r{e}");
|
||||
return Array.Empty<Chapter>();
|
||||
}
|
||||
}
|
||||
|
||||
public override HttpStatusCode DownloadChapter(Chapter chapter, ProgressToken? progressToken = null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user