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()): ?> <?php if ($auth->isAuthenticated()): ?>
<button title="Increment episode count" class="plus-one" hidden>+1 Episode</button> <button title="Increment episode count" class="plus-one" hidden>+1 Episode</button>
<?php endif ?> <?php endif ?>
<?= $helper->picture($item['anime']['cover_image'], '.jpg') ?> <?= $helper->picture($item['anime']['cover_image'], '.jpg', ['width' => 220], ['width' => 220]) ?>
<div class="name"> <div class="name">
<a href="<?= $url->generate('anime.details', ['id' => $item['anime']['slug']]) ?>"> <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' => $base['ageRating'],
'age_rating_guide' => $base['ageRatingGuide'], 'age_rating_guide' => $base['ageRatingGuide'],
'characters' => $characters, '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_count' => $base['episodeCount'],
'episode_length' => $base['episodeLength'], 'episode_length' => $base['episodeLength'],
'genres' => $genres, 'genres' => $genres,

View File

@ -239,7 +239,7 @@ class Controller {
protected function renderFullPage(HtmlView $view, string $template, array $data): HtmlView protected function renderFullPage(HtmlView $view, string $template, array $data): HtmlView
{ {
$csp = [ $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'", "object-src 'none'",
"child-src 'self' *.youtube.com polyfill.io", "child-src 'self' *.youtube.com polyfill.io",
]; ];

View File

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