From cb23807348a8777a70fe87853587a0f9eb67aa5f Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 13 Aug 2024 07:56:20 -0400 Subject: [PATCH] Fix other old Kitsu url references --- app/views/user/details.php | 4 ++-- src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php | 4 ++-- .../API/Kitsu/Transformer/LibraryEntryTransformer.php | 2 +- .../API/Kitsu/Transformer/MangaListTransformer.php | 2 +- src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php | 4 ++-- src/AnimeClient/API/Kitsu/graphql.config.yml | 2 +- src/AnimeClient/Controller.php | 4 ++-- src/AnimeClient/Controller/Images.php | 2 +- .../__snapshots__/UserTransformerTest__testTransform__1.yml | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/user/details.php b/app/views/user/details.php index 930cbbc3..93c2640d 100644 --- a/app/views/user/details.php +++ b/app/views/user/details.php @@ -5,7 +5,7 @@ use Aviat\AnimeClient\Kitsu;

About h->a( - "https://kitsu.io/users/{$data['slug']}", + "https://kitsu.app/users/{$data['slug']}", $data['name'], [ 'title' => 'View profile on Kitsu' ]) @@ -107,4 +107,4 @@ use Aviat\AnimeClient\Kitsu; - \ No newline at end of file + diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php index 4a1ed8dd..54230558 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -113,7 +113,7 @@ final class AnimeTransformer extends AbstractTransformer if ((is_countable($base['mappings']['nodes']) ? count($base['mappings']['nodes']) : 0) > 0) { - $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.io/anime/{$base['slug']}"); + $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.app/anime/{$base['slug']}"); } return AnimePage::from([ @@ -138,7 +138,7 @@ final class AnimeTransformer extends AbstractTransformer 'titles_more' => $titles_more, 'total_length' => $base['totalLength'], 'trailer_id' => $base['youtubeTrailerVideoId'], - 'url' => "https://kitsu.io/anime/{$base['slug']}", + 'url' => "https://kitsu.app/anime/{$base['slug']}", ]); } } diff --git a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php index 18a66c1c..00345838 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php @@ -182,7 +182,7 @@ final class LibraryEntryTransformer extends AbstractTransformer 'title' => $title, 'titles' => $titles, 'type' => (string) StringType::from($manga['subtype'])->upperCaseFirst(), - 'url' => 'https://kitsu.io/manga/' . $manga['slug'], + 'url' => 'https://kitsu.app/manga/' . $manga['slug'], ]), 'reading_status' => strtolower($item['status']), 'notes' => $item['notes'], diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php index 2a5ad595..a60d1668 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php @@ -94,7 +94,7 @@ final class MangaListTransformer extends AbstractTransformer 'title' => $title, 'titles' => $titles, 'type' => (string) StringType::from($manga['subtype'])->toLowerCase()->upperCaseFirst(), - 'url' => 'https://kitsu.io/manga/' . $manga['slug'], + 'url' => 'https://kitsu.app/manga/' . $manga['slug'], ]), 'reading_status' => strtolower($item['status']), 'notes' => $item['notes'], diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php index 42f1ce48..3a22213d 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php @@ -114,7 +114,7 @@ final class MangaTransformer extends AbstractTransformer if ((is_countable($base['mappings']['nodes']) ? count($base['mappings']['nodes']) : 0) > 0) { - $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.io/manga/{$base['slug']}"); + $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.app/manga/{$base['slug']}"); } $data = [ @@ -134,7 +134,7 @@ final class MangaTransformer extends AbstractTransformer 'title' => $title, 'titles' => $titles, 'titles_more' => $titles_more, - 'url' => "https://kitsu.io/manga/{$base['slug']}", + 'url' => "https://kitsu.app/manga/{$base['slug']}", ]; return MangaPage::from($data); diff --git a/src/AnimeClient/API/Kitsu/graphql.config.yml b/src/AnimeClient/API/Kitsu/graphql.config.yml index 82a6e896..7cbb2d6a 100644 --- a/src/AnimeClient/API/Kitsu/graphql.config.yml +++ b/src/AnimeClient/API/Kitsu/graphql.config.yml @@ -2,7 +2,7 @@ schema: schema.graphql extensions: endpoints: Kitsu: - url: https://kitsu.io/api/graphql + url: https://kitsu.app/api/graphql headers: user-agent: JS GraphQL introspect: true diff --git a/src/AnimeClient/Controller.php b/src/AnimeClient/Controller.php index f973aa64..fd93c6b2 100644 --- a/src/AnimeClient/Controller.php +++ b/src/AnimeClient/Controller.php @@ -227,9 +227,9 @@ class Controller protected function renderFullPage(HtmlView $view, string $template, array $data): HtmlView { $csp = [ - "default-src 'self' media.kitsu.io kitsu-production-media.s3.us-west-002.backblazeb2.com", + "default-src 'self' media.kitsu.app kitsu-production-media.s3.us-west-002.backblazeb2.com", "object-src 'none'", - "child-src 'self' *.youtube.com polyfill.io", + "child-src 'self' *.youtube.com", ]; $data = array_merge($this->baseData ?? [], $data); diff --git a/src/AnimeClient/Controller/Images.php b/src/AnimeClient/Controller/Images.php index 3908824e..b0817646 100644 --- a/src/AnimeClient/Controller/Images.php +++ b/src/AnimeClient/Controller/Images.php @@ -40,7 +40,7 @@ final class Images extends BaseController { $currentUrl = (string) $this->request->getUri(); - $kitsuUrl = 'https://media.kitsu.io/'; + $kitsuUrl = 'https://media.kitsu.app/'; $fileName = str_replace('-original', '', $file); [$id, $ext] = explode('.', basename($fileName)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/UserTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/UserTransformerTest__testTransform__1.yml index e4f8ffe7..f7ad76df 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/UserTransformerTest__testTransform__1.yml +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/UserTransformerTest__testTransform__1.yml @@ -1,7 +1,7 @@ empty: false about: 'Web Developer, Anime Fan, Reader of VNs, and web comics.' avatar: 'https://media.kitsu.io/users/avatars/2644/original.gif' -birthday: 'March 09, 1990 (33 years)' +birthday: 'March 09, 1990 (34 years)' joinDate: '' gender: male favorites: