Fix 'all' view with missing sections
This commit is contained in:
parent
7caa6d254f
commit
d6b7075229
@ -386,14 +386,20 @@ class Model {
|
|||||||
|
|
||||||
if ( ! $cacheItem->isHit())
|
if ( ! $cacheItem->isHit())
|
||||||
{
|
{
|
||||||
$output = [
|
$output = [];
|
||||||
Title::WATCHING => $this->getAnimeList(KitsuWatchingStatus::WATCHING),
|
$statuses = [
|
||||||
Title::PLAN_TO_WATCH => $this->getAnimeList(KitsuWatchingStatus::PLAN_TO_WATCH),
|
Title::WATCHING => KitsuWatchingStatus::WATCHING,
|
||||||
Title::ON_HOLD => $this->getAnimeList(KitsuWatchingStatus::ON_HOLD),
|
Title::PLAN_TO_WATCH => KitsuWatchingStatus::PLAN_TO_WATCH,
|
||||||
Title::DROPPED => $this->getAnimeList(KitsuWatchingStatus::DROPPED),
|
Title::ON_HOLD, KitsuWatchingStatus::ON_HOLD,
|
||||||
Title::COMPLETED => $this->getAnimeList(KitsuWatchingStatus::COMPLETED)
|
Title::DROPPED => KitsuWatchingStatus::DROPPED,
|
||||||
|
Title::COMPLETED => KitsuWatchingStatus::COMPLETED
|
||||||
];
|
];
|
||||||
|
|
||||||
|
foreach ($statuses as $key => $status)
|
||||||
|
{
|
||||||
|
$output[$key] = $this->getAnimeList($status) ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
$cacheItem->set($output);
|
$cacheItem->set($output);
|
||||||
$cacheItem->save();
|
$cacheItem->save();
|
||||||
}
|
}
|
||||||
@ -413,7 +419,16 @@ class Model {
|
|||||||
|
|
||||||
if ( ! $cacheItem->isHit())
|
if ( ! $cacheItem->isHit())
|
||||||
{
|
{
|
||||||
$data = $this->getRawAnimeList($status);
|
$data = $this->getRawAnimeList($status) ?? [];
|
||||||
|
|
||||||
|
// Bail out on no data
|
||||||
|
if (empty($data))
|
||||||
|
{
|
||||||
|
$cacheItem->set([]);
|
||||||
|
$cacheItem->save();
|
||||||
|
return $cacheItem->get();
|
||||||
|
}
|
||||||
|
|
||||||
$included = JsonAPI::organizeIncludes($data['included']);
|
$included = JsonAPI::organizeIncludes($data['included']);
|
||||||
$included = JsonAPI::inlineIncludedRelationships($included, 'anime');
|
$included = JsonAPI::inlineIncludedRelationships($included, 'anime');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user