Skip to content

Commit

Permalink
AnimeCardParser: fix type returning - instead of Unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Jan 2, 2022
1 parent 42c5eed commit d41c453
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Parser/Common/AnimeCardParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@ public function getType(): ?string
$text = JString::cleanse($text->text());
preg_match('/^([a-zA-Z-\.]+)/', $text, $matches);

return $matches[1];
$type = $matches[1];

if ($type === '-') {
$type = 'Unknown';
}

return $type;
}

/**
Expand Down

0 comments on commit d41c453

Please sign in to comment.