Cache manga list
This commit is contained in:
parent
5c34c92453
commit
95f768aed3
@ -8,7 +8,7 @@
|
||||
<th>
|
||||
<h3><?= $escape->html($item['title']) ?></h3>
|
||||
<?php if($item['alternate_title'] != ""): ?>
|
||||
<h4><?= $escape->html($item['alternate_title']) ?></h4>
|
||||
<h4><?= $item['alternate_title'] ?></h4>
|
||||
<?php endif ?>
|
||||
</th>
|
||||
<th>
|
||||
|
@ -219,6 +219,10 @@ class KitsuModel {
|
||||
]
|
||||
];
|
||||
|
||||
$cacheItem = $this->cache->getItem($this->getHashForMethodCall($this, __METHOD__, $options));
|
||||
|
||||
if ( ! $cacheItem->isHit())
|
||||
{
|
||||
$data = $this->getRequest('library-entries', $options);
|
||||
|
||||
foreach($data['data'] as $i => &$item)
|
||||
@ -228,7 +232,11 @@ class KitsuModel {
|
||||
|
||||
$transformed = $this->mangaListTransformer->transformCollection($data['data']);
|
||||
|
||||
return $transformed;
|
||||
$cacheItem->set($transformed);
|
||||
$cacheItem->save();
|
||||
}
|
||||
|
||||
return $cacheItem->get();
|
||||
}
|
||||
|
||||
public function search(string $type, string $query): array
|
||||
|
Loading…
Reference in New Issue
Block a user