diff --git a/app/views/anime/edit.php b/app/views/anime/edit.php
index 6d9a8ff2..66b109af 100644
--- a/app/views/anime/edit.php
+++ b/app/views/anime/edit.php
@@ -16,7 +16,7 @@
- = $helper->picture("images/anime/{$item['anime']['id']}-original.webp", "jpg", [], ["width" => "390"]) ?>
+ = $helper->picture($item['anime']['cover_image'], "jpg", [], ["width" => "390"]) ?>
|
diff --git a/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql b/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql
index 61c795dc..78eca809 100644
--- a/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql
+++ b/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql
@@ -19,6 +19,11 @@ query ($slug: String!) {
id
slug
posterImage {
+ original {
+ width
+ height
+ url
+ }
views {
width
height
diff --git a/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php
index 5c522dcf..f6855630 100644
--- a/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php
+++ b/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php
@@ -184,10 +184,9 @@ abstract class HistoryTransformer {
protected function transformProgress (array $entry): ?HistoryItem
{
- $id = $entry['media']['id'];
$data = $entry['media'];
$title = $this->linkTitle($data);
- $imgUrl = "images/{$this->type}/{$id}.webp";
+ $imgUrl = $data['posterImage']['views'][0]['url'] ?? $data['posterImage']['original']['url'];
$item = end($entry['changedData']['progress']);
// No showing episode 0 nonsense
@@ -226,10 +225,9 @@ abstract class HistoryTransformer {
protected function transformUpdated(array $entry): HistoryItem
{
- $id = $entry['media']['id'];
$data = $entry['media'];
$title = $this->linkTitle($data);
- $imgUrl = "images/{$this->type}/{$id}.webp";
+ $imgUrl = $data['posterImage']['views'][0]['url'] ?? $data['posterImage']['original']['url'];
$kind = array_key_first($entry['changedData']);
diff --git a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php
index 5a5212e8..3b677c36 100644
--- a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php
+++ b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php
@@ -102,7 +102,9 @@ final class LibraryEntryTransformer extends AbstractTransformer
'titles' => $titles,
'slug' => $anime['slug'],
'show_type' => (string)StringType::from($anime['subtype'])->upperCaseFirst(),
- 'cover_image' => $anime['posterImage']['views'][1]['url'],
+ 'cover_image' => $anime['posterImage']['views'][1]['url']
+ ?? $anime['posterImage']['original']['url']
+ ?? '/public/images/placeholder.png',
'genres' => $genres,
'streaming_links' => $streamingLinks,
],