Fix more cover image stuff

This commit is contained in:
Timothy Warren 2022-01-10 17:19:28 -05:00
parent 2b047634a0
commit f40ee254c9
4 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<?php if ($auth->isAuthenticated()): ?>
<button title="Increment episode count" class="plus-one" hidden>+1 Episode</button>
<?php endif ?>
<?= $helper->picture($item['anime']['cover_image'], '.jpg') ?>
<?= $helper->picture($item['anime']['cover_image'], '.jpg', ['width' => 220], ['width' => 220]) ?>
<div class="name">
<a href="<?= $url->generate('anime.details', ['id' => $item['anime']['slug']]) ?>">

View File

@ -125,7 +125,9 @@ final class AnimeTransformer extends AbstractTransformer {
'age_rating' => $base['ageRating'],
'age_rating_guide' => $base['ageRatingGuide'],
'characters' => $characters,
'cover_image' => $base['posterImage']['original']['url'] ?? '/public/images/placeholder.png',
'cover_image' => $base['posterImage']['views'][1]['url']
?? $base['posterImage']['original']['url']
?? '/public/images/placeholder.png',
'episode_count' => $base['episodeCount'],
'episode_length' => $base['episodeLength'],
'genres' => $genres,

View File

@ -239,7 +239,7 @@ class Controller {
protected function renderFullPage(HtmlView $view, string $template, array $data): HtmlView
{
$csp = [
"default-src 'self' media.kitsu.io",
"default-src 'self' media.kitsu.io kitsu-production-media.s3.us-west-002.backblazeb2.com",
"object-src 'none'",
"child-src 'self' *.youtube.com polyfill.io",
];

View File

@ -67,7 +67,7 @@ final class Manga extends Controller {
* @return void
*@throws InvalidArgumentException
*/
public function index(string $status = 'all', string $view = ''): void
public function index(string $status = 'all', ?string $view = ''): void
{
if ( ! in_array($status, [
'all',