[MangaReaderBridge] Change feed title to manga name (#4092)

This commit is contained in:
Facundo Tuesca 2024-05-08 00:25:45 +02:00 committed by GitHub
parent d11b7f7754
commit 1c3024fca7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {