mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 03:17:33 +01:00
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into cuttingedge
This commit is contained in:
commit
d0f9a4102c
@ -1,4 +1,5 @@
|
|||||||
using System.Net;
|
using System.Globalization;
|
||||||
|
using System.Net;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using HtmlAgilityPack;
|
using HtmlAgilityPack;
|
||||||
using Tranga.Jobs;
|
using Tranga.Jobs;
|
||||||
@ -126,10 +127,17 @@ public class Manganato : MangaConnector
|
|||||||
.InnerText.Replace("Description :", "");
|
.InnerText.Replace("Description :", "");
|
||||||
while (description.StartsWith('\n'))
|
while (description.StartsWith('\n'))
|
||||||
description = description.Substring(1);
|
description = description.Substring(1);
|
||||||
|
|
||||||
|
string pattern = "MMM dd,yyyy HH:mm";
|
||||||
|
|
||||||
string yearString = document.DocumentNode.Descendants("li").Last(li => li.HasClass("a-h")).Descendants("span")
|
HtmlNode oldestChapter = document.DocumentNode
|
||||||
.First(s => s.HasClass("chapter-time")).InnerText;
|
.SelectNodes("//chapter-time[contains(concat(' ',normalize-space(@class),' '),' chapter-time ')]").MaxBy(
|
||||||
int year = Convert.ToInt32(yearString.Split(',')[^1]) + 2000;
|
node => DateTime.ParseExact(node.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern,
|
||||||
|
CultureInfo.InvariantCulture))!;
|
||||||
|
|
||||||
|
|
||||||
|
int year = DateTime.ParseExact(oldestChapter.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern,
|
||||||
|
CultureInfo.InvariantCulture).Year;
|
||||||
|
|
||||||
Manga manga = new (sortName, authors.ToList(), description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,
|
Manga manga = new (sortName, authors.ToList(), description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,
|
||||||
year, originalLanguage, publicationId, releaseStatus, websiteUrl: websiteUrl);
|
year, originalLanguage, publicationId, releaseStatus, websiteUrl: websiteUrl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user