6 Commits

Author SHA1 Message Date
1cd819b21d update docker-compose 2023-06-01 15:40:14 +02:00
27afedc1b4 year in series.json 2023-06-01 15:25:26 +02:00
fac0a3f7eb resolves #2 2023-06-01 15:08:32 +02:00
03ca480fe8 remove empty lines at start of description 2023-06-01 14:59:09 +02:00
c2915468a5 status .tolower 2023-06-01 14:58:58 +02:00
8805c53cb8 wrong url for manga info page 2023-06-01 13:37:06 +02:00
4 changed files with 13 additions and 6 deletions

View File

@ -54,6 +54,7 @@
Tranga can download Chapters and Metadata from Scanlation sites such as Tranga can download Chapters and Metadata from Scanlation sites such as
- [MangaDex.org](https://mangadex.org/) - [MangaDex.org](https://mangadex.org/)
- [Manganato.com](https://manganato.com/)
and automatically start updates in [Komga](https://komga.org/) to import them. and automatically start updates in [Komga](https://komga.org/) to import them.

View File

@ -72,7 +72,7 @@ public class Manganato : Connector
Dictionary<string, string>? links = null; Dictionary<string, string>? links = null;
HashSet<string> tags = new(); HashSet<string> tags = new();
string? author = null, originalLanguage = null; string? author = null, originalLanguage = null;
int? year = null; int? year = DateTime.Now.Year;
HtmlNode infoNode = document.DocumentNode.Descendants("div").First(d => d.HasClass("story-info-right")); HtmlNode infoNode = document.DocumentNode.Descendants("div").First(d => d.HasClass("story-info-right"));
@ -114,8 +114,13 @@ public class Manganato : Connector
string description = document.DocumentNode.Descendants("div").First(d => d.HasClass("panel-story-info-description")) string description = document.DocumentNode.Descendants("div").First(d => d.HasClass("panel-story-info-description"))
.InnerText.Replace("Description :", ""); .InnerText.Replace("Description :", "");
while (description.StartsWith('\n'))
description = description.Substring(1);
string yearString = document.DocumentNode.Descendants("li").Last(li => li.HasClass("a-h")).Descendants("span")
.First(s => s.HasClass("chapter-time")).InnerText;
year = Convert.ToInt32(yearString.Split(',')[^1]) + 2000;
return new Publication(sortName, author, description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links, return new Publication(sortName, author, description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,
year, originalLanguage, status, publicationId); year, originalLanguage, status, publicationId);
} }
@ -123,7 +128,7 @@ public class Manganato : Connector
public override Chapter[] GetChapters(Publication publication, string language = "") public override Chapter[] GetChapters(Publication publication, string language = "")
{ {
logger?.WriteLine(this.GetType().ToString(), $"Getting Chapters for {publication.sortName} {publication.internalId} (language={language})"); logger?.WriteLine(this.GetType().ToString(), $"Getting Chapters for {publication.sortName} {publication.internalId} (language={language})");
string requestUrl = $"https://manganato.com/{publication.publicationId}"; string requestUrl = $"https://chapmanganato.com/{publication.publicationId}";
DownloadClient.RequestResult requestResult = DownloadClient.RequestResult requestResult =
downloadClient.MakeRequest(requestUrl, (byte)1); downloadClient.MakeRequest(requestUrl, (byte)1);
if (requestResult.statusCode != HttpStatusCode.OK) if (requestResult.statusCode != HttpStatusCode.OK)

View File

@ -95,9 +95,9 @@ public readonly struct Publication
{ {
this.name = name; this.name = name;
this.year = year; this.year = year;
if(status == "ongoing" || status == "hiatus") if(status.ToLower() == "ongoing" || status.ToLower() == "hiatus")
this.status = "Continuing"; this.status = "Continuing";
else if (status == "completed" || status == "cancelled") else if (status.ToLower() == "completed" || status.ToLower() == "cancelled")
this.status = "Ended"; this.status = "Ended";
else else
this.status = status; this.status = status;

View File

@ -17,4 +17,5 @@ services:
ports: ports:
- 9555:80 - 9555:80
depends_on: depends_on:
- tranga-api - tranga-api
restart: unless-stopped