Update user details page to pull images directly from Kitsu
Some checks failed
timw4mail/HummingBirdAnimeClient/pipeline/head There was a failure building this commit
Some checks failed
timw4mail/HummingBirdAnimeClient/pipeline/head There was a failure building this commit
This commit is contained in:
parent
02d99c8a43
commit
f210b157ff
@ -16,7 +16,7 @@ use Aviat\AnimeClient\Kitsu;
|
||||
<section class="flex flex-no-wrap">
|
||||
<aside class="info">
|
||||
<center>
|
||||
<?= $helper->img($urlGenerator->assetUrl($data['avatar']), ['alt' => '']); ?>
|
||||
<?= $helper->img($data['avatar'], ['alt' => '']); ?>
|
||||
</center>
|
||||
<br />
|
||||
<table class="media-details">
|
||||
@ -75,7 +75,7 @@ use Aviat\AnimeClient\Kitsu;
|
||||
$rendered[] = $component->character(
|
||||
$item['names']['canonical'],
|
||||
$url->generate('character', ['slug' => $item['slug']]),
|
||||
$helper->picture("images/characters/{$item['id']}.webp")
|
||||
$helper->img($item['image']['original']['url'])
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -86,7 +86,7 @@ use Aviat\AnimeClient\Kitsu;
|
||||
Kitsu::getFilteredTitles($item['titles']),
|
||||
),
|
||||
$url->generate("{$type}.details", ['id' => $item['slug']]),
|
||||
$helper->picture("images/{$type}/{$item['id']}.webp"),
|
||||
$helper->img(Kitsu::getPosterImage($item), ['width' => 220]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -102,6 +102,11 @@ query ($slug: String!) {
|
||||
original {
|
||||
url
|
||||
}
|
||||
views {
|
||||
url
|
||||
height
|
||||
width
|
||||
}
|
||||
}
|
||||
names {
|
||||
alternatives
|
||||
|
@ -42,7 +42,7 @@ final class UserTransformer extends AbstractTransformer {
|
||||
|
||||
return User::from([
|
||||
'about' => $base['about'],
|
||||
'avatar' => getLocalImg($base['avatarImage']['original']['url'], FALSE),
|
||||
'avatar' => $base['avatarImage']['original']['url'],
|
||||
'favorites' => $this->organizeFavorites($favorites),
|
||||
'location' => $base['location'],
|
||||
'name' => $base['name'],
|
||||
|
@ -343,7 +343,7 @@ final class Kitsu {
|
||||
* @param int $size
|
||||
* @return string
|
||||
*/
|
||||
public static function getPosterImage(array $base, int $size = 1): string
|
||||
public static function getPosterImage(array $base, int $size = 2): string
|
||||
{
|
||||
$rawUrl = $base['posterImage']['views'][$size]['url']
|
||||
?? $base['posterImage']['original']['url']
|
||||
|
Loading…
Reference in New Issue
Block a user