From 93cfdddd19f260eba05ed77bc78d354ebe2a1148 Mon Sep 17 00:00:00 2001 From: Glax Date: Sat, 14 Dec 2024 17:51:22 +0100 Subject: [PATCH 1/3] Possible fix #300 chromium statup "Failed to launch browser! chrome_crashpad_handler: --database is required" --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 55a5f6c..35eb708 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime:$DOTNET AS base WORKDIR /publish ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium +ENV XDG_CONFIG_HOME=/tmp/.chromium +ENV XDG_CACHE_HOME=/tmp/.chromium RUN apt-get update \ && apt-get install -y libx11-6 libx11-xcb1 libatk1.0-0 libgtk-3-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libxshmfence1 libnss3 chromium \ && apt-get autopurge -y \ From b8c624f3eaba4ee9adf8551e2b2c6a27ae0d07a3 Mon Sep 17 00:00:00 2001 From: Glax Date: Sat, 14 Dec 2024 17:55:20 +0100 Subject: [PATCH 2/3] AsuraToon crash when there is no search-results #296 --- Tranga/MangaConnectors/AsuraToon.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tranga/MangaConnectors/AsuraToon.cs b/Tranga/MangaConnectors/AsuraToon.cs index b19334a..ea05fcd 100644 --- a/Tranga/MangaConnectors/AsuraToon.cs +++ b/Tranga/MangaConnectors/AsuraToon.cs @@ -55,8 +55,8 @@ public class AsuraToon : MangaConnector private Manga[] ParsePublicationsFromHtml(HtmlDocument document) { HtmlNodeCollection mangaList = document.DocumentNode.SelectNodes("//a[starts-with(@href,'series')]"); - if (mangaList.Count < 1) - return Array.Empty(); + if (mangaList is null || mangaList.Count < 1) + return []; IEnumerable urls = mangaList.Select(a => $"https://asuracomic.net/{a.GetAttributeValue("href", "")}"); From 825b945ad1d507a29a86f81aed4481e20af93716 Mon Sep 17 00:00:00 2001 From: Glax Date: Sat, 14 Dec 2024 18:02:41 +0100 Subject: [PATCH 3/3] AsuraToon Crash on no Artists or Authors Fix #296 --- Tranga/MangaConnectors/AsuraToon.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tranga/MangaConnectors/AsuraToon.cs b/Tranga/MangaConnectors/AsuraToon.cs index ea05fcd..8ec5265 100644 --- a/Tranga/MangaConnectors/AsuraToon.cs +++ b/Tranga/MangaConnectors/AsuraToon.cs @@ -102,11 +102,13 @@ public class AsuraToon : MangaConnector HtmlNode descriptionNode = document.DocumentNode.SelectSingleNode("//h3[starts-with(text(),'Synopsis')]/../span"); - string description = descriptionNode.InnerText; + string description = descriptionNode?.InnerText??""; HtmlNodeCollection authorNodes = document.DocumentNode.SelectNodes("//h3[text()='Author']/../h3[not(text()='Author' or text()='_')]"); - HtmlNodeCollection artistNodes = document.DocumentNode.SelectNodes("//h3[text()='Artist']/../h3[not(text()='Author' or text()='_')]"); - List authors = authorNodes.Select(a => a.InnerText).Concat(artistNodes.Select(a => a.InnerText)).ToList(); + HtmlNodeCollection artistNodes = document.DocumentNode.SelectNodes("//h3[text()='Artist']/../h3[not(text()='Artist' or text()='_')]"); + IEnumerable authorNames = authorNodes is null ? [] : authorNodes.Select(a => a.InnerText); + IEnumerable artistNames = artistNodes is null ? [] : artistNodes.Select(a => a.InnerText); + List authors = authorNames.Concat(artistNames).ToList(); HtmlNode? firstChapterNode = document.DocumentNode.SelectSingleNode("//a[contains(@href, 'chapter/1')]/../following-sibling::h3"); int? year = int.Parse(firstChapterNode?.InnerText.Split(' ')[^1] ?? "2000");