Compare commits

..

No commits in common. "develop" and "master" have entirely different histories.

12 changed files with 19 additions and 20 deletions

View File

@ -5,7 +5,7 @@ use Aviat\AnimeClient\Kitsu;
<h2 class="toph"> <h2 class="toph">
About About
<?= $_->h->a( <?= $_->h->a(
"https://kitsu.app/users/{$data['slug']}", "https://kitsu.io/users/{$data['slug']}",
$data['name'], [ $data['name'], [
'title' => 'View profile on Kitsu' 'title' => 'View profile on Kitsu'
]) ])

View File

@ -48,12 +48,11 @@
"monolog/monolog": "^3.0.0", "monolog/monolog": "^3.0.0",
"php": ">= 8.2.0", "php": ">= 8.2.0",
"psr/http-message": "^1.0.1 || ^2.0.0", "psr/http-message": "^1.0.1 || ^2.0.0",
"symfony/polyfill-mbstring": "^1.0.0",
"symfony/polyfill-util": "^1.0.0",
"tracy/tracy": "^2.8.0", "tracy/tracy": "^2.8.0",
"yosymfony/toml": "^1.0.4" "yosymfony/toml": "^1.0.4"
}, },
"replace": {
"symfony/polyfill-mbstring": "*"
},
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.2.0", "phpstan/phpstan": "^1.2.0",
"phpunit/phpunit": "^10.0.0", "phpunit/phpunit": "^10.0.0",

View File

@ -113,7 +113,7 @@ final class AnimeTransformer extends AbstractTransformer
if ((is_countable($base['mappings']['nodes']) ? count($base['mappings']['nodes']) : 0) > 0) if ((is_countable($base['mappings']['nodes']) ? count($base['mappings']['nodes']) : 0) > 0)
{ {
$links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.app/anime/{$base['slug']}"); $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.io/anime/{$base['slug']}");
} }
return AnimePage::from([ return AnimePage::from([
@ -138,7 +138,7 @@ final class AnimeTransformer extends AbstractTransformer
'titles_more' => $titles_more, 'titles_more' => $titles_more,
'total_length' => $base['totalLength'], 'total_length' => $base['totalLength'],
'trailer_id' => $base['youtubeTrailerVideoId'], 'trailer_id' => $base['youtubeTrailerVideoId'],
'url' => "https://kitsu.app/anime/{$base['slug']}", 'url' => "https://kitsu.io/anime/{$base['slug']}",
]); ]);
} }
} }

View File

@ -182,7 +182,7 @@ final class LibraryEntryTransformer extends AbstractTransformer
'title' => $title, 'title' => $title,
'titles' => $titles, 'titles' => $titles,
'type' => (string) StringType::from($manga['subtype'])->upperCaseFirst(), 'type' => (string) StringType::from($manga['subtype'])->upperCaseFirst(),
'url' => 'https://kitsu.app/manga/' . $manga['slug'], 'url' => 'https://kitsu.io/manga/' . $manga['slug'],
]), ]),
'reading_status' => strtolower($item['status']), 'reading_status' => strtolower($item['status']),
'notes' => $item['notes'], 'notes' => $item['notes'],

View File

@ -94,7 +94,7 @@ final class MangaListTransformer extends AbstractTransformer
'title' => $title, 'title' => $title,
'titles' => $titles, 'titles' => $titles,
'type' => (string) StringType::from($manga['subtype'])->toLowerCase()->upperCaseFirst(), 'type' => (string) StringType::from($manga['subtype'])->toLowerCase()->upperCaseFirst(),
'url' => 'https://kitsu.app/manga/' . $manga['slug'], 'url' => 'https://kitsu.io/manga/' . $manga['slug'],
]), ]),
'reading_status' => strtolower($item['status']), 'reading_status' => strtolower($item['status']),
'notes' => $item['notes'], 'notes' => $item['notes'],

View File

