mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
fixed broadcast adapter function in Anime model
This commit is contained in:
parent
c628007729
commit
896c68f9b4
@ -15,6 +15,7 @@ use Jikan\Helper\Constants;
|
|||||||
use Jikan\Jikan;
|
use Jikan\Jikan;
|
||||||
use Jikan\Request\Anime\AnimeRequest;
|
use Jikan\Request\Anime\AnimeRequest;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use MongoDB\Model\BSONDocument;
|
||||||
|
|
||||||
class Anime extends JikanApiSearchableModel
|
class Anime extends JikanApiSearchableModel
|
||||||
{
|
{
|
||||||
@ -407,7 +408,7 @@ class Anime extends JikanApiSearchableModel
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function adaptBroadcastValue(array|string|null $broadcast): array
|
private function adaptBroadcastValue(array|string|null|BSONDocument $broadcast): array
|
||||||
{
|
{
|
||||||
$null_value = [
|
$null_value = [
|
||||||
'day' => null,
|
'day' => null,
|
||||||
@ -423,6 +424,10 @@ class Anime extends JikanApiSearchableModel
|
|||||||
return $broadcast;
|
return $broadcast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($broadcast instanceof BSONDocument) {
|
||||||
|
return $broadcast->getArrayCopy();
|
||||||
|
}
|
||||||
|
|
||||||
if (!preg_match('~(.*) at (.*) \(~', $broadcast, $matches)) {
|
if (!preg_match('~(.*) at (.*) \(~', $broadcast, $matches)) {
|
||||||
return [
|
return [
|
||||||
'day' => null,
|
'day' => null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user