Cache manga list
This commit is contained in:
parent
7bad51d867
commit
9bc22baa80
@ -8,7 +8,7 @@
|
|||||||
<th>
|
<th>
|
||||||
<h3><?= $escape->html($item['title']) ?></h3>
|
<h3><?= $escape->html($item['title']) ?></h3>
|
||||||
<?php if($item['alternate_title'] != ""): ?>
|
<?php if($item['alternate_title'] != ""): ?>
|
||||||
<h4><?= $escape->html($item['alternate_title']) ?></h4>
|
<h4><?= $item['alternate_title'] ?></h4>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
|
@ -218,17 +218,25 @@ class KitsuModel {
|
|||||||
'sort' => '-updated_at'
|
'sort' => '-updated_at'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$cacheItem = $this->cache->getItem($this->getHashForMethodCall($this, __METHOD__, $options));
|
||||||
|
|
||||||
$data = $this->getRequest('library-entries', $options);
|
if ( ! $cacheItem->isHit())
|
||||||
|
|
||||||
foreach($data['data'] as $i => &$item)
|
|
||||||
{
|
{
|
||||||
$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 $cacheItem->get();
|
||||||
|
|
||||||
return $transformed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function search(string $type, string $query): array
|
public function search(string $type, string $query): array
|
||||||
|
Loading…
Reference in New Issue
Block a user