@ -114,7 +114,7 @@ final class MangaTransformer extends AbstractTransformer
if ((is_countable($base['mappings']['nodes']) ? count($base['mappings']['nodes']) : 0) > 0) if ((is_countable($base['mappings']['nodes']) ? count($base['mappings']['nodes']) : 0) > 0)
{ {
$links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.app/manga/{$base['slug']}"); $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.io/manga/{$base['slug']}");
} }
$data = [ $data = [
@ -134,7 +134,7 @@ final class MangaTransformer extends AbstractTransformer
'title' => $title, 'title' => $title,
'titles' => $titles, 'titles' => $titles,
'titles_more' => $titles_more, 'titles_more' => $titles_more,
'url' => "https://kitsu.app/manga/{$base['slug']}", 'url' => "https://kitsu.io/manga/{$base['slug']}",
]; ];
return MangaPage::from($data); return MangaPage::from($data);

View File

@ -2,7 +2,7 @@ schema: schema.graphql
extensions: extensions:
endpoints: endpoints:
Kitsu: Kitsu:
url: https://kitsu.app/api/graphql url: https://kitsu.io/api/graphql
headers: headers:
user-agent: JS GraphQL user-agent: JS GraphQL
introspect: true introspect: true

View File

@ -227,9 +227,9 @@ 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.app kitsu-production-media.s3.us-west-002.backblazeb2.com", "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", "child-src 'self' *.youtube.com polyfill.io",
]; ];
$data = array_merge($this->baseData ?? [], $data); $data = array_merge($this->baseData ?? [], $data);

View File

@ -40,7 +40,7 @@ final class Images extends BaseController
{ {
$currentUrl = (string) $this->request->getUri(); $currentUrl = (string) $this->request->getUri();
$kitsuUrl = 'https://media.kitsu.app/'; $kitsuUrl = 'https://media.kitsu.io/';
$fileName = str_replace('-original', '', $file); $fileName = str_replace('-original', '', $file);
[$id, $ext] = explode('.', basename($fileName)); [$id, $ext] = explode('.', basename($fileName));

View File

@ -23,14 +23,14 @@ use const PHP_URL_HOST;
*/ */
final class Kitsu final class Kitsu
{ {
public const AUTH_URL = 'https://kitsu.app/api/oauth/token'; public const AUTH_URL = 'https://kitsu.io/api/oauth/token';
public const AUTH_USER_ID_KEY = 'kitsu-auth-userid'; public const AUTH_USER_ID_KEY = 'kitsu-auth-userid';
public const AUTH_TOKEN_CACHE_KEY = 'kitsu-auth-token'; public const AUTH_TOKEN_CACHE_KEY = 'kitsu-auth-token';
public const AUTH_TOKEN_EXP_CACHE_KEY = 'kitsu-auth-token-expires'; public const AUTH_TOKEN_EXP_CACHE_KEY = 'kitsu-auth-token-expires';
public const AUTH_TOKEN_REFRESH_CACHE_KEY = 'kitsu-auth-token-refresh'; public const AUTH_TOKEN_REFRESH_CACHE_KEY = 'kitsu-auth-token-refresh';
public const ANIME_HISTORY_LIST_CACHE_KEY = 'kitsu-anime-history-list'; public const ANIME_HISTORY_LIST_CACHE_KEY = 'kitsu-anime-history-list';
public const MANGA_HISTORY_LIST_CACHE_KEY = 'kitsu-manga-history-list'; public const MANGA_HISTORY_LIST_CACHE_KEY = 'kitsu-manga-history-list';
public const GRAPHQL_ENDPOINT = 'https://kitsu.app/api/graphql'; public const GRAPHQL_ENDPOINT = 'https://kitsu.io/api/graphql';
/** /**
* Determine whether an anime is airing, finished airing, or has not yet aired * Determine whether an anime is airing, finished airing, or has not yet aired

View File

@ -1,7 +1,7 @@
empty: false empty: false
about: 'Web Developer, Anime Fan, Reader of VNs, and web comics.' about: 'Web Developer, Anime Fan, Reader of VNs, and web comics.'
avatar: 'https://media.kitsu.io/users/avatars/2644/original.gif' avatar: 'https://media.kitsu.io/users/avatars/2644/original.gif'
birthday: 'March 09, 1990 (34 years)' birthday: 'March 09, 1990 (33 years)'
joinDate: '' joinDate: ''
gender: male gender: male
favorites: favorites:

View File

@ -1,6 +1,6 @@
{ {
"require": { "require": {
"friendsofphp/php-cs-fixer": "^3.52.1", "friendsofphp/php-cs-fixer": "^3.6",
"rector/rector": "^1.0.3" "rector/rector": "^0.16.0"
} }
} }