diff --git a/app/views/collection/edit.php b/app/views/collection/edit.php index f77fa7b5..0d1add75 100644 --- a/app/views/collection/edit.php +++ b/app/views/collection/edit.php @@ -8,7 +8,7 @@

html($item['title']) ?>

-

html($item['alternate_title']) ?>

+

diff --git a/src/API/Kitsu/KitsuModel.php b/src/API/Kitsu/KitsuModel.php index 6c277f1c..97bd7998 100644 --- a/src/API/Kitsu/KitsuModel.php +++ b/src/API/Kitsu/KitsuModel.php @@ -218,17 +218,25 @@ class KitsuModel { 'sort' => '-updated_at' ] ]; + + $cacheItem = $this->cache->getItem($this->getHashForMethodCall($this, __METHOD__, $options)); - $data = $this->getRequest('library-entries', $options); - - foreach($data['data'] as $i => &$item) + if ( ! $cacheItem->isHit()) { - $item['manga'] = $data['included'][$i]; + $data = $this->getRequest('library-entries', $options); + + foreach($data['data'] as $i => &$item) + { + $item['manga'] = $data['included'][$i]; + } + + $transformed = $this->mangaListTransformer->transformCollection($data['data']); + + $cacheItem->set($transformed); + $cacheItem->save(); } - - $transformed = $this->mangaListTransformer->transformCollection($data['data']); - - return $transformed; + + return $cacheItem->get(); } public function search(string $type, string $query): array