[BakaUpdatesMangaReleasesBridge] filter title and groups (#1058)

Baka-Updates Manga uses an asterisk (*) to denote series information have
been updated within the last 24 hours. This is not helpful in a feed.
This commit is contained in:
fulmeek 2019-03-14 19:43:00 +01:00 committed by LogMANOriginal
parent 326a707739
commit 696afa96d3

View file

@ -31,7 +31,7 @@ class BakaUpdatesMangaReleasesBridge extends BridgeAbstract {
); );
if (isset($rows[0][1])) { if (isset($rows[0][1])) {
$this->feedName = html_entity_decode($rows[0][1]->plaintext); $this->feedName = $this->filterHTML($rows[0][1]->plaintext);
} }
foreach($rows as $cols) { foreach($rows as $cols) {
@ -48,8 +48,8 @@ class BakaUpdatesMangaReleasesBridge extends BridgeAbstract {
$objTitle = $cols[1]; $objTitle = $cols[1];
if ($objTitle) { if ($objTitle) {
$title[] = html_entity_decode($objTitle->plaintext); $title[] = $this->filterHTML($objTitle->plaintext);
$item['content'] .= '<p>Series: ' . $objTitle->innertext . '</p>'; $item['content'] .= '<p>Series: ' . $this->filterText($objTitle->innertext) . '</p>';
} }
$objVolume = $cols[2]; $objVolume = $cols[2];
@ -62,8 +62,8 @@ class BakaUpdatesMangaReleasesBridge extends BridgeAbstract {
$objAuthor = $cols[4]; $objAuthor = $cols[4];
if ($objAuthor && !empty($objAuthor->plaintext)) { if ($objAuthor && !empty($objAuthor->plaintext)) {
$item['author'] = html_entity_decode($objAuthor->plaintext); $item['author'] = $this->filterHTML($objAuthor->plaintext);
$item['content'] .= '<p>Groups: ' . $objAuthor->innertext . '</p>'; $item['content'] .= '<p>Groups: ' . $this->filterText($objAuthor->innertext) . '</p>';
} }
$item['title'] = implode(' ', $title); $item['title'] = implode(' ', $title);
@ -88,4 +88,12 @@ class BakaUpdatesMangaReleasesBridge extends BridgeAbstract {
} }
return parent::getName(); return parent::getName();
} }
private function filterText($text) {
return rtrim($text, '*');
}
private function filterHTML($text) {
return $this->filterText(html_entity_decode($text));
}
} }