From 1c3024fca7b8330b75e93fde673af09b1d797fa5 Mon Sep 17 00:00:00 2001 From: Facundo Tuesca Date: Wed, 8 May 2024 00:25:45 +0200 Subject: [PATCH] [MangaReaderBridge] Change feed title to manga name (#4092) --- bridges/MangaReaderBridge.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bridges/MangaReaderBridge.php b/bridges/MangaReaderBridge.php index 1fa0c62dc54..1b8e765b134 100644 --- a/bridges/MangaReaderBridge.php +++ b/bridges/MangaReaderBridge.php @@ -26,11 +26,26 @@ class MangaReaderBridge extends BridgeAbstract ] ]; + protected $feedName = ''; + + + public function getName() + { + if (empty($this->feedName)) { + return parent::getName(); + } else { + return $this->feedName; + } + } + public function collectData() { $url = $this->getInput('url'); $lang = $this->getInput('lang'); $dom = getSimpleHTMLDOM($url); + $aniDetail = $dom->getElementById('ani_detail'); + $this->feedName = html_entity_decode($aniDetail->find('h2', 0)->plaintext); + $chapters = $dom->getElementById($lang . '-chapters'); foreach ($chapters->getElementsByTagName('li') as $chapter) {