From 3bb3d2a5cff694e4a3d6ec47b2cc44708dd1ab96 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 28 Jul 2020 16:11:13 -0400 Subject: [PATCH 01/86] Prepare for Kitsu GraphQL --- app/bootstrap.php | 12 +- .../GraphQL/Queries/AnimeDetails.graphql | 226 +++---- src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php | 316 +++++++++ .../API/Kitsu/KitsuJsonApiRequestBuilder.php | 271 ++++++++ src/AnimeClient/API/Kitsu/KitsuMangaTrait.php | 291 ++++++++ .../API/Kitsu/KitsuMutationTrait.php | 81 +++ .../API/Kitsu/KitsuRequestBuilder.php | 243 +------ src/AnimeClient/API/Kitsu/KitsuTrait.php | 28 +- src/AnimeClient/API/Kitsu/ListItem.php | 8 +- src/AnimeClient/API/Kitsu/Model.php | 639 +----------------- src/AnimeClient/Command/BaseCommand.php | 12 +- 11 files changed, 1151 insertions(+), 976 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php create mode 100644 src/AnimeClient/API/Kitsu/KitsuJsonApiRequestBuilder.php create mode 100644 src/AnimeClient/API/Kitsu/KitsuMangaTrait.php create mode 100644 src/AnimeClient/API/Kitsu/KitsuMutationTrait.php diff --git a/app/bootstrap.php b/app/bootstrap.php index 34068f1b..206ed872 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -22,7 +22,7 @@ use Aura\Session\SessionFactory; use Aviat\AnimeClient\API\{ Anilist, Kitsu, - Kitsu\KitsuRequestBuilder + Kitsu\KitsuJsonApiRequestBuilder }; use Aviat\AnimeClient\Model; use Aviat\Banker\Teller; @@ -114,16 +114,20 @@ return static function (array $configArray = []): Container { // Models $container->set('kitsu-model', static function(ContainerInterface $container): Kitsu\Model { - $requestBuilder = new KitsuRequestBuilder($container); + $jsonApiRequestBuilder = new KitsuJsonApiRequestBuilder($container); + $jsonApiRequestBuilder->setLogger($container->getLogger('kitsu-request')); + + $requestBuilder = new Kitsu\KitsuRequestBuilder($container); $requestBuilder->setLogger($container->getLogger('kitsu-request')); $listItem = new Kitsu\ListItem(); $listItem->setContainer($container); - $listItem->setRequestBuilder($requestBuilder); + $listItem->setJsonApiRequestBuilder($jsonApiRequestBuilder); $model = new Kitsu\Model($listItem); $model->setContainer($container); - $model->setRequestBuilder($requestBuilder); + $model->setJsonApiRequestBuilder($jsonApiRequestBuilder) + ->setRequestBuilder($requestBuilder); $cache = $container->get('cache'); $model->setCache($cache); diff --git a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql index 055ed172..889800b5 100644 --- a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql +++ b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql @@ -1,120 +1,118 @@ query ($slug: String) { - anime(slug: $slug) { - nodes { - ageRating - ageRatingGuide - bannerImage { - original { - height - name - url - width - } - views { - height - name - url - width - } + findAnimeBySlug(slug: $slug) { + ageRating + ageRatingGuide + bannerImage { + original { + height + name + url + width } - characters { - nodes { - character { - names { - canonical - alternatives - } - slug - } - role - voices { - nodes { - id - licensor { - id - name - } - locale - person { - id - names { - alternatives - canonical - localized - } - } - } - } - } - pageInfo { - endCursor - hasNextPage - hasPreviousPage - startCursor - } + views { + height + name + url + width } - endDate - episodeCount - episodeLength - posterImage { - original { - height - name - url - width - } - views { - height - name - url - width - } - } - season - sfw - slug - staff { - nodes { - person { - id - birthday - image { - original { - height - name - url - width - } - views { - height - name - url - width - } - } - names { - alternatives - canonical - localized - } - } - role - } - pageInfo { - endCursor - hasNextPage - hasPreviousPage - startCursor - } - } - status - synopsis - titles { - alternatives - canonical - localized - } - totalLength } + characters { + nodes { + character { + names { + canonical + alternatives + } + slug + } + role + voices { + nodes { + id + licensor { + id + name + } + locale + person { + id + names { + alternatives + canonical + localized + } + } + } + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + } + endDate + episodeCount + episodeLength + posterImage { + original { + height + name + url + width + } + views { + height + name + url + width + } + } + season + sfw + slug + staff { + nodes { + person { + id + birthday + image { + original { + height + name + url + width + } + views { + height + name + url + width + } + } + names { + alternatives + canonical + localized + } + } + role + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + } + status + synopsis + titles { + alternatives + canonical + localized + } + totalLength } } diff --git a/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php b/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php new file mode 100644 index 00000000..43192448 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php @@ -0,0 +1,316 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu; + +use Amp\Http\Client\Request; +use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; +use Aviat\AnimeClient\API\JsonAPI; +use Aviat\AnimeClient\API\Kitsu as K; +use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeHistoryTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer; +use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; +use Aviat\AnimeClient\API\ParallelAPIRequest; +use Aviat\AnimeClient\Enum\ListType; +use Aviat\AnimeClient\Types\Anime; +use Aviat\Banker\Exception\InvalidArgumentException; +use Aviat\Ion\Json; + +/** + * Anime-related list methods + */ +trait KitsuAnimeTrait { + /** + * Class to map anime list items + * to a common format used by + * templates + * + * @var AnimeListTransformer + */ + protected AnimeListTransformer $animeListTransformer; + + /** + * @var AnimeTransformer + */ + protected AnimeTransformer $animeTransformer; + + // ------------------------------------------------------------------------- + // ! Anime-specific methods + // ------------------------------------------------------------------------- + + /** + * Get information about a particular anime + * + * @param string $slug + * @return Anime + */ + public function getAnime(string $slug): Anime + { + $baseData = $this->getRawMediaData('anime', $slug); + + if (empty($baseData)) + { + return Anime::from([]); + } + + return $this->animeTransformer->transform($baseData); + } + + /** + * Retrieve the data for the anime watch history page + * + * @return array + * @throws InvalidArgumentException + * @throws Throwable + */ + public function getAnimeHistory(): array + { + $key = K::ANIME_HISTORY_LIST_CACHE_KEY; + $list = $this->cache->get($key, NULL); + + if ($list === NULL) + { + $raw = $this->getRawHistoryList('anime'); + + $organized = JsonAPI::organizeData($raw); + $organized = array_filter($organized, fn ($item) => array_key_exists('relationships', $item)); + + $list = (new AnimeHistoryTransformer())->transform($organized); + + $this->cache->set($key, $list); + + } + + return $list; + } + + /** + * Get information about a particular anime + * + * @param string $animeId + * @return Anime + */ + public function getAnimeById(string $animeId): Anime + { + $baseData = $this->getRawMediaDataById('anime', $animeId); + return $this->animeTransformer->transform($baseData); + } + + /** + * Get the anime list for the configured user + * + * @param string $status - The watching status to filter the list with + * @return array + * @throws InvalidArgumentException + */ + public function getAnimeList(string $status): array + { + $key = "kitsu-anime-list-{$status}"; + + $list = $this->cache->get($key, NULL); + + if ($list === NULL) + { + $data = $this->getRawAnimeList($status) ?? []; + + // Bail out on no data + if (empty($data)) + { + return []; + } + + $included = JsonAPI::organizeIncludes($data['included']); + $included = JsonAPI::inlineIncludedRelationships($included, 'anime'); + + foreach($data['data'] as $i => &$item) + { + $item['included'] = $included; + } + unset($item); + $transformed = $this->animeListTransformer->transformCollection($data['data']); + $keyed = []; + + foreach($transformed as $item) + { + $keyed[$item['id']] = $item; + } + + $list = $keyed; + $this->cache->set($key, $list); + } + + return $list; + } + + /** + * Get the number of anime list items + * + * @param string $status - Optional status to filter by + * @return int + * @throws InvalidArgumentException + */ + public function getAnimeListCount(string $status = '') : int + { + return $this->getListCount(ListType::ANIME, $status); + } + + /** + * Get the full anime list + * + * @param array $options + * @return array + * @throws InvalidArgumentException + * @throws Throwable + */ + public function getFullRawAnimeList(array $options = [ + 'include' => 'anime.mappings' + ]): array + { + $status = $options['filter']['status'] ?? ''; + $count = $this->getAnimeListCount($status); + $size = static::LIST_PAGE_SIZE; + $pages = ceil($count / $size); + + $requester = new ParallelAPIRequest(); + + // Set up requests + for ($i = 0; $i < $pages; $i++) + { + $offset = $i * $size; + $requester->addRequest($this->getPagedAnimeList($size, $offset, $options)); + } + + $responses = $requester->makeRequests(); + $output = []; + + foreach($responses as $response) + { + $data = Json::decode($response); + $output[] = $data; + } + + return array_merge_recursive(...$output); + } + + /** + * Get all the anime entries, that are organized for output to html + * + * @return array + * @throws ReflectionException + * @throws InvalidArgumentException + */ + public function getFullOrganizedAnimeList(): array + { + $output = []; + + $statuses = KitsuWatchingStatus::getConstList(); + + foreach ($statuses as $key => $status) + { + $mappedStatus = AnimeWatchingStatus::KITSU_TO_TITLE[$status]; + $output[$mappedStatus] = $this->getAnimeList($status) ?? []; + } + + return $output; + } + + /** + * Get the mal id for the anime represented by the kitsu id + * to enable updating MyAnimeList + * + * @param string $kitsuAnimeId The id of the anime on Kitsu + * @return string|null Returns the mal id if it exists, otherwise null + */ + public function getMalIdForAnime(string $kitsuAnimeId): ?string + { + $options = [ + 'query' => [ + 'include' => 'mappings' + ] + ]; + $data = $this->jsonApiRequestBuilder->getRequest("anime/{$kitsuAnimeId}", $options); + + if ( ! array_key_exists('included', $data)) + { + return NULL; + } + + $mappings = array_column($data['included'], 'attributes'); + + foreach($mappings as $map) + { + if ($map['externalSite'] === 'myanimelist/anime') + { + return $map['externalId']; + } + } + + return NULL; + } + + /** + * Get the full anime list in paginated form + * + * @param int $limit + * @param int $offset + * @param array $options + * @return Request + * @throws InvalidArgumentException + */ + public function getPagedAnimeList(int $limit, int $offset = 0, array $options = [ + 'include' => 'anime.mappings' + ]): Request + { + $defaultOptions = [ + 'filter' => [ + 'user_id' => $this->getUserId(), + 'kind' => 'anime' + ], + 'page' => [ + 'offset' => $offset, + 'limit' => $limit + ], + 'sort' => '-updated_at' + ]; + $options = array_merge($defaultOptions, $options); + + return $this->jsonApiRequestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); + } + + /** + * Get the raw (unorganized) anime list for the configured user + * + * @param string $status - The watching status to filter the list with + * @return array + * @throws InvalidArgumentException + * @throws Throwable + */ + public function getRawAnimeList(string $status): array + { + $options = [ + 'filter' => [ + 'user_id' => $this->getUserId(), + 'kind' => 'anime', + 'status' => $status, + ], + 'include' => 'media,media.categories,media.mappings,anime.streamingLinks', + 'sort' => '-updated_at' + ]; + + return $this->getFullRawAnimeList($options); + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/KitsuJsonApiRequestBuilder.php b/src/AnimeClient/API/Kitsu/KitsuJsonApiRequestBuilder.php new file mode 100644 index 00000000..93c7601d --- /dev/null +++ b/src/AnimeClient/API/Kitsu/KitsuJsonApiRequestBuilder.php @@ -0,0 +1,271 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu; + +use const Aviat\AnimeClient\SESSION_SEGMENT; +use const Aviat\AnimeClient\USER_AGENT; + +use function Amp\Promise\wait; +use function Aviat\AnimeClient\getResponse; + +use Amp\Http\Client\Request; +use Amp\Http\Client\Response; +use Aviat\AnimeClient\API\APIRequestBuilder; +use Aviat\AnimeClient\API\FailedResponseException; +use Aviat\AnimeClient\API\Kitsu as K; +use Aviat\AnimeClient\Enum\EventType; +use Aviat\Ion\Di\ContainerAware; +use Aviat\Ion\Di\ContainerInterface; +use Aviat\Ion\Event; +use Aviat\Ion\Json; +use Aviat\Ion\JsonException; + +final class KitsuJsonApiRequestBuilder extends APIRequestBuilder { + use ContainerAware; + + /** + * The base url for api requests + * @var string $base_url + */ + protected string $baseUrl = 'https://kitsu.io/api/edge/'; + + /** + * HTTP headers to send with every request + * + * @var array + */ + protected array $defaultHeaders = [ + 'User-Agent' => USER_AGENT, + 'Accept' => 'application/vnd.api+json', + 'Content-Type' => 'application/vnd.api+json', + 'CLIENT_ID' => 'dd031b32d2f56c990b1425efe6c42ad847e7fe3ab46bf1299f05ecd856bdb7dd', + 'CLIENT_SECRET' => '54d7307928f63414defd96399fc31ba847961ceaecef3a5fd93144e960c0e151', + ]; + + public function __construct(ContainerInterface $container) + { + $this->setContainer($container); + } + + /** + * Create a request object + * + * @param string $type + * @param string $url + * @param array $options + * @return Request + */ + public function setUpRequest(string $type, string $url, array $options = []): Request + { + $request = $this->newRequest($type, $url); + + $sessionSegment = $this->getContainer() + ->get('session') + ->getSegment(SESSION_SEGMENT); + + $cache = $this->getContainer()->get('cache'); + $token = null; + + if ($cache->has(K::AUTH_TOKEN_CACHE_KEY)) + { + $token = $cache->get(K::AUTH_TOKEN_CACHE_KEY); + } + else if ($url !== K::AUTH_URL && $sessionSegment->get('auth_token') !== NULL) + { + $token = $sessionSegment->get('auth_token'); + if ( ! (empty($token) || $cache->has(K::AUTH_TOKEN_CACHE_KEY))) + { + $cache->set(K::AUTH_TOKEN_CACHE_KEY, $token); + } + } + + if ($token !== NULL) + { + $request = $request->setAuth('bearer', $token); + } + + if (array_key_exists('form_params', $options)) + { + $request = $request->setFormFields($options['form_params']); + } + + if (array_key_exists('query', $options)) + { + $request = $request->setQuery($options['query']); + } + + if (array_key_exists('body', $options)) + { + $request = $request->setJsonBody($options['body']); + } + + if (array_key_exists('headers', $options)) + { + $request = $request->setHeaders($options['headers']); + } + + return $request->getFullRequest(); + } + + /** + * Remove some boilerplate for get requests + * + * @param mixed ...$args + * @throws Throwable + * @return array + */ + public function getRequest(...$args): array + { + return $this->request('GET', ...$args); + } + + /** + * Remove some boilerplate for patch requests + * + * @param mixed ...$args + * @throws Throwable + * @return array + */ + public function patchRequest(...$args): array + { + return $this->request('PATCH', ...$args); + } + + /** + * Remove some boilerplate for post requests + * + * @param mixed ...$args + * @throws Throwable + * @return array + */ + public function postRequest(...$args): array + { + $logger = NULL; + if ($this->getContainer()) + { + $logger = $this->container->getLogger('kitsu-request'); + } + + $response = $this->getResponse('POST', ...$args); + $validResponseCodes = [200, 201]; + + if ( ! in_array($response->getStatus(), $validResponseCodes, TRUE) && $logger) + { + $logger->warning('Non 2xx response for POST api call', $response->getBody()); + } + + return JSON::decode(wait($response->getBody()->buffer()), TRUE); + } + + /** + * Remove some boilerplate for delete requests + * + * @param mixed ...$args + * @throws Throwable + * @return bool + */ + public function deleteRequest(...$args): bool + { + $response = $this->getResponse('DELETE', ...$args); + return ($response->getStatus() === 204); + } + + /** + * Make a request + * + * @param string $type + * @param string $url + * @param array $options + * @return Response + * @throws Throwable + */ + public function getResponse(string $type, string $url, array $options = []): Response + { + $logger = NULL; + if ($this->getContainer()) + { + $logger = $this->container->getLogger('kitsu-request'); + } + + $request = $this->setUpRequest($type, $url, $options); + + $response = getResponse($request); + + if ($logger) + { + $logger->debug('Kitsu API Response', [ + 'response_status' => $response->getStatus(), + 'request_headers' => $response->getOriginalRequest()->getHeaders(), + 'response_headers' => $response->getHeaders() + ]); + } + + return $response; + } + + /** + * Make a request + * + * @param string $type + * @param string $url + * @param array $options + * @throws JsonException + * @throws FailedResponseException + * @throws Throwable + * @return array + */ + private function request(string $type, string $url, array $options = []): array + { + $logger = NULL; + if ($this->getContainer()) + { + $logger = $this->container->getLogger('kitsu-request'); + } + + $response = $this->getResponse($type, $url, $options); + $statusCode = $response->getStatus(); + + // Check for requests that are unauthorized + if ($statusCode === 401 || $statusCode === 403) + { + Event::emit(EventType::UNAUTHORIZED); + } + + // Any other type of failed request + if ($statusCode > 299 || $statusCode < 200) + { + if ($logger) + { + $logger->warning('Non 2xx response for api call', (array)$response); + } + + throw new FailedResponseException('Failed to get the proper response from the API'); + } + + try + { + return Json::decode(wait($response->getBody()->buffer())); + } + catch (JsonException $e) + { + print_r($e); + die(); + } + } + + +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/KitsuMangaTrait.php b/src/AnimeClient/API/Kitsu/KitsuMangaTrait.php new file mode 100644 index 00000000..9c844bd0 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/KitsuMangaTrait.php @@ -0,0 +1,291 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu; + +use Amp\Http\Client\Request; +use Aviat\AnimeClient\API\Enum\MangaReadingStatus\Kitsu as KitsuReadingStatus; +use Aviat\AnimeClient\API\JsonAPI; +use Aviat\AnimeClient\API\Kitsu as K; +use Aviat\AnimeClient\API\Kitsu\Transformer\MangaHistoryTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; +use Aviat\AnimeClient\API\Mapping\MangaReadingStatus; +use Aviat\AnimeClient\API\ParallelAPIRequest; +use Aviat\AnimeClient\Enum\ListType; +use Aviat\AnimeClient\Types\MangaPage; +use Aviat\Banker\Exception\InvalidArgumentException; +use Aviat\Ion\Json; + +/** + * Manga-related list methods + */ +trait KitsuMangaTrait { + /** + * @var MangaTransformer + */ + protected MangaTransformer $mangaTransformer; + + /** + * @var MangaListTransformer + */ + protected MangaListTransformer $mangaListTransformer; + + // ------------------------------------------------------------------------- + // ! Manga-specific methods + // ------------------------------------------------------------------------- + + /** + * Get information about a particular manga + * + * @param string $slug + * @return MangaPage + */ + public function getManga(string $slug): MangaPage + { + $baseData = $this->getRawMediaData('manga', $slug); + + if (empty($baseData)) + { + return MangaPage::from([]); + } + + return $this->mangaTransformer->transform($baseData); + } + + /** + * Retrieve the data for the manga read history page + * + * @return array + * @throws InvalidArgumentException + * @throws Throwable + */ + public function getMangaHistory(): array + { + $key = K::MANGA_HISTORY_LIST_CACHE_KEY; + $list = $this->cache->get($key, NULL); + + if ($list === NULL) + { + $raw = $this->getRawHistoryList('manga'); + $organized = JsonAPI::organizeData($raw); + $organized = array_filter($organized, fn ($item) => array_key_exists('relationships', $item)); + + $list = (new MangaHistoryTransformer())->transform($organized); + + $this->cache->set($key, $list); + } + + return $list; + } + + /** + * Get information about a particular manga + * + * @param string $mangaId + * @return MangaPage + */ + public function getMangaById(string $mangaId): MangaPage + { + $baseData = $this->getRawMediaDataById('manga', $mangaId); + return $this->mangaTransformer->transform($baseData); + } + + /** + * Get the manga list for the configured user + * + * @param string $status - The reading status by which to filter the list + * @param int $limit - The number of list items to fetch per page + * @param int $offset - The page offset + * @return array + * @throws InvalidArgumentException + */ + public function getMangaList(string $status, int $limit = 200, int $offset = 0): array + { + $options = [ + 'query' => [ + 'filter' => [ + 'user_id' => $this->getUserId(), + 'kind' => 'manga', + 'status' => $status, + ], + 'include' => 'media,media.categories,media.mappings', + 'page' => [ + 'offset' => $offset, + 'limit' => $limit + ], + 'sort' => '-updated_at' + ] + ]; + + $key = "kitsu-manga-list-{$status}"; + + $list = $this->cache->get($key, NULL); + + if ($list === NULL) + { + $data = $this->jsonApiRequestBuilder->getRequest('library-entries', $options) ?? []; + + // Bail out on no data + if (empty($data) || ( ! array_key_exists('included', $data))) + { + return []; + } + + $included = JsonAPI::organizeIncludes($data['included']); + $included = JsonAPI::inlineIncludedRelationships($included, 'manga'); + + foreach($data['data'] as $i => &$item) + { + $item['included'] = $included; + } + unset($item); + + $list = $this->mangaListTransformer->transformCollection($data['data']); + + $this->cache->set($key, $list); + } + + return $list; + } + + /** + * Get the number of manga list items + * + * @param string $status - Optional status to filter by + * @return int + * @throws InvalidArgumentException + */ + public function getMangaListCount(string $status = '') : int + { + return $this->getListCount(ListType::MANGA, $status); + } + + /** + * Get the full manga list + * + * @param array $options + * @return array + * @throws InvalidArgumentException + * @throws Throwable + */ + public function getFullRawMangaList(array $options = [ + 'include' => 'manga.mappings' + ]): array + { + $status = $options['filter']['status'] ?? ''; + $count = $this->getMangaListCount($status); + $size = static::LIST_PAGE_SIZE; + $pages = ceil($count / $size); + + $requester = new ParallelAPIRequest(); + + // Set up requests + for ($i = 0; $i < $pages; $i++) + { + $offset = $i * $size; + $requester->addRequest($this->getPagedMangaList($size, $offset, $options)); + } + + $responses = $requester->makeRequests(); + $output = []; + + foreach($responses as $response) + { + $data = Json::decode($response); + $output[] = $data; + } + + return array_merge_recursive(...$output); + } + + /** + * Get all Manga lists + * + * @return array + * @throws ReflectionException + * @throws InvalidArgumentException + */ + public function getFullOrganizedMangaList(): array + { + $statuses = KitsuReadingStatus::getConstList(); + $output = []; + foreach ($statuses as $status) + { + $mappedStatus = MangaReadingStatus::KITSU_TO_TITLE[$status]; + $output[$mappedStatus] = $this->getMangaList($status); + } + + return $output; + } + + /** + * Get the full manga list in paginated form + * + * @param int $limit + * @param int $offset + * @param array $options + * @return Request + * @throws InvalidArgumentException + */ + public function getPagedMangaList(int $limit, int $offset = 0, array $options = [ + 'include' => 'manga.mappings' + ]): Request + { + $defaultOptions = [ + 'filter' => [ + 'user_id' => $this->getUserId(), + 'kind' => 'manga' + ], + 'page' => [ + 'offset' => $offset, + 'limit' => $limit + ], + 'sort' => '-updated_at' + ]; + $options = array_merge($defaultOptions, $options); + + return $this->jsonApiRequestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); + } + + /** + * Get the mal id for the manga represented by the kitsu id + * to enable updating MyAnimeList + * + * @param string $kitsuMangaId The id of the manga on Kitsu + * @return string|null Returns the mal id if it exists, otherwise null + */ + public function getMalIdForManga(string $kitsuMangaId): ?string + { + $options = [ + 'query' => [ + 'include' => 'mappings' + ] + ]; + $data = $this->jsonApiRequestBuilder->getRequest("manga/{$kitsuMangaId}", $options); + $mappings = array_column($data['included'], 'attributes'); + + foreach($mappings as $map) + { + if ($map['externalSite'] === 'myanimelist/manga') + { + return $map['externalId']; + } + } + + return NULL; + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/KitsuMutationTrait.php b/src/AnimeClient/API/Kitsu/KitsuMutationTrait.php new file mode 100644 index 00000000..d74b4d74 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/KitsuMutationTrait.php @@ -0,0 +1,81 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu; + +use Amp\Http\Client\Request; +use Aviat\AnimeClient\Types\FormItem; +use Aviat\Banker\Exception\InvalidArgumentException; + +/** + * Kitsu API calls that mutate data, C/U/D parts of CRUD + */ +trait KitsuMutationTrait { + // ------------------------------------------------------------------------- + // ! Generic API calls + // ------------------------------------------------------------------------- + + /** + * Create a list item + * + * @param array $data + * @return Request + * @throws InvalidArgumentException + */ + public function createListItem(array $data): ?Request + { + $data['user_id'] = $this->getUserId(); + if ($data['id'] === NULL) + { + return NULL; + } + + return $this->listItem->create($data); + } + + /** + * Increase the progress count for a list item + * + * @param FormItem $data + * @return Request + */ + public function incrementListItem(FormItem $data): Request + { + return $this->listItem->increment($data['id'], $data['data']); + } + + /** + * Modify a list item + * + * @param FormItem $data + * @return Request + */ + public function updateListItem(FormItem $data): Request + { + return $this->listItem->update($data['id'], $data['data']); + } + + /** + * Remove a list item + * + * @param string $id - The id of the list item to remove + * @return Request + */ + public function deleteListItem(string $id): Request + { + return $this->listItem->delete($id); + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php b/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php index 4e6b7c21..379af7ba 100644 --- a/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php +++ b/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php @@ -16,23 +16,12 @@ namespace Aviat\AnimeClient\API\Kitsu; -use const Aviat\AnimeClient\SESSION_SEGMENT; -use const Aviat\AnimeClient\USER_AGENT; - -use function Amp\Promise\wait; -use function Aviat\AnimeClient\getResponse; - -use Amp\Http\Client\Request; -use Amp\Http\Client\Response; -use Aviat\AnimeClient\API\APIRequestBuilder; -use Aviat\AnimeClient\API\FailedResponseException; -use Aviat\AnimeClient\API\Kitsu as K; -use Aviat\AnimeClient\Enum\EventType; use Aviat\Ion\Di\ContainerAware; use Aviat\Ion\Di\ContainerInterface; -use Aviat\Ion\Event; -use Aviat\Ion\Json; -use Aviat\Ion\JsonException; + +use const Aviat\AnimeClient\USER_AGENT; + +use Aviat\AnimeClient\API\APIRequestBuilder; final class KitsuRequestBuilder extends APIRequestBuilder { use ContainerAware; @@ -41,7 +30,13 @@ final class KitsuRequestBuilder extends APIRequestBuilder { * The base url for api requests * @var string $base_url */ - protected string $baseUrl = 'https://kitsu.io/api/edge/'; + protected string $baseUrl = 'https://kitsu.io/api/graphql'; + + /** + * Valid HTTP request methods + * @var array + */ + protected array $validMethods = ['POST']; /** * HTTP headers to send with every request @@ -49,223 +44,13 @@ final class KitsuRequestBuilder extends APIRequestBuilder { * @var array */ protected array $defaultHeaders = [ - 'User-Agent' => USER_AGENT, - 'Accept' => 'application/vnd.api+json', - 'Content-Type' => 'application/vnd.api+json', - 'CLIENT_ID' => 'dd031b32d2f56c990b1425efe6c42ad847e7fe3ab46bf1299f05ecd856bdb7dd', - 'CLIENT_SECRET' => '54d7307928f63414defd96399fc31ba847961ceaecef3a5fd93144e960c0e151', + 'User-Agent' => USER_AGENT, + 'Accept' => 'application/json', + 'Content-Type' => 'application/json', ]; public function __construct(ContainerInterface $container) { $this->setContainer($container); } - - /** - * Create a request object - * - * @param string $type - * @param string $url - * @param array $options - * @return Request - */ - public function setUpRequest(string $type, string $url, array $options = []): Request - { - $request = $this->newRequest($type, $url); - - $sessionSegment = $this->getContainer() - ->get('session') - ->getSegment(SESSION_SEGMENT); - - $cache = $this->getContainer()->get('cache'); - $token = null; - - if ($cache->has(K::AUTH_TOKEN_CACHE_KEY)) - { - $token = $cache->get(K::AUTH_TOKEN_CACHE_KEY); - } - else if ($url !== K::AUTH_URL && $sessionSegment->get('auth_token') !== NULL) - { - $token = $sessionSegment->get('auth_token'); - if ( ! (empty($token) || $cache->has(K::AUTH_TOKEN_CACHE_KEY))) - { - $cache->set(K::AUTH_TOKEN_CACHE_KEY, $token); - } - } - - if ($token !== NULL) - { - $request = $request->setAuth('bearer', $token); - } - - if (array_key_exists('form_params', $options)) - { - $request = $request->setFormFields($options['form_params']); - } - - if (array_key_exists('query', $options)) - { - $request = $request->setQuery($options['query']); - } - - if (array_key_exists('body', $options)) - { - $request = $request->setJsonBody($options['body']); - } - - if (array_key_exists('headers', $options)) - { - $request = $request->setHeaders($options['headers']); - } - - return $request->getFullRequest(); - } - - /** - * Remove some boilerplate for get requests - * - * @param mixed ...$args - * @throws Throwable - * @return array - */ - public function getRequest(...$args): array - { - return $this->request('GET', ...$args); - } - - /** - * Remove some boilerplate for patch requests - * - * @param mixed ...$args - * @throws Throwable - * @return array - */ - public function patchRequest(...$args): array - { - return $this->request('PATCH', ...$args); - } - - /** - * Remove some boilerplate for post requests - * - * @param mixed ...$args - * @throws Throwable - * @return array - */ - public function postRequest(...$args): array - { - $logger = NULL; - if ($this->getContainer()) - { - $logger = $this->container->getLogger('kitsu-request'); - } - - $response = $this->getResponse('POST', ...$args); - $validResponseCodes = [200, 201]; - - if ( ! in_array($response->getStatus(), $validResponseCodes, TRUE) && $logger) - { - $logger->warning('Non 2xx response for POST api call', $response->getBody()); - } - - return JSON::decode(wait($response->getBody()->buffer()), TRUE); - } - - /** - * Remove some boilerplate for delete requests - * - * @param mixed ...$args - * @throws Throwable - * @return bool - */ - public function deleteRequest(...$args): bool - { - $response = $this->getResponse('DELETE', ...$args); - return ($response->getStatus() === 204); - } - - /** - * Make a request - * - * @param string $type - * @param string $url - * @param array $options - * @return Response - * @throws Throwable - */ - public function getResponse(string $type, string $url, array $options = []): Response - { - $logger = NULL; - if ($this->getContainer()) - { - $logger = $this->container->getLogger('kitsu-request'); - } - - $request = $this->setUpRequest($type, $url, $options); - - $response = getResponse($request); - - if ($logger) - { - $logger->debug('Kitsu API Response', [ - 'response_status' => $response->getStatus(), - 'request_headers' => $response->getOriginalRequest()->getHeaders(), - 'response_headers' => $response->getHeaders() - ]); - } - - return $response; - } - - /** - * Make a request - * - * @param string $type - * @param string $url - * @param array $options - * @throws JsonException - * @throws FailedResponseException - * @throws Throwable - * @return array - */ - private function request(string $type, string $url, array $options = []): array - { - $logger = NULL; - if ($this->getContainer()) - { - $logger = $this->container->getLogger('kitsu-request'); - } - - $response = $this->getResponse($type, $url, $options); - $statusCode = $response->getStatus(); - - // Check for requests that are unauthorized - if ($statusCode === 401 || $statusCode === 403) - { - Event::emit(EventType::UNAUTHORIZED); - } - - // Any other type of failed request - if ($statusCode > 299 || $statusCode < 200) - { - if ($logger) - { - $logger->warning('Non 2xx response for api call', (array)$response); - } - - throw new FailedResponseException('Failed to get the proper response from the API'); - } - - try - { - return Json::decode(wait($response->getBody()->buffer())); - } - catch (JsonException $e) - { - print_r($e); - die(); - } - } - - } \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/KitsuTrait.php b/src/AnimeClient/API/Kitsu/KitsuTrait.php index c4d477af..694c3148 100644 --- a/src/AnimeClient/API/Kitsu/KitsuTrait.php +++ b/src/AnimeClient/API/Kitsu/KitsuTrait.php @@ -18,20 +18,38 @@ namespace Aviat\AnimeClient\API\Kitsu; trait KitsuTrait { /** - * The request builder for the Kitsu API + * The request builder for the Kitsu GraphQL API * @var KitsuRequestBuilder */ - protected KitsuRequestBuilder $requestBuilder; + protected ?KitsuRequestBuilder $requestBuilder = null; /** - * Set the request builder object + * The request builder for the Kitsu API + * @var KitsuJsonApiRequestBuilder + */ + protected KitsuJsonApiRequestBuilder $jsonApiRequestBuilder; + + /** + * Set the GraphQL request builder object * * @param KitsuRequestBuilder $requestBuilder - * @return self + * @return $this */ - public function setRequestBuilder($requestBuilder): self + public function setRequestBuilder(KitsuRequestBuilder $requestBuilder): self { $this->requestBuilder = $requestBuilder; return $this; } + + /** + * Set the request builder object + * + * @param KitsuJsonApiRequestBuilder $requestBuilder + * @return self + */ + public function setJsonApiRequestBuilder($requestBuilder): self + { + $this->jsonApiRequestBuilder = $requestBuilder; + return $this; + } } \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/ListItem.php b/src/AnimeClient/API/Kitsu/ListItem.php index 76fc7fef..2a0b38a3 100644 --- a/src/AnimeClient/API/Kitsu/ListItem.php +++ b/src/AnimeClient/API/Kitsu/ListItem.php @@ -75,7 +75,7 @@ final class ListItem extends AbstractListItem { $authHeader = $this->getAuthHeader(); - $request = $this->requestBuilder->newRequest('POST', 'library-entries'); + $request = $this->jsonApiRequestBuilder->newRequest('POST', 'library-entries'); if ($authHeader !== NULL) { @@ -94,7 +94,7 @@ final class ListItem extends AbstractListItem { public function delete(string $id): Request { $authHeader = $this->getAuthHeader(); - $request = $this->requestBuilder->newRequest('DELETE', "library-entries/{$id}"); + $request = $this->jsonApiRequestBuilder->newRequest('DELETE', "library-entries/{$id}"); if ($authHeader !== NULL) { @@ -113,7 +113,7 @@ final class ListItem extends AbstractListItem { { $authHeader = $this->getAuthHeader(); - $request = $this->requestBuilder->newRequest('GET', "library-entries/{$id}") + $request = $this->jsonApiRequestBuilder->newRequest('GET', "library-entries/{$id}") ->setQuery([ 'include' => 'media,media.categories,media.mappings' ]); @@ -155,7 +155,7 @@ final class ListItem extends AbstractListItem { $data->progress = 0; } - $request = $this->requestBuilder->newRequest('PATCH', "library-entries/{$id}") + $request = $this->jsonApiRequestBuilder->newRequest('PATCH', "library-entries/{$id}") ->setJsonBody($requestData); if ($authHeader !== NULL) diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 671a04d6..01c60fe6 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -25,30 +25,16 @@ use Aviat\AnimeClient\API\{ Kitsu as K, ParallelAPIRequest }; -use Aviat\AnimeClient\API\Enum\{ - AnimeWatchingStatus\Kitsu as KitsuWatchingStatus, - MangaReadingStatus\Kitsu as KitsuReadingStatus -}; -use Aviat\AnimeClient\API\Mapping\{AnimeWatchingStatus, MangaReadingStatus}; use Aviat\AnimeClient\API\Kitsu\Transformer\{ - AnimeHistoryTransformer, AnimeTransformer, AnimeListTransformer, - MangaHistoryTransformer, MangaTransformer, MangaListTransformer }; -use Aviat\AnimeClient\Enum\ListType; -use Aviat\AnimeClient\Types\{ - Anime, - FormItem, - MangaPage -}; use Aviat\Banker\Exception\InvalidArgumentException; use Aviat\Ion\{Di\ContainerAware, Json}; -use ReflectionException; use Throwable; /** @@ -58,37 +44,16 @@ final class Model { use CacheTrait; use ContainerAware; use KitsuTrait; + use KitsuAnimeTrait; + use KitsuMangaTrait; + use KitsuMutationTrait; - private const LIST_PAGE_SIZE = 100; - - /** - * Class to map anime list items - * to a common format used by - * templates - * - * @var AnimeListTransformer - */ - private AnimeListTransformer $animeListTransformer; - - /** - * @var AnimeTransformer - */ - private AnimeTransformer $animeTransformer; + protected const LIST_PAGE_SIZE = 100; /** * @var ListItem */ - private ListItem $listItem; - - /** - * @var MangaTransformer - */ - private MangaTransformer $mangaTransformer; - - /** - * @var MangaListTransformer - */ - private MangaListTransformer $mangaListTransformer; + protected ListItem $listItem; /** * Constructor @@ -116,7 +81,7 @@ final class Model { public function authenticate(string $username, string $password) { // K::AUTH_URL - $response = $this->requestBuilder->getResponse('POST', K::AUTH_URL, [ + $response = $this->jsonApiRequestBuilder->getResponse('POST', K::AUTH_URL, [ 'headers' => [ 'accept' => NULL, 'Content-type' => 'application/x-www-form-urlencoded', @@ -155,7 +120,7 @@ final class Model { */ public function reAuthenticate(string $token) { - $response = $this->requestBuilder->getResponse('POST', K::AUTH_URL, [ + $response = $this->jsonApiRequestBuilder->getResponse('POST', K::AUTH_URL, [ 'headers' => [ 'accept' => NULL, 'Content-type' => 'application/x-www-form-urlencoded', @@ -199,7 +164,7 @@ final class Model { } return $this->getCached(K::AUTH_USER_ID_KEY, function(string $username) { - $data = $this->requestBuilder->getRequest('users', [ + $data = $this->jsonApiRequestBuilder->getRequest('users', [ 'query' => [ 'filter' => [ 'name' => $username @@ -219,7 +184,7 @@ final class Model { */ public function getCharacter(string $slug): array { - return $this->requestBuilder->getRequest('characters', [ + return $this->jsonApiRequestBuilder->getRequest('characters', [ 'query' => [ 'filter' => [ 'slug' => $slug, @@ -242,7 +207,7 @@ final class Model { */ public function getPerson(string $id): array { - return $this->getCached("kitsu-person-{$id}", fn () => $this->requestBuilder->getRequest("people/{$id}", [ + return $this->getCached("kitsu-person-{$id}", fn () => $this->jsonApiRequestBuilder->getRequest("people/{$id}", [ 'query' => [ 'filter' => [ 'id' => $id, @@ -268,7 +233,7 @@ final class Model { */ public function getUserData(string $username): array { - return $this->requestBuilder->getRequest('users', [ + return $this->jsonApiRequestBuilder->getRequest('users', [ 'query' => [ 'filter' => [ 'name' => $username, @@ -305,7 +270,7 @@ final class Model { ] ]; - $raw = $this->requestBuilder->getRequest($type, $options); + $raw = $this->jsonApiRequestBuilder->getRequest($type, $options); $raw['included'] = JsonAPI::organizeIncluded($raw['included']); foreach ($raw['data'] as &$item) @@ -350,7 +315,7 @@ final class Model { ] ]; - $raw = $this->requestBuilder->getRequest('mappings', $options); + $raw = $this->jsonApiRequestBuilder->getRequest('mappings', $options); if ( ! array_key_exists('included', $raw)) { @@ -360,539 +325,6 @@ final class Model { return $raw['included'][0]['id']; } - // ------------------------------------------------------------------------- - // ! Anime-specific methods - // ------------------------------------------------------------------------- - - /** - * Get information about a particular anime - * - * @param string $slug - * @return Anime - */ - public function getAnime(string $slug): Anime - { - $baseData = $this->getRawMediaData('anime', $slug); - - if (empty($baseData)) - { - return Anime::from([]); - } - - return $this->animeTransformer->transform($baseData); - } - - /** - * Retrieve the data for the anime watch history page - * - * @return array - * @throws InvalidArgumentException - * @throws Throwable - */ - public function getAnimeHistory(): array - { - $key = K::ANIME_HISTORY_LIST_CACHE_KEY; - $list = $this->cache->get($key, NULL); - - if ($list === NULL) - { - $raw = $this->getRawHistoryList('anime'); - - $organized = JsonAPI::organizeData($raw); - $organized = array_filter($organized, fn ($item) => array_key_exists('relationships', $item)); - - $list = (new AnimeHistoryTransformer())->transform($organized); - - $this->cache->set($key, $list); - - } - - return $list; - } - - /** - * Get information about a particular anime - * - * @param string $animeId - * @return Anime - */ - public function getAnimeById(string $animeId): Anime - { - $baseData = $this->getRawMediaDataById('anime', $animeId); - return $this->animeTransformer->transform($baseData); - } - - /** - * Get the anime list for the configured user - * - * @param string $status - The watching status to filter the list with - * @return array - * @throws InvalidArgumentException - */ - public function getAnimeList(string $status): array - { - $key = "kitsu-anime-list-{$status}"; - - $list = $this->cache->get($key, NULL); - - if ($list === NULL) - { - $data = $this->getRawAnimeList($status) ?? []; - - // Bail out on no data - if (empty($data)) - { - return []; - } - - $included = JsonAPI::organizeIncludes($data['included']); - $included = JsonAPI::inlineIncludedRelationships($included, 'anime'); - - foreach($data['data'] as $i => &$item) - { - $item['included'] = $included; - } - unset($item); - $transformed = $this->animeListTransformer->transformCollection($data['data']); - $keyed = []; - - foreach($transformed as $item) - { - $keyed[$item['id']] = $item; - } - - $list = $keyed; - $this->cache->set($key, $list); - } - - return $list; - } - - /** - * Get the number of anime list items - * - * @param string $status - Optional status to filter by - * @return int - * @throws InvalidArgumentException - */ - public function getAnimeListCount(string $status = '') : int - { - return $this->getListCount(ListType::ANIME, $status); - } - - /** - * Get the full anime list - * - * @param array $options - * @return array - * @throws InvalidArgumentException - * @throws Throwable - */ - public function getFullRawAnimeList(array $options = [ - 'include' => 'anime.mappings' - ]): array - { - $status = $options['filter']['status'] ?? ''; - $count = $this->getAnimeListCount($status); - $size = static::LIST_PAGE_SIZE; - $pages = ceil($count / $size); - - $requester = new ParallelAPIRequest(); - - // Set up requests - for ($i = 0; $i < $pages; $i++) - { - $offset = $i * $size; - $requester->addRequest($this->getPagedAnimeList($size, $offset, $options)); - } - - $responses = $requester->makeRequests(); - $output = []; - - foreach($responses as $response) - { - $data = Json::decode($response); - $output[] = $data; - } - - return array_merge_recursive(...$output); - } - - /** - * Get all the anime entries, that are organized for output to html - * - * @return array - * @throws ReflectionException - * @throws InvalidArgumentException - */ - public function getFullOrganizedAnimeList(): array - { - $output = []; - - $statuses = KitsuWatchingStatus::getConstList(); - - foreach ($statuses as $key => $status) - { - $mappedStatus = AnimeWatchingStatus::KITSU_TO_TITLE[$status]; - $output[$mappedStatus] = $this->getAnimeList($status) ?? []; - } - - return $output; - } - - /** - * Get the mal id for the anime represented by the kitsu id - * to enable updating MyAnimeList - * - * @param string $kitsuAnimeId The id of the anime on Kitsu - * @return string|null Returns the mal id if it exists, otherwise null - */ - public function getMalIdForAnime(string $kitsuAnimeId): ?string - { - $options = [ - 'query' => [ - 'include' => 'mappings' - ] - ]; - $data = $this->requestBuilder->getRequest("anime/{$kitsuAnimeId}", $options); - - if ( ! array_key_exists('included', $data)) - { - return NULL; - } - - $mappings = array_column($data['included'], 'attributes'); - - foreach($mappings as $map) - { - if ($map['externalSite'] === 'myanimelist/anime') - { - return $map['externalId']; - } - } - - return NULL; - } - - /** - * Get the full anime list in paginated form - * - * @param int $limit - * @param int $offset - * @param array $options - * @return Request - * @throws InvalidArgumentException - */ - public function getPagedAnimeList(int $limit, int $offset = 0, array $options = [ - 'include' => 'anime.mappings' - ]): Request - { - $defaultOptions = [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => 'anime' - ], - 'page' => [ - 'offset' => $offset, - 'limit' => $limit - ], - 'sort' => '-updated_at' - ]; - $options = array_merge($defaultOptions, $options); - - return $this->requestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); - } - - /** - * Get the raw (unorganized) anime list for the configured user - * - * @param string $status - The watching status to filter the list with - * @return array - * @throws InvalidArgumentException - * @throws Throwable - */ - public function getRawAnimeList(string $status): array - { - $options = [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => 'anime', - 'status' => $status, - ], - 'include' => 'media,media.categories,media.mappings,anime.streamingLinks', - 'sort' => '-updated_at' - ]; - - return $this->getFullRawAnimeList($options); - } - - // ------------------------------------------------------------------------- - // ! Manga-specific methods - // ------------------------------------------------------------------------- - - /** - * Get information about a particular manga - * - * @param string $slug - * @return MangaPage - */ - public function getManga(string $slug): MangaPage - { - $baseData = $this->getRawMediaData('manga', $slug); - - if (empty($baseData)) - { - return MangaPage::from([]); - } - - return $this->mangaTransformer->transform($baseData); - } - - /** - * Retrieve the data for the manga read history page - * - * @return array - * @throws InvalidArgumentException - * @throws Throwable - */ - public function getMangaHistory(): array - { - $key = K::MANGA_HISTORY_LIST_CACHE_KEY; - $list = $this->cache->get($key, NULL); - - if ($list === NULL) - { - $raw = $this->getRawHistoryList('manga'); - $organized = JsonAPI::organizeData($raw); - $organized = array_filter($organized, fn ($item) => array_key_exists('relationships', $item)); - - $list = (new MangaHistoryTransformer())->transform($organized); - - $this->cache->set($key, $list); - } - - return $list; - } - - /** - * Get information about a particular manga - * - * @param string $mangaId - * @return MangaPage - */ - public function getMangaById(string $mangaId): MangaPage - { - $baseData = $this->getRawMediaDataById('manga', $mangaId); - return $this->mangaTransformer->transform($baseData); - } - - /** - * Get the manga list for the configured user - * - * @param string $status - The reading status by which to filter the list - * @param int $limit - The number of list items to fetch per page - * @param int $offset - The page offset - * @return array - * @throws InvalidArgumentException - */ - public function getMangaList(string $status, int $limit = 200, int $offset = 0): array - { - $options = [ - 'query' => [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => 'manga', - 'status' => $status, - ], - 'include' => 'media,media.categories,media.mappings', - 'page' => [ - 'offset' => $offset, - 'limit' => $limit - ], - 'sort' => '-updated_at' - ] - ]; - - $key = "kitsu-manga-list-{$status}"; - - $list = $this->cache->get($key, NULL); - - if ($list === NULL) - { - $data = $this->requestBuilder->getRequest('library-entries', $options) ?? []; - - // Bail out on no data - if (empty($data) || ( ! array_key_exists('included', $data))) - { - return []; - } - - $included = JsonAPI::organizeIncludes($data['included']); - $included = JsonAPI::inlineIncludedRelationships($included, 'manga'); - - foreach($data['data'] as $i => &$item) - { - $item['included'] = $included; - } - unset($item); - - $list = $this->mangaListTransformer->transformCollection($data['data']); - - $this->cache->set($key, $list); - } - - return $list; - } - - /** - * Get the number of manga list items - * - * @param string $status - Optional status to filter by - * @return int - * @throws InvalidArgumentException - */ - public function getMangaListCount(string $status = '') : int - { - return $this->getListCount(ListType::MANGA, $status); - } - - /** - * Get the full manga list - * - * @param array $options - * @return array - * @throws InvalidArgumentException - * @throws Throwable - */ - public function getFullRawMangaList(array $options = [ - 'include' => 'manga.mappings' - ]): array - { - $status = $options['filter']['status'] ?? ''; - $count = $this->getMangaListCount($status); - $size = static::LIST_PAGE_SIZE; - $pages = ceil($count / $size); - - $requester = new ParallelAPIRequest(); - - // Set up requests - for ($i = 0; $i < $pages; $i++) - { - $offset = $i * $size; - $requester->addRequest($this->getPagedMangaList($size, $offset, $options)); - } - - $responses = $requester->makeRequests(); - $output = []; - - foreach($responses as $response) - { - $data = Json::decode($response); - $output[] = $data; - } - - return array_merge_recursive(...$output); - } - - /** - * Get all Manga lists - * - * @return array - * @throws ReflectionException - * @throws InvalidArgumentException - */ - public function getFullOrganizedMangaList(): array - { - $statuses = KitsuReadingStatus::getConstList(); - $output = []; - foreach ($statuses as $status) - { - $mappedStatus = MangaReadingStatus::KITSU_TO_TITLE[$status]; - $output[$mappedStatus] = $this->getMangaList($status); - } - - return $output; - } - - /** - * Get the full manga list in paginated form - * - * @param int $limit - * @param int $offset - * @param array $options - * @return Request - * @throws InvalidArgumentException - */ - public function getPagedMangaList(int $limit, int $offset = 0, array $options = [ - 'include' => 'manga.mappings' - ]): Request - { - $defaultOptions = [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => 'manga' - ], - 'page' => [ - 'offset' => $offset, - 'limit' => $limit - ], - 'sort' => '-updated_at' - ]; - $options = array_merge($defaultOptions, $options); - - return $this->requestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); - } - - /** - * Get the mal id for the manga represented by the kitsu id - * to enable updating MyAnimeList - * - * @param string $kitsuMangaId The id of the manga on Kitsu - * @return string|null Returns the mal id if it exists, otherwise null - */ - public function getMalIdForManga(string $kitsuMangaId): ?string - { - $options = [ - 'query' => [ - 'include' => 'mappings' - ] - ]; - $data = $this->requestBuilder->getRequest("manga/{$kitsuMangaId}", $options); - $mappings = array_column($data['included'], 'attributes'); - - foreach($mappings as $map) - { - if ($map['externalSite'] === 'myanimelist/manga') - { - return $map['externalId']; - } - } - - return NULL; - } - - // ------------------------------------------------------------------------- - // ! Generic API calls - // ------------------------------------------------------------------------- - - /** - * Create a list item - * - * @param array $data - * @return Request - * @throws InvalidArgumentException - */ - public function createListItem(array $data): ?Request - { - $data['user_id'] = $this->getUserId(); - if ($data['id'] === NULL) - { - return NULL; - } - - return $this->listItem->create($data); - } - /** * Get the data for a specific list item, generally for editing * @@ -923,38 +355,13 @@ final class Model { } /** - * Increase the progress count for a list item + * Get the data to sync Kitsu anime/manga list with another API * - * @param FormItem $data - * @return Request + * @param string $type + * @return array + * @throws InvalidArgumentException + * @throws Throwable */ - public function incrementListItem(FormItem $data): Request - { - return $this->listItem->increment($data['id'], $data['data']); - } - - /** - * Modify a list item - * - * @param FormItem $data - * @return Request - */ - public function updateListItem(FormItem $data): Request - { - return $this->listItem->update($data['id'], $data['data']); - } - - /** - * Remove a list item - * - * @param string $id - The id of the list item to remove - * @return Request - */ - public function deleteListItem(string $id): Request - { - return $this->listItem->delete($id); - } - public function getSyncList(string $type): array { $options = [ @@ -1015,7 +422,7 @@ final class Model { */ protected function getRawHistoryPage(string $type, int $offset, int $limit = 20): Request { - return $this->requestBuilder->setUpRequest('GET', 'library-events', [ + return $this->jsonApiRequestBuilder->setUpRequest('GET', 'library-events', [ 'query' => [ 'filter' => [ 'kind' => 'progressed,updated', @@ -1077,7 +484,7 @@ final class Model { ] ]; - $data = $this->requestBuilder->getRequest("{$type}/{$id}", $options); + $data = $this->jsonApiRequestBuilder->getRequest("{$type}/{$id}", $options); if (empty($data['data'])) { @@ -1117,7 +524,7 @@ final class Model { ] ]; - $data = $this->requestBuilder->getRequest($type, $options); + $data = $this->jsonApiRequestBuilder->getRequest($type, $options); if (empty($data['data'])) { @@ -1150,7 +557,7 @@ final class Model { $options['query']['filter']['status'] = $status; } - $response = $this->requestBuilder->getRequest('library-entries', $options); + $response = $this->jsonApiRequestBuilder->getRequest('library-entries', $options); return $response['meta']['count']; } @@ -1216,6 +623,6 @@ final class Model { ]; $options = array_merge($defaultOptions, $options); - return $this->requestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); + return $this->jsonApiRequestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); } } \ No newline at end of file diff --git a/src/AnimeClient/Command/BaseCommand.php b/src/AnimeClient/Command/BaseCommand.php index 7f03656d..e05b8f25 100644 --- a/src/AnimeClient/Command/BaseCommand.php +++ b/src/AnimeClient/Command/BaseCommand.php @@ -23,7 +23,7 @@ use Aura\Router\RouterContainer; use Aura\Session\SessionFactory; use Aviat\AnimeClient\{Model, UrlGenerator, Util}; use Aviat\AnimeClient\API\{Anilist, CacheTrait, Kitsu}; -use Aviat\AnimeClient\API\Kitsu\KitsuRequestBuilder; +use Aviat\AnimeClient\API\Kitsu\KitsuJsonApiRequestBuilder; use Aviat\Banker\Teller; use Aviat\Ion\Config; use Aviat\Ion\Di\{Container, ContainerInterface, ContainerAware}; @@ -187,16 +187,20 @@ abstract class BaseCommand extends Command { // Models $container->set('kitsu-model', static function($container): Kitsu\Model { - $requestBuilder = new KitsuRequestBuilder($container); + $jsonApiRequestBuilder = new KitsuJsonApiRequestBuilder($container); + $jsonApiRequestBuilder->setLogger($container->getLogger('kitsu-request')); + + $requestBuilder = new Kitsu\KitsuRequestBuilder($container); $requestBuilder->setLogger($container->getLogger('kitsu-request')); $listItem = new Kitsu\ListItem(); $listItem->setContainer($container); - $listItem->setRequestBuilder($requestBuilder); + $listItem->setJsonApiRequestBuilder($jsonApiRequestBuilder); $model = new Kitsu\Model($listItem); $model->setContainer($container); - $model->setRequestBuilder($requestBuilder); + $model->setJsonApiRequestBuilder($jsonApiRequestBuilder) + ->setRequestBuilder($requestBuilder); $cache = $container->get('cache'); $model->setCache($cache); From bb878d905f70974e42d7c866e77915ac353a9285 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 28 Jul 2020 17:46:18 -0400 Subject: [PATCH 02/86] Use GraphQL request for anime detail pages, see #27 --- src/AnimeClient/API/Kitsu.php | 30 +++ .../GraphQL/Queries/AnimeDetails.graphql | 21 +- src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php | 5 +- .../API/Kitsu/KitsuRequestBuilder.php | 227 ++++++++++++++++++ .../Kitsu/Transformer/AnimeTransformer.php | 39 +++ .../Transformer/AnimeTransformerTest.php | 2 + 6 files changed, 321 insertions(+), 3 deletions(-) diff --git a/src/AnimeClient/API/Kitsu.php b/src/AnimeClient/API/Kitsu.php index 3716d62e..83c1b3de 100644 --- a/src/AnimeClient/API/Kitsu.php +++ b/src/AnimeClient/API/Kitsu.php @@ -172,6 +172,36 @@ final class Kitsu { return $valid; } + /** + * Filter out duplicate and very similar titles from a GraphQL response + * + * @param array $titles + * @return array + */ + public static function filterLocalizedTitles(array $titles): array + { + // The 'canonical' title is always considered + $valid = [$titles['canonical']]; + + foreach (['alternatives', 'localized'] as $search) + { + if (array_key_exists($search, $titles) && is_array($titles[$search])) + { + foreach($titles[$search] as $alternateTitle) + { + if (self::titleIsUnique($alternateTitle, $valid)) + { + $valid[] = $alternateTitle; + } + } + } + } + + // Don't return the canonical titles + array_shift($valid); + + return $valid; + } /** * Get the name and logo for the streaming service of the current link diff --git a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql index 889800b5..09f66264 100644 --- a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql +++ b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql @@ -1,8 +1,9 @@ -query ($slug: String) { +query ($slug: String!) { findAnimeBySlug(slug: $slug) { + id ageRating ageRatingGuide - bannerImage { + posterImage { original { height name @@ -16,13 +17,27 @@ query ($slug: String) { width } } + categories { + nodes { + title + } + } characters { nodes { character { + id names { canonical alternatives } + image { + original { + height + name + url + width + } + } slug } role @@ -52,6 +67,7 @@ query ($slug: String) { startCursor } } + startDate endDate episodeCount episodeLength @@ -114,5 +130,6 @@ query ($slug: String) { localized } totalLength + youtubeTrailerVideoId } } diff --git a/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php b/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php index 43192448..75901ec3 100644 --- a/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/KitsuAnimeTrait.php @@ -60,7 +60,10 @@ trait KitsuAnimeTrait { */ public function getAnime(string $slug): Anime { - $baseData = $this->getRawMediaData('anime', $slug); + $baseData = $this->requestBuilder->runQuery('AnimeDetails', [ + 'slug' => $slug + ]); + // $baseData = $this->getRawMediaData('anime', $slug); if (empty($baseData)) { diff --git a/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php b/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php index 379af7ba..dbe99896 100644 --- a/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php +++ b/src/AnimeClient/API/Kitsu/KitsuRequestBuilder.php @@ -16,9 +16,15 @@ namespace Aviat\AnimeClient\API\Kitsu; +use Amp\Http\Client\Request; +use Amp\Http\Client\Response; +use Aviat\AnimeClient\API\Anilist; use Aviat\Ion\Di\ContainerAware; use Aviat\Ion\Di\ContainerInterface; +use Aviat\Ion\Json; +use function Amp\Promise\wait; +use function Aviat\AnimeClient\getResponse; use const Aviat\AnimeClient\USER_AGENT; use Aviat\AnimeClient\API\APIRequestBuilder; @@ -53,4 +59,225 @@ final class KitsuRequestBuilder extends APIRequestBuilder { { $this->setContainer($container); } + + /** + * Create a request object + * @param string $url + * @param array $options + * @return Request + * @throws Throwable + */ + public function setUpRequest(string $url, array $options = []): Request + { + /* $config = $this->getContainer()->get('config'); + $anilistConfig = $config->get('anilist'); */ + + $request = $this->newRequest('POST', $url); + + // You can only authenticate the request if you + // actually have an access_token saved + /* if ($config->has(['anilist', 'access_token'])) + { + $request = $request->setAuth('bearer', $anilistConfig['access_token']); + } */ + + if (array_key_exists('form_params', $options)) + { + $request = $request->setFormFields($options['form_params']); + } + + if (array_key_exists('query', $options)) + { + $request = $request->setQuery($options['query']); + } + + if (array_key_exists('body', $options)) + { + $request = $request->setJsonBody($options['body']); + } + + if (array_key_exists('headers', $options)) + { + $request = $request->setHeaders($options['headers']); + } + + return $request->getFullRequest(); + } + + /** + * Run a GraphQL API query + * + * @param string $name + * @param array $variables + * @return array + */ + public function runQuery(string $name, array $variables = []): array + { + $file = realpath(__DIR__ . "/GraphQL/Queries/{$name}.graphql"); + if ( ! file_exists($file)) + { + throw new LogicException('GraphQL query file does not exist.'); + } + + // $query = str_replace(["\t", "\n"], ' ', file_get_contents($file)); + $query = file_get_contents($file); + $body = [ + 'query' => $query + ]; + + if ( ! empty($variables)) + { + $body['variables'] = []; + foreach($variables as $key => $val) + { + $body['variables'][$key] = $val; + } + } + + return $this->postRequest([ + 'body' => $body + ]); + } + + /** + * @param string $name + * @param array $variables + * @return Request + * @throws Throwable + */ + public function mutateRequest (string $name, array $variables = []): Request + { + $file = realpath(__DIR__ . "/GraphQL/Mutations/{$name}.graphql"); + if (!file_exists($file)) + { + throw new LogicException('GraphQL mutation file does not exist.'); + } + + // $query = str_replace(["\t", "\n"], ' ', file_get_contents($file)); + $query = file_get_contents($file); + + $body = [ + 'query' => $query + ]; + + if (!empty($variables)) { + $body['variables'] = []; + foreach ($variables as $key => $val) + { + $body['variables'][$key] = $val; + } + } + + return $this->setUpRequest(Anilist::BASE_URL, [ + 'body' => $body, + ]); + } + + /** + * @param string $name + * @param array $variables + * @return array + * @throws Throwable + */ + public function mutate (string $name, array $variables = []): array + { + $request = $this->mutateRequest($name, $variables); + $response = $this->getResponseFromRequest($request); + + return Json::decode(wait($response->getBody()->buffer())); + } + + /** + * Make a request + * + * @param string $url + * @param array $options + * @return Response + * @throws Throwable + */ + private function getResponse(string $url, array $options = []): Response + { + $logger = NULL; + if ($this->getContainer()) + { + $logger = $this->container->getLogger('anilist-request'); + } + + $request = $this->setUpRequest($url, $options); + $response = getResponse($request); + + $logger->debug('Anilist response', [ + 'status' => $response->getStatus(), + 'reason' => $response->getReason(), + 'body' => $response->getBody(), + 'headers' => $response->getHeaders(), + 'requestHeaders' => $request->getHeaders(), + ]); + + return $response; + } + + /** + * @param Request $request + * @return Response + * @throws Throwable + */ + private function getResponseFromRequest(Request $request): Response + { + $logger = NULL; + if ($this->getContainer()) + { + $logger = $this->container->getLogger('anilist-request'); + } + + $response = getResponse($request); + + $logger->debug('Anilist response', [ + 'status' => $response->getStatus(), + 'reason' => $response->getReason(), + 'body' => $response->getBody(), + 'headers' => $response->getHeaders(), + 'requestHeaders' => $request->getHeaders(), + ]); + + return $response; + } + + /** + * Remove some boilerplate for post requests + * + * @param array $options + * @return array + * @throws Throwable + */ + protected function postRequest(array $options = []): array + { + $response = $this->getResponse($this->baseUrl, $options); + $validResponseCodes = [200, 201]; + + $logger = NULL; + if ($this->getContainer()) + { + $logger = $this->container->getLogger('kitsu-request'); + $logger->debug('Kitsu response', [ + 'status' => $response->getStatus(), + 'reason' => $response->getReason(), + 'body' => $response->getBody(), + 'headers' => $response->getHeaders(), + //'requestHeaders' => $request->getHeaders(), + ]); + } + + if ( ! \in_array($response->getStatus(), $validResponseCodes, TRUE)) + { + if ($logger !== NULL) + { + $logger->warning('Non 200 response for POST api call', (array)$response->getBody()); + } + } + + // dump(wait($response->getBody()->buffer())); + + return Json::decode(wait($response->getBody()->buffer())); + } } \ 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 838f6549..df3d6ace 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -35,6 +35,45 @@ final class AnimeTransformer extends AbstractTransformer { */ public function transform($item): AnimePage { + $base = $item['data']['findAnimeBySlug']; + + $characters = []; + $staff = []; + $genres = array_map(fn ($genre) => $genre['title']['en'], $base['categories']['nodes']); + + sort($genres); + + $title = $base['titles']['canonical']; + $titles = Kitsu::filterLocalizedTitles($base['titles']); + + $data = [ + 'age_rating' => $base['ageRating'], + 'age_rating_guide' => $base['ageRatingGuide'], + 'characters' => $characters, + 'cover_image' => $base['posterImage']['views'][1]['url'], + 'episode_count' => $base['episodeCount'], + 'episode_length' => (int)($base['episodeLength'] / 60), + 'genres' => $genres, + 'id' => $base['id'], + // 'show_type' => (string)StringType::from($item['showType'])->upperCaseFirst(), + 'slug' => $base['slug'], + 'staff' => $staff, + 'status' => Kitsu::getAiringStatus($base['startDate'], $base['endDate']), + 'streaming_links' => [], // Kitsu::parseStreamingLinks($item['included']), + 'synopsis' => $base['synopsis']['en'], + 'title' => $title, + 'titles' => [], + 'titles_more' => $titles, + 'trailer_id' => $base['youtubeTrailerVideoId'], + 'url' => "https://kitsu.io/anime/{$base['slug']}", + ]; + + // dump($data); die(); + + return AnimePage::from($data); + } + + private function oldTransform($item): AnimePage { $item['included'] = JsonAPI::organizeIncludes($item['included']); $genres = $item['included']['categories'] ?? []; $item['genres'] = array_column($genres, 'title') ?? []; diff --git a/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php index 9c58d746..82296c6e 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php @@ -38,6 +38,8 @@ class AnimeTransformerTest extends AnimeClientTestCase { public function testTransform() { + $this->markTestSkipped('Skip until fixed with GraphQL snapshot'); + $actual = $this->transformer->transform($this->beforeTransform); $this->assertMatchesSnapshot($actual); } From 0ed7a0de2ea36d82cb3d15a5111ae0ec29e806a4 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 29 Jul 2020 11:00:06 -0400 Subject: [PATCH 03/86] Run local phpunit from robo --- RoboFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index bb2958ef..59003dfb 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -227,7 +227,7 @@ class RoboFile extends Tasks { { $this->lint(); - $this->_run(['phpunit']); + $this->_run(['vendor/bin/phpunit']); } /** From 50f3c394c55ca5627b5c677eeb8fcc26e66e65ba Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 29 Jul 2020 11:00:54 -0400 Subject: [PATCH 04/86] Re-add characters to anime details page, see #27 --- app/views/anime/details.php | 6 +++--- .../GraphQL/Queries/AnimeDetails.graphql | 18 ----------------- .../Kitsu/Transformer/AnimeTransformer.php | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/views/anime/details.php b/app/views/anime/details.php index 9e72b539..98bcf8d1 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -11,10 +11,10 @@ Airing Status - + Show Type - + */ ?> Episode Count @@ -130,7 +130,7 @@
generate('character', ['slug' => $char['slug']]) ?>
- a($link, $char['name']); ?> + a($link, $char['name']) ?>
picture("images/characters/{$id}.webp") ?> diff --git a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql index 09f66264..f41066c9 100644 --- a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql +++ b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql @@ -41,24 +41,6 @@ query ($slug: String!) { slug } role - voices { - nodes { - id - licensor { - id - name - } - locale - person { - id - names { - alternatives - canonical - localized - } - } - } - } } pageInfo { endCursor diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php index df3d6ace..4afe576e 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -46,6 +46,26 @@ final class AnimeTransformer extends AbstractTransformer { $title = $base['titles']['canonical']; $titles = Kitsu::filterLocalizedTitles($base['titles']); + if (count($base['characters']['nodes']) > 0) + { + $characters['main'] = []; + $characters['supporting'] = []; + + foreach ($base['characters']['nodes'] as $rawCharacter) + { + $type = $rawCharacter['role'] === 'MAIN' ? 'main' : 'supporting'; + $details = $rawCharacter['character']; + $characters[$type][$details['id']] = [ + 'image' => $details['image'], + 'name' => $details['names']['canonical'], + 'slug' => $details['slug'], + ]; + } + + uasort($characters['main'], fn($a, $b) => $a['name'] <=> $b['name']); + uasort($characters['supporting'], fn($a, $b) => $a['name'] <=> $b['name']); + } + $data = [ 'age_rating' => $base['ageRating'], 'age_rating_guide' => $base['ageRatingGuide'], From dcd138cba68dd38aa0689ffbae66651d170b4b9b Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 29 Jul 2020 14:04:03 -0400 Subject: [PATCH 05/86] get anime staff from GraphQL, see #27 --- .../GraphQL/Queries/AnimeDetails.graphql | 2 +- .../Kitsu/Transformer/AnimeTransformer.php | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql index f41066c9..a61c3c0f 100644 --- a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql +++ b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql @@ -53,6 +53,7 @@ query ($slug: String!) { endDate episodeCount episodeLength + totalLength posterImage { original { height @@ -107,7 +108,6 @@ query ($slug: String!) { status synopsis titles { - alternatives canonical localized } diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php index 4afe576e..33ac6271 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -66,6 +66,33 @@ final class AnimeTransformer extends AbstractTransformer { uasort($characters['supporting'], fn($a, $b) => $a['name'] <=> $b['name']); } + if (count($base['staff']['nodes']) > 0) + { + foreach ($base['staff']['nodes'] as $staffing) + { + $person = $staffing['person']; + $role = $staffing['role']; + $name = $person['names']['localized'][$person['names']['canonical']]; + + if ( ! array_key_exists($role, $staff)) + { + $staff[$role] = []; + } + + $staff[$role][$person['id']] = [ + 'id' => $person['id'], + 'name' => $name, + 'image' => [ + 'original' => $person['image']['original']['url'], + ], + ]; + + usort($staff[$role], fn ($a, $b) => $a['name'] <=> $b['name']); + } + + ksort($staff); + } + $data = [ 'age_rating' => $base['ageRating'], 'age_rating_guide' => $base['ageRatingGuide'], From 375b8f9bcb55db033bb575793216e0aefc1eb947 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 29 Jul 2020 15:49:16 -0400 Subject: [PATCH 06/86] Anime detail page cleanup --- app/views/anime/details.php | 35 ++++-- src/AnimeClient/API/Kitsu.php | 63 +++++++++++ .../Kitsu/Transformer/AnimeTransformer.php | 107 +----------------- src/AnimeClient/Types/Anime.php | 9 ++ 4 files changed, 99 insertions(+), 115 deletions(-) diff --git a/app/views/anime/details.php b/app/views/anime/details.php index 98bcf8d1..c019ad78 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -1,4 +1,7 @@ - +
diff --git a/app/views/header.php b/app/views/header.php index 25828f09..16fc6d55 100644 --- a/app/views/header.php +++ b/app/views/header.php @@ -26,7 +26,7 @@ -
+
-
\ No newline at end of file diff --git a/console b/console index a0999077..e499c9b1 100755 --- a/console +++ b/console @@ -9,6 +9,9 @@ use ConsoleKit\Console; $_SERVER['HTTP_HOST'] = 'localhost'; +define('APP_DIR', __DIR__ . '/app'); +define('TEMPLATE_DIR', APP_DIR . '/templates'); + // ----------------------------------------------------------------------------- // Start console script // ----------------------------------------------------------------------------- diff --git a/frontEndSrc/css/src/general.css b/frontEndSrc/css/src/general.css index 587e0582..29efb1f5 100644 --- a/frontEndSrc/css/src/general.css +++ b/frontEndSrc/css/src/general.css @@ -94,6 +94,7 @@ a:hover, a:active { iframe { display: block; margin: 0 auto; + border: 0; } /* ----------------------------------------------------------------------------- diff --git a/src/AnimeClient/Component/Character.php b/src/AnimeClient/Component/Character.php new file mode 100644 index 00000000..df64471b --- /dev/null +++ b/src/AnimeClient/Component/Character.php @@ -0,0 +1,31 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +final class Character { + use ComponentTrait; + + public function __invoke(string $name, string $link, string $picture, string $className = 'character'): string + { + return $this->render('character.php', [ + 'name' => $name, + 'link' => $link, + 'picture' => $picture, + 'className' => $className, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/Component/ComponentTrait.php b/src/AnimeClient/Component/ComponentTrait.php new file mode 100644 index 00000000..d4f909ae --- /dev/null +++ b/src/AnimeClient/Component/ComponentTrait.php @@ -0,0 +1,30 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +/** + * Shared logic for component-based functionality, like Tabs + */ +trait ComponentTrait { + public function render(string $path, array $data): string + { + ob_start(); + extract($data, EXTR_OVERWRITE); + include \TEMPLATE_DIR . '/' .$path; + return ob_get_clean(); + } +} \ No newline at end of file diff --git a/src/AnimeClient/Component/Media.php b/src/AnimeClient/Component/Media.php new file mode 100644 index 00000000..5da84759 --- /dev/null +++ b/src/AnimeClient/Component/Media.php @@ -0,0 +1,31 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +final class Media { + use ComponentTrait; + + public function __invoke(array $titles, string $link, string $picture, string $className = 'media'): string + { + return $this->render('media.php', [ + 'titles' => $titles, + 'link' => $link, + 'picture' => $picture, + 'className' => $className, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/Component/Tabs.php b/src/AnimeClient/Component/Tabs.php new file mode 100644 index 00000000..91c9d572 --- /dev/null +++ b/src/AnimeClient/Component/Tabs.php @@ -0,0 +1,45 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +final class Tabs { + use ComponentTrait; + + /** + * Creates a tabbed content view + * + * @param string $name the name attribute for the input[type-option] form elements + * also used to generate id attributes + * @param array $tabData The data used to create the tab content, indexed by the tab label + * @param callable $cb The function to generate the tab content + * @return string + */ + public function __invoke( + string $name, + array $tabData, + callable $cb, + string $className = 'content media-wrap flex flex-wrap flex-justify-start' + ): string + { + return $this->render('tabs.php', [ + 'name' => $name, + 'data' => $tabData, + 'callback' => $cb, + 'className' => $className, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/Component/VerticalTabs.php b/src/AnimeClient/Component/VerticalTabs.php new file mode 100644 index 00000000..de05abf8 --- /dev/null +++ b/src/AnimeClient/Component/VerticalTabs.php @@ -0,0 +1,45 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +final class VerticalTabs { + use ComponentTrait; + + /** + * Creates a vertical tab content view + * + * @param string $name the name attribute for the input[type-option] form elements + * also used to generate id attributes + * @param array $tabData The data used to create the tab content, indexed by the tab label + * @param callable $cb The function to generate the tab content + * @return string + */ + public function __invoke( + string $name, + array $tabData, + callable $cb, + string $className='content media-wrap flex flex-wrap flex-justify-start' + ): string + { + return $this->render('vertical-tabs.php', [ + 'name' => $name, + 'data' => $tabData, + 'callback' => $cb, + 'className' => $className, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/FormGenerator.php b/src/AnimeClient/FormGenerator.php index 52873e24..94bbc28e 100644 --- a/src/AnimeClient/FormGenerator.php +++ b/src/AnimeClient/FormGenerator.php @@ -39,11 +39,30 @@ final class FormGenerator { * @throws ContainerException * @throws NotFoundException */ - public function __construct(ContainerInterface $container) + private function __construct(ContainerInterface $container) { $this->helper = $container->get('html-helper'); } + /** + * Create a new FormGenerator + * + * @param ContainerInterface $container + * @return $this + */ + public static function new(ContainerInterface $container): self + { + try + { + return new static($container); + } + catch (\Throwable $e) + { + dump($e); + die(); + } + } + /** * Generate the html structure of the form * diff --git a/src/AnimeClient/Helper/Form.php b/src/AnimeClient/Helper/Form.php index 7438a7f6..b1a60f93 100644 --- a/src/AnimeClient/Helper/Form.php +++ b/src/AnimeClient/Helper/Form.php @@ -35,6 +35,6 @@ final class Form { */ public function __invoke(string $name, array $form) { - return (new FormGenerator($this->container))->generate($name, $form); + return FormGenerator::new($this->container)->generate($name, $form); } } diff --git a/src/AnimeClient/Helper/Menu.php b/src/AnimeClient/Helper/Menu.php index 979892af..ad3fa263 100644 --- a/src/AnimeClient/Helper/Menu.php +++ b/src/AnimeClient/Helper/Menu.php @@ -34,8 +34,7 @@ final class Menu { */ public function __invoke($menuName) { - $generator = new MenuGenerator($this->container); - return $generator->generate($menuName); + return MenuGenerator::new($this->container)->generate($menuName); } } diff --git a/src/AnimeClient/MenuGenerator.php b/src/AnimeClient/MenuGenerator.php index 87d8c411..65e5a98c 100644 --- a/src/AnimeClient/MenuGenerator.php +++ b/src/AnimeClient/MenuGenerator.php @@ -44,40 +44,20 @@ final class MenuGenerator extends UrlGenerator { protected RequestInterface $request; /** - * MenuGenerator constructor. - * * @param ContainerInterface $container - * @throws ContainerException - * @throws NotFoundException + * @return static */ - public function __construct(ContainerInterface $container) + public static function new(ContainerInterface $container): self { - parent::__construct($container); - $this->helper = $container->get('html-helper'); - $this->request = $container->get('request'); - } - - /** - * Generate the full menu structure from the config files - * - * @param array $menus - * @return array - */ - protected function parseConfig(array $menus) : array - { - $parsed = []; - - foreach ($menus as $name => $menu) + try { - $parsed[$name] = []; - foreach ($menu['items'] as $pathName => $partialPath) - { - $title = (string)StringType::from($pathName)->humanize()->titleize(); - $parsed[$name][$title] = (string)StringType::from($menu['route_prefix'])->append($partialPath); - } + return new static($container); + } + catch (\Throwable $e) + { + dump($e); + die(); } - - return $parsed; } /** @@ -120,5 +100,42 @@ final class MenuGenerator extends UrlGenerator { // Create the menu html return (string) $this->helper->ul(); } + + /** + * MenuGenerator constructor. + * + * @param ContainerInterface $container + * @throws ContainerException + * @throws NotFoundException + */ + private function __construct(ContainerInterface $container) + { + parent::__construct($container); + $this->helper = $container->get('html-helper'); + $this->request = $container->get('request'); + } + + /** + * Generate the full menu structure from the config files + * + * @param array $menus + * @return array + */ + private function parseConfig(array $menus) : array + { + $parsed = []; + + foreach ($menus as $name => $menu) + { + $parsed[$name] = []; + foreach ($menu['items'] as $pathName => $partialPath) + { + $title = (string)StringType::from($pathName)->humanize()->titleize(); + $parsed[$name][$title] = (string)StringType::from($menu['route_prefix'])->append($partialPath); + } + } + + return $parsed; + } } // End of MenuGenerator.php \ No newline at end of file diff --git a/src/Ion/View/HtmlView.php b/src/Ion/View/HtmlView.php index f7fcca05..e208ff45 100644 --- a/src/Ion/View/HtmlView.php +++ b/src/Ion/View/HtmlView.php @@ -16,7 +16,6 @@ namespace Aviat\Ion\View; -use Aura\Html\HelperLocator; use Aviat\Ion\Di\ContainerAware; use Aviat\Ion\Di\ContainerInterface; use Aviat\Ion\Di\Exception\ContainerException; @@ -30,13 +29,6 @@ use const EXTR_OVERWRITE; class HtmlView extends HttpView { use ContainerAware; - /** - * HTML generator/escaper helper - * - * @var HelperLocator - */ - protected HelperLocator $helper; - /** * Response mime type * @@ -56,7 +48,6 @@ class HtmlView extends HttpView { parent::__construct(); $this->setContainer($container); - $this->helper = $container->get('html-helper'); $this->response = new HtmlResponse(''); } @@ -69,8 +60,10 @@ class HtmlView extends HttpView { */ public function renderTemplate(string $path, array $data): string { - $data['helper'] = $this->helper; - $data['escape'] = $this->helper->escape(); + $helper = $this->container->get('html-helper'); + $data['component'] = $this->container->get('component-helper'); + $data['helper'] = $helper; + $data['escape'] = $helper->escape(); $data['container'] = $this->container; ob_start(); From 41ca3a2d86e4810bdb724a72538ac2b58c04960f Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 21 Aug 2020 13:07:00 -0400 Subject: [PATCH 40/86] Fix tests --- app/bootstrap.php | 7 +++++-- tests/AnimeClient/FormGeneratorTest.php | 4 ++-- tests/AnimeClient/MenuGeneratorTest.php | 4 ++-- tests/Ion/di.php | 5 ++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index f12127c2..627fb5c7 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -32,8 +32,11 @@ use Monolog\Handler\RotatingFileHandler; use Monolog\Logger; use Psr\SimpleCache\CacheInterface; -define('APP_DIR', __DIR__); -define('TEMPLATE_DIR', APP_DIR . '/templates'); +if ( ! defined('APP_DIR')) +{ + define('APP_DIR', __DIR__); + define('TEMPLATE_DIR', APP_DIR . '/templates'); +} // ----------------------------------------------------------------------------- // Setup DI container diff --git a/tests/AnimeClient/FormGeneratorTest.php b/tests/AnimeClient/FormGeneratorTest.php index 89f22220..fae6980e 100644 --- a/tests/AnimeClient/FormGeneratorTest.php +++ b/tests/AnimeClient/FormGeneratorTest.php @@ -252,12 +252,12 @@ class FormGeneratorTest extends AnimeClientTestCase { { parent::setUp(); - $this->generator = new FormGenerator($this->container); + $this->generator = FormGenerator::new($this->container); } public function testSanity(): void { - $generator = new FormGenerator($this->container); + $generator = FormGenerator::new($this->container); $this->assertInstanceOf(FormGenerator::class, $generator); } diff --git a/tests/AnimeClient/MenuGeneratorTest.php b/tests/AnimeClient/MenuGeneratorTest.php index 5b8f5d5e..254fff50 100644 --- a/tests/AnimeClient/MenuGeneratorTest.php +++ b/tests/AnimeClient/MenuGeneratorTest.php @@ -26,12 +26,12 @@ class MenuGeneratorTest extends AnimeClientTestCase { public function setUp(): void { parent::setUp(); - $this->generator = new MenuGenerator($this->container); + $this->generator = MenuGenerator::new($this->container); } public function testSanity() { - $generator = new MenuGenerator($this->container); + $generator = MenuGenerator::new($this->container); $this->assertInstanceOf(MenuGenerator::class, $generator); } diff --git a/tests/Ion/di.php b/tests/Ion/di.php index 13caf6f0..cf1ecba5 100644 --- a/tests/Ion/di.php +++ b/tests/Ion/di.php @@ -40,9 +40,8 @@ return static function(array $config_array = []) { }); // Create Html helper Object - $container->set('html-helper', static function() { - return (new HelperLocatorFactory)->newInstance(); - }); + $container->set('html-helper', fn() => (new HelperLocatorFactory)->newInstance()); + $container->set('component-helper', fn() => (new HelperLocatorFactory)->newInstance()); return $container; }; \ No newline at end of file From a6926171019051c3628c75f7bbd4aee8da3039b4 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 21 Aug 2020 19:25:27 -0400 Subject: [PATCH 41/86] Use components instead of duplicating html everywhere --- app/views/character/details.php | 65 +++------------ app/views/manga/details.php | 75 ++++++----------- app/views/person/character-mapping.php | 67 ---------------- app/views/person/details.php | 79 ++++++++++++------ app/views/settings/settings.php | 12 +-- app/views/user/details.php | 107 ++++++++----------------- 6 files changed, 132 insertions(+), 273 deletions(-) delete mode 100644 app/views/person/character-mapping.php diff --git a/app/views/character/details.php b/app/views/character/details.php index 8e513f61..b047b6cb 100644 --- a/app/views/character/details.php +++ b/app/views/character/details.php @@ -33,61 +33,20 @@ use Aviat\AnimeClient\API\Kitsu;

Media

-
- - - -
- $anime): ?> - - -
- + tabs('character-media', $data['media'], static function ($media, $mediaType) use ($url, $component, $helper) { + $rendered = []; + foreach ($media as $id => $item) + { + $rendered[] = $component->media( + array_merge([$item['title']], $item['titles']), + $url->generate("{$mediaType}.details", ['id' => $item['slug']]), + $helper->picture("images/{$mediaType}/{$item['id']}.webp") + ); + } - - - - -
- $manga): ?> - - -
- -
+ return implode('', array_map('mb_trim', $rendered)); + }, 'media-wrap content') ?>
diff --git a/app/views/manga/details.php b/app/views/manga/details.php index 3fb449c7..6b21901a 100644 --- a/app/views/manga/details.php +++ b/app/views/manga/details.php @@ -60,61 +60,34 @@ 0): ?>

Characters

-
- - $list): ?> - /> - -
- $char): ?> - - - - -
- - -
+ tabs('manga-characters', $data['characters'], static function($list, $role) use ($component, $helper, $url) { + $rendered = []; + foreach ($list as $id => $char) + { + $rendered[] = $component->character( + $char['name'], + $url->generate('character', ['slug' => $char['slug']]), + $helper->picture("images/characters/{$id}.webp"), + ($role !== 'main') ? 'small-character' : 'character' + ); + } + + return implode('', array_map('mb_trim', $rendered)); + }) ?> 0): ?>

Staff

-
- - $people): ?> -
- /> - -
- - - -
-
- - -
+ verticalTabs('manga-staff', $data['staff'], + fn($people) => implode('', array_map( + fn ($person) => $component->character( + $person['name'], + $url->generate('person', ['id' => $person['id'], 'slug' => $person['slug']]), + $helper->picture("images/people/{$person['id']}.webp") + ), + $people + )) + ) ?>
\ No newline at end of file diff --git a/app/views/person/character-mapping.php b/app/views/person/character-mapping.php deleted file mode 100644 index 077d0c2b..00000000 --- a/app/views/person/character-mapping.php +++ /dev/null @@ -1,67 +0,0 @@ - -

Voice Acting Roles

-
- - $characterList): ?> - type="radio" name="character-type-tabs" id="character-type-" /> - -
- - - - - - $character): ?> - - - - - -
CharacterSeries
- - -
- $series): ?> - - -
-
-
- - -
diff --git a/app/views/person/details.php b/app/views/person/details.php index 98c6282d..1356d23d 100644 --- a/app/views/person/details.php +++ b/app/views/person/details.php @@ -1,7 +1,6 @@
@@ -16,6 +15,7 @@ use Aviat\AnimeClient\API\Kitsu;

Castings

+
$entries): ?> @@ -25,30 +25,17 @@ use Aviat\AnimeClient\API\Kitsu; $casting): ?> - +

-
+
$series): ?> - + + media( + Kitsu::filterTitles($series), + $url->generate("{$mediaType}.details", ['id' => $series['slug']]), + $helper->picture("images/{$type}/{$sid}.webp") + ) ?>
@@ -61,7 +48,51 @@ use Aviat\AnimeClient\API\Kitsu;
- +

Voice Acting Roles

+ tabs('voice-acting-roles', $data['characters'], static function ($characterList) use ($component, $helper, $url) { + $voiceRoles = []; + foreach ($characterList as $cid => $item): + $character = $component->character( + $item['character']['canonicalName'], + $url->generate('character', ['slug' => $item['character']['slug']]), + $helper->picture(getLocalImg($item['character']['image']['original'])) + ); + $medias = []; + foreach ($item['media'] as $sid => $series) + { + $medias[] = $component->media( + Kitsu::filterTitles($series), + $url->generate('anime.details', ['id' => $series['slug']]), + $helper->picture("images/anime/{$sid}.webp") + ); + } + $media = implode('', array_map('mb_trim', $medias)); + + $voiceRoles[] = << + {$character} + +
{$media}
+ + +HTML; + endforeach; + + $roles = implode('', array_map('mb_trim', $voiceRoles)); + + return << + + + Character + Series + + + {$roles} + +HTML; + + }) ?>
diff --git a/app/views/settings/settings.php b/app/views/settings/settings.php index b51319aa..16fef5f0 100644 --- a/app/views/settings/settings.php +++ b/app/views/settings/settings.php @@ -28,9 +28,7 @@ $nestedPrefix = 'config'; />
- -
checkAuth(); ?>

Not Authorized.

@@ -43,11 +41,15 @@ $nestedPrefix = 'config';

Linked to Anilist. Your access token will expire around

+ a( - $url->generate('anilist-redirect'), - 'Update Access Token' - ) ?> + $url->generate('anilist-redirect'), + 'Update Access Token', + ['class' => 'bracketed user-btn'] + ) ?> + +
diff --git a/app/views/user/details.php b/app/views/user/details.php index f47bb675..f31d7a79 100644 --- a/app/views/user/details.php +++ b/app/views/user/details.php @@ -57,79 +57,40 @@ use Aviat\AnimeClient\API\Kitsu;

Favorites

-
- - - /> - -
- $char): ?> - - - - -
- - - - /> - -
- - - -
- - - - /> - -
- - - -
- - -
+ tabs('user-favorites', $data['favorites'], static function ($items, $type) use ($component, $helper, $url) { + $rendered = []; + if ($type === 'characters') + { + uasort($items, fn ($a, $b) => $a['canonicalName'] <=> $b['canonicalName']); + } + else + { + uasort($items, fn ($a, $b) => Kitsu::filterTitles($a)[0] <=> Kitsu::filterTitles($b)[0]); + } + + foreach ($items as $id => $item) + { + if ($type === 'characters') + { + $rendered[] = $component->character( + $item['canonicalName'], + $url->generate('character', ['slug', $item['slug']]), + $helper->picture("images/characters/{$item['id']}.webp") + ); + } + else + { + $rendered[] = $component->media( + Kitsu::filterTitles($item), + $url->generate("{$type}.details", ['id' => $item['slug']]), + $helper->picture("images/{$type}/{$item['id']}.webp"), + ); + } + } + + return implode('', array_map('mb_trim', $rendered)); + + }, 'content full-width media-wrap') ?>
From a4cde0b28da0aacb854b7633d14523687473f8bf Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 21 Aug 2020 19:26:54 -0400 Subject: [PATCH 42/86] Fix setup of console commands --- src/AnimeClient/Command/BaseCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AnimeClient/Command/BaseCommand.php b/src/AnimeClient/Command/BaseCommand.php index 08461764..d5e9dc90 100644 --- a/src/AnimeClient/Command/BaseCommand.php +++ b/src/AnimeClient/Command/BaseCommand.php @@ -143,7 +143,7 @@ abstract class BaseCommand extends Command { $appLogger->pushHandler(new RotatingFileHandler($APP_DIR . '/logs/app-cli.log', 2, Logger::WARNING)); $container->setLogger($appLogger); - foreach (['anilist-request-cli', 'kitsu-request-cli'] as $channel) + foreach (['kitsu-request', 'anilist-request', 'anilist-request-cli', 'kitsu-request-cli'] as $channel) { $logger = new Logger($channel); $handler = new RotatingFileHandler( "{$APP_DIR}/logs/{$channel}.log", 2, Logger::WARNING); From 7d6af5ad00c5337e9fce28d5c8adceaa7ecbb953 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 24 Aug 2020 13:07:47 -0400 Subject: [PATCH 43/86] Get library entry via GraphQL, see #28 --- src/AnimeClient/API/Kitsu/ListItem.php | 18 +- src/AnimeClient/API/Kitsu/MangaTrait.php | 2 - src/AnimeClient/API/Kitsu/Model.php | 89 +-------- .../Kitsu/Queries/CharacterDetails.graphql | 11 - .../API/Kitsu/Queries/GetLibraryItem.graphql | 73 +++++++ src/AnimeClient/API/Kitsu/RequestBuilder.php | 25 +-- .../Kitsu/Transformer/AnimeTransformer.php | 29 +-- .../Transformer/LibraryEntryTransformer.php | 188 ++++++++++++++++++ .../Kitsu/Transformer/MangaTransformer.php | 26 ++- 9 files changed, 304 insertions(+), 157 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql create mode 100644 src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php diff --git a/src/AnimeClient/API/Kitsu/ListItem.php b/src/AnimeClient/API/Kitsu/ListItem.php index 476bce89..d3db19b2 100644 --- a/src/AnimeClient/API/Kitsu/ListItem.php +++ b/src/AnimeClient/API/Kitsu/ListItem.php @@ -115,21 +115,9 @@ final class ListItem extends AbstractListItem { */ public function get(string $id): array { - $authHeader = $this->getAuthHeader(); - - $request = $this->requestBuilder->newRequest('GET', "library-entries/{$id}") - ->setQuery([ - 'include' => 'media,media.categories,media.mappings' - ]); - - if ($authHeader !== NULL) - { - $request = $request->setHeader('Authorization', $authHeader); - } - - $request = $request->getFullRequest(); - $response = getResponse($request); - return Json::decode(wait($response->getBody()->buffer())); + return $this->requestBuilder->runQuery('GetLibraryItem', [ + 'id' => $id, + ]); } /** diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index 58a8a663..cd3a938b 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -59,7 +59,6 @@ trait MangaTrait { $baseData = $this->requestBuilder->runQuery('MangaDetails', [ 'slug' => $slug ]); - // $baseData = $this->getRawMediaData('manga', $slug); if (empty($baseData)) { @@ -80,7 +79,6 @@ trait MangaTrait { $baseData = $this->requestBuilder->runQuery('MangaDetailsById', [ 'id' => $mangaId, ]); - // $baseData = $this->getRawMediaDataById('manga', $mangaId); return $this->mangaTransformer->transform($baseData); } diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index af852d3a..cb339312 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -28,6 +28,7 @@ use Aviat\AnimeClient\API\{ use Aviat\AnimeClient\API\Kitsu\Transformer\{ AnimeTransformer, AnimeListTransformer, + LibraryEntryTransformer, MangaTransformer, MangaListTransformer }; @@ -331,24 +332,12 @@ final class Model { public function getListItem(string $listId) { $baseData = $this->listItem->get($listId); - $included = JsonAPI::organizeIncludes($baseData['included']); - - if (array_key_exists('anime', $included)) + if ( ! isset($baseData['data']['findLibraryEntryById'])) { - $included = JsonAPI::inlineIncludedRelationships($included, 'anime'); - $baseData['data']['included'] = $included; - return $this->animeListTransformer->transform($baseData['data']); + return []; } - if (array_key_exists('manga', $included)) - { - $included = JsonAPI::inlineIncludedRelationships($included, 'manga'); - $baseData['data']['included'] = $included; - $baseData['data']['manga'] = $baseData['included'][0]; - return $this->mangaListTransformer->transform($baseData['data']); - } - - return $baseData['data']; + return (new LibraryEntryTransformer())->transform($baseData['data']['findLibraryEntryById']); } /** @@ -464,76 +453,6 @@ final class Model { ->get(['kitsu_username']); } - /** - * Get the raw data for the anime/manga id - * - * @param string $type - * @param string $id - * @return array - */ - private function getRawMediaDataById(string $type, string $id): array - { - $options = [ - 'query' => [ - 'include' => ($type === 'anime') - ? 'categories,mappings,streamingLinks' - : 'categories,mappings', - ] - ]; - - $data = $this->requestBuilder->getRequest("{$type}/{$id}", $options); - - if (empty($data['data'])) - { - return []; - } - - $baseData = $data['data']['attributes']; - $baseData['id'] = $id; - $baseData['included'] = $data['included']; - return $baseData; - } - - /** - * Get media item by slug - * - * @param string $type - * @param string $slug - * @return array - */ - private function getRawMediaData(string $type, string $slug): array - { - $options = [ - 'query' => [ - 'filter' => [ - 'slug' => $slug - ], - 'fields' => [ - 'categories' => 'slug,title', - 'characters' => 'slug,name,image', - 'mappings' => 'externalSite,externalId', - 'animeCharacters' => 'character,role', - 'mediaCharacters' => 'character,role', - ], - 'include' => ($type === 'anime') - ? 'staff,staff.person,categories,mappings,streamingLinks,animeCharacters.character,characters.character' - : 'staff,staff.person,categories,mappings,characters.character', - ] - ]; - - $data = $this->requestBuilder->getRequest($type, $options); - - if (empty($data['data'])) - { - return []; - } - - $baseData = $data['data'][0]['attributes']; - $baseData['id'] = $data['data'][0]['id']; - $baseData['included'] = $data['included']; - return $baseData; - } - private function getListCount(string $type, string $status = ''): int { $options = [ diff --git a/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql index 6054f9e0..25e89db3 100644 --- a/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql @@ -13,17 +13,6 @@ query ($slug: String!) { canonicalLocale localized }, - primaryMedia { - posterImage { - original { - url - } - } - titles { - canonical - } - type - }, media { nodes { media { diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql new file mode 100644 index 00000000..ad9f61cc --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql @@ -0,0 +1,73 @@ +query($id: ID!) { + findLibraryEntryById(id: $id) { + id + updatedAt + notes + nsfw + private + progress + reconsumeCount + reconsuming + status + rating + media { + id + slug + ageRating + categories { + nodes { + title + } + } + mappings { + nodes { + externalId + externalSite + } + } + posterImage { + views { + width + height + url + } + original { + width + height + url + } + } + startDate + endDate + titles { + canonical + localized + canonicalLocale + } + type + ...on Anime { + episodeCount + episodeLength + streamingLinks { + nodes { + dubs + subs + regions + streamer { + id + siteName + } + url + } + } + subtype + } + ...on Manga { + chapterCount + volumeCount + subtype + + } + } + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/RequestBuilder.php b/src/AnimeClient/API/Kitsu/RequestBuilder.php index d688a941..586efb27 100644 --- a/src/AnimeClient/API/Kitsu/RequestBuilder.php +++ b/src/AnimeClient/API/Kitsu/RequestBuilder.php @@ -255,7 +255,7 @@ final class RequestBuilder extends APIRequestBuilder { public function mutate(string $name, array $variables = []): array { $request = $this->mutateRequest($name, $variables); - $response = $this->getResponseFromRequest($request); + $response = getResponse($request); return Json::decode(wait($response->getBody()->buffer())); } @@ -267,7 +267,7 @@ final class RequestBuilder extends APIRequestBuilder { * @param string $url * @param array $options * @return Response - * @throws Throwable + * @throws \Throwable */ public function getResponse(string $type, string $url, array $options = []): Response { @@ -286,27 +286,6 @@ final class RequestBuilder extends APIRequestBuilder { return $response; } - /** - * @param Request $request - * @return Response - * @throws Throwable - */ - private function getResponseFromRequest(Request $request): Response - { - $logger = $this->container->getLogger('kitsu-request'); - $response = getResponse($request); - - $logger->debug('Kitsu GraphQL response', [ - 'status' => $response->getStatus(), - 'reason' => $response->getReason(), - 'body' => $response->getBody(), - 'headers' => $response->getHeaders(), - 'requestHeaders' => $request->getHeaders(), - ]); - - return $response; - } - /** * Remove some boilerplate for GraphQL requests * diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php index 68352edb..40d9dec7 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -34,9 +34,6 @@ final class AnimeTransformer extends AbstractTransformer { */ public function transform($item): AnimePage { - // TODO: missing GraphQL data: - // * streaming links - $base = array_key_exists('findAnimeBySlug', $item['data']) ? $item['data']['findAnimeBySlug'] : $item['data']['findAnimeById']; @@ -52,12 +49,14 @@ final class AnimeTransformer extends AbstractTransformer { if (count($base['characters']['nodes']) > 0) { - $characters['main'] = []; - $characters['supporting'] = []; - foreach ($base['characters']['nodes'] as $rawCharacter) { - $type = $rawCharacter['role'] === 'MAIN' ? 'main' : 'supporting'; + $type = mb_strtolower($rawCharacter['role']); + if ( ! isset($characters[$type])) + { + $characters[$type] = []; + } + $details = $rawCharacter['character']; $characters[$type][$details['id']] = [ 'image' => $details['image'], @@ -66,13 +65,19 @@ final class AnimeTransformer extends AbstractTransformer { ]; } - uasort($characters['main'], fn($a, $b) => $a['name'] <=> $b['name']); - uasort($characters['supporting'], fn($a, $b) => $a['name'] <=> $b['name']); - - if (empty($characters['supporting'])) + foreach (array_keys($characters) as $type) { - unset($characters['supporting']); + if (empty($characters[$type])) + { + unset($characters[$type]); + } + else + { + uasort($characters[$type], fn($a, $b) => $a['name'] <=> $b['name']); + } } + + krsort($characters); } if (count($base['staff']['nodes']) > 0) diff --git a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php new file mode 100644 index 00000000..47e10586 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php @@ -0,0 +1,188 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu\Transformer; + +use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Types\{FormItem, AnimeListItem, MangaListItem, MangaListItemDetail}; +use Aviat\Ion\Transformer\AbstractTransformer; +use Aviat\Ion\Type\StringType; + +/** + * Transformer for anime list + */ +final class LibraryEntryTransformer extends AbstractTransformer +{ + public function transform($item) + { + $type = $item['media']['type'] ?? ''; + + $genres = []; + if ($type !== '') + { + $genres = array_column($item['media']['categories']['nodes'], 'title'); + sort($genres); + } + + switch (strtolower($type)) + { + case 'anime': + return $this->animeTransform($item, $genres); + + case 'manga': + return $this->mangaTransform($item, $genres); + + default: + return []; + } + } + + private function animeTransform($item, array $genres): AnimeListItem + { + $animeId = $item['media']['id']; + $anime = $item['media']; + + $rating = (int) $item['rating'] !== 0 + ? $item['rating'] / 2 + : '-'; + + $total_episodes = array_key_exists('episodeCount', $anime) && (int) $anime['episodeCount'] !== 0 + ? (int) $anime['episodeCount'] + : '-'; + + $MALid = NULL; + + if (isset($anime['mappings']['nodes'])) + { + foreach ($anime['mappings']['nodes'] as $mapping) + { + if ($mapping['externalSite'] === 'MYANIMELIST_ANIME') + { + $MALid = $mapping['externalId']; + break; + } + } + } + + $streamingLinks = array_key_exists('nodes', $anime['streamingLinks']) + ? Kitsu::parseStreamingLinks($anime['streamingLinks']['nodes']) + : []; + + $titles = Kitsu::getFilteredTitles($anime['titles']); + $title = $anime['titles']['canonical']; + + return AnimeListItem::from([ + 'id' => $item['id'], + 'mal_id' => $MALid, + 'episodes' => [ + 'watched' => (int) $item['progress'] !== 0 + ? (int) $item['progress'] + : '-', + 'total' => $total_episodes, + 'length' => $anime['episodeLength'], + ], + 'airing' => [ + 'status' => Kitsu::getAiringStatus($anime['startDate'], $anime['endDate']), + 'started' => $anime['startDate'], + 'ended' => $anime['endDate'] + ], + 'anime' => [ + 'id' => $animeId, + 'age_rating' => $anime['ageRating'], + 'title' => $title, + 'titles' => $titles, + 'slug' => $anime['slug'], + 'show_type' => (string)StringType::from($anime['subtype'])->upperCaseFirst(), + 'cover_image' => $anime['posterImage']['views'][1]['url'], + 'genres' => $genres, + 'streaming_links' => $streamingLinks, + ], + 'watching_status' => $item['status'], + 'notes' => $item['notes'], + 'rewatching' => (bool) $item['reconsuming'], + 'rewatched' => (int) $item['reconsumeCount'], + 'user_rating' => $rating, + 'private' => $item['private'] ?? FALSE, + ]); + } + + private function mangaTransform($item, array $genres): MangaListItem + { + $mangaId = $item['media']['id']; + $manga = $item['media']; + + $rating = (int) $item['rating'] !== 0 + ? $item['rating'] / 2 + : '-'; + + $totalChapters = ((int) $manga['chapterCount'] !== 0) + ? $manga['chapterCount'] + : '-'; + + $totalVolumes = ((int) $manga['volumeCount'] !== 0) + ? $manga['volumeCount'] + : '-'; + + $readChapters = ((int) $item['progress'] !== 0) + ? $item['progress'] + : '-'; + + $MALid = NULL; + + if (isset($manga['mappings']['nodes'])) + { + foreach ($manga['mappings']['nodes'] as $mapping) + { + if ($mapping['externalSite'] === 'MYANIMELIST_MANGA') + { + $MALid = $mapping['externalId']; + break; + } + } + } + + $titles = Kitsu::getFilteredTitles($manga['titles']); + $title = $manga['titles']['canonical']; + + return MangaListItem::from([ + 'id' => $item['id'], + 'mal_id' => $MALid, + 'chapters' => [ + 'read' => $readChapters, + 'total' => $totalChapters + ], + 'volumes' => [ + 'read' => '-', //$item['attributes']['volumes_read'], + 'total' => $totalVolumes + ], + 'manga' => MangaListItemDetail::from([ + 'genres' => $genres, + 'id' => $mangaId, + 'image' => $manga['posterImage']['views'][1]['url'], + 'slug' => $manga['slug'], + 'title' => $title, + 'titles' => $titles, + 'type' => (string)StringType::from($manga['subtype'])->upperCaseFirst(), + 'url' => 'https://kitsu.io/manga/' . $manga['slug'], + ]), + 'reading_status' => strtolower($item['status']), + 'notes' => $item['notes'], + 'rereading' => (bool)$item['reconsuming'], + 'reread' => $item['reconsumeCount'], + 'user_rating' => $rating, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php index 09e5b40a..77f2d3b1 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php @@ -49,12 +49,14 @@ final class MangaTransformer extends AbstractTransformer { if (count($base['characters']['nodes']) > 0) { - $characters['main'] = []; - $characters['supporting'] = []; - foreach ($base['characters']['nodes'] as $rawCharacter) { - $type = $rawCharacter['role'] === 'MAIN' ? 'main' : 'supporting'; + $type = mb_strtolower($rawCharacter['role']); + if ( ! isset($characters[$type])) + { + $characters[$type] = []; + } + $details = $rawCharacter['character']; $characters[$type][$details['id']] = [ 'image' => $details['image'], @@ -63,13 +65,19 @@ final class MangaTransformer extends AbstractTransformer { ]; } - uasort($characters['main'], fn($a, $b) => $a['name'] <=> $b['name']); - uasort($characters['supporting'], fn($a, $b) => $a['name'] <=> $b['name']); - - if (empty($characters['supporting'])) + foreach (array_keys($characters) as $type) { - unset($characters['supporting']); + if (empty($characters[$type])) + { + unset($characters[$type]); + } + else + { + uasort($characters[$type], fn($a, $b) => $a['name'] <=> $b['name']); + } } + + krsort($characters); } if (count($base['staff']['nodes']) > 0) From 40a340c67cd90abe69ec74e62d749281185c4873 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 24 Aug 2020 13:09:43 -0400 Subject: [PATCH 44/86] Update some GraphQL queries --- src/AnimeClient/API/Anilist/Model.php | 2 +- .../API/Anilist/RequestBuilder.php | 2 +- src/AnimeClient/API/Kitsu.php | 2 +- src/AnimeClient/API/Kitsu/AnimeTrait.php | 29 +- .../API/Kitsu/Queries/AnimeDetails.graphql | 6 + .../Kitsu/Queries/AnimeDetailsById.graphql | 6 + .../API/Kitsu/Queries/MangaDetails.graphql | 6 + .../Kitsu/Queries/MangaDetailsById.graphql | 6 + .../API/Kitsu/Queries/UserDetails.graphql | 29 +- src/AnimeClient/API/Kitsu/schema.graphql | 333 ++++++++++++++---- 10 files changed, 320 insertions(+), 101 deletions(-) diff --git a/src/AnimeClient/API/Anilist/Model.php b/src/AnimeClient/API/Anilist/Model.php index 5c14aa77..eb741a1f 100644 --- a/src/AnimeClient/API/Anilist/Model.php +++ b/src/AnimeClient/API/Anilist/Model.php @@ -77,7 +77,7 @@ final class Model ]) ->getFullRequest(); - $response = $this->getResponseFromRequest($request); + $response = $this->requestBuilder->getResponseFromRequest($request); return Json::decode(wait($response->getBody()->buffer())); } diff --git a/src/AnimeClient/API/Anilist/RequestBuilder.php b/src/AnimeClient/API/Anilist/RequestBuilder.php index 8ffee378..3717bf15 100644 --- a/src/AnimeClient/API/Anilist/RequestBuilder.php +++ b/src/AnimeClient/API/Anilist/RequestBuilder.php @@ -218,7 +218,7 @@ final class RequestBuilder extends APIRequestBuilder { * @return Response * @throws Throwable */ - private function getResponseFromRequest(Request $request): Response + public function getResponseFromRequest(Request $request): Response { $logger = $this->container->getLogger('anilist-request'); diff --git a/src/AnimeClient/API/Kitsu.php b/src/AnimeClient/API/Kitsu.php index fd739c94..5401baf1 100644 --- a/src/AnimeClient/API/Kitsu.php +++ b/src/AnimeClient/API/Kitsu.php @@ -138,7 +138,7 @@ final class Kitsu { /** * Reorganize streaming links * - * @param array $included + * @param array $nodes * @return array */ public static function parseStreamingLinks(array $nodes): array diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index 8894a0a2..22ee319b 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -72,6 +72,20 @@ trait AnimeTrait { return $this->animeTransformer->transform($baseData); } + /** + * Get information about a particular anime + * + * @param string $animeId + * @return Anime + */ + public function getAnimeById(string $animeId): Anime + { + $baseData = $this->requestBuilder->runQuery('AnimeDetailsById', [ + 'id' => $animeId, + ]); + return $this->animeTransformer->transform($baseData); + } + /** * Retrieve the data for the anime watch history page * @@ -100,21 +114,6 @@ trait AnimeTrait { return $list; } - /** - * Get information about a particular anime - * - * @param string $animeId - * @return Anime - */ - public function getAnimeById(string $animeId): Anime - { - $baseData = $this->requestBuilder->runQuery('AnimeDetailsById', [ - 'id' => $animeId, - ]); - // $baseData = $this->getRawMediaDataById('anime', $animeId); - return $this->animeTransformer->transform($baseData); - } - /** * Get the anime list for the configured user * diff --git a/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql index 75089d10..ce72f4d3 100644 --- a/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql @@ -59,6 +59,12 @@ query ($slug: String!) { season sfw slug + mappings { + nodes { + externalId + externalSite + } + } staff { nodes { person { diff --git a/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql b/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql index e6bec879..658a8cdc 100644 --- a/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql @@ -59,6 +59,12 @@ query ($id: ID!) { season sfw slug + mappings { + nodes { + externalId + externalSite + } + } staff { nodes { person { diff --git a/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql index 2b6e6246..973d103e 100644 --- a/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql @@ -54,6 +54,12 @@ query ($slug: String!) { description startDate endDate + mappings { + nodes { + externalId + externalSite + } + } posterImage { original { height diff --git a/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql b/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql index 3364b830..ebdea83d 100644 --- a/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql @@ -54,6 +54,12 @@ query ($id: ID!) { description startDate endDate + mappings { + nodes { + externalId + externalSite + } + } posterImage { original { height diff --git a/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql index d4c748d5..bb060bda 100644 --- a/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql @@ -17,11 +17,18 @@ query ($slug: String!) { height } } + birthday id name proMessage proTier slug + siteLinks { + nodes { + id + url + } + } stats { animeAmountConsumed { completed @@ -31,11 +38,6 @@ query ($slug: String!) { time units } - animeCategoryBreakdown { - categories - recalculatedAt - total - } mangaAmountConsumed { completed id @@ -43,15 +45,11 @@ query ($slug: String!) { recalculatedAt units } - mangaCategoryBreakdown { - categories - recalculatedAt - total - } } url waifu { id + slug image { original { name @@ -65,16 +63,7 @@ query ($slug: String!) { alternatives localized } - primaryMedia { - slug - titles { - canonical - alternatives - localized - } - } - slug } - # waifuOrHusbando + waifuOrHusbando } } diff --git a/src/AnimeClient/API/Kitsu/schema.graphql b/src/AnimeClient/API/Kitsu/schema.graphql index 690df26d..8b4980db 100644 --- a/src/AnimeClient/API/Kitsu/schema.graphql +++ b/src/AnimeClient/API/Kitsu/schema.graphql @@ -195,13 +195,35 @@ interface Streamable { subs: [String!]! } +"Media units such as episodes or chapters" +interface Unit { + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The sequence number of this unit" + number: Int! + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! +} + +interface WithTimestamps { + createdAt: ISO8601DateTime! + updatedAt: ISO8601DateTime! +} + +"Objects which are Favoritable" +union FavoriteItem = Anime | Character | Manga | Person + "Objects which are Mappable" union MappingItem = Anime | Category | Character | Episode | Manga | Person | Producer "A user account on Kitsu" -type Account { +type Account implements WithTimestamps { "The country this user resides in" country: String + createdAt: ISO8601DateTime! "The email addresses associated with this account" email: [String!]! "Facebook account linked to the account" @@ -225,9 +247,10 @@ type Account { titleLanguagePreference: TitleLanguagePreference "Twitter account linked to the account" twitterId: String + updatedAt: ISO8601DateTime! } -type Anime implements Episodic & Media { +type Anime implements Episodic & Media & WithTimestamps { "The recommended minimum age group for this media" ageRating: AgeRating "An explanation of why this received the age rating it did" @@ -258,6 +281,7 @@ type Anime implements Episodic & Media { "Returns the last _n_ elements from the list." last: Int ): MediaCharacterConnection! + createdAt: ISO8601DateTime! "A brief (mostly spoiler free) summary or description of the media." description(locales: [String!]): Map! "the day that this media made its final release" @@ -371,15 +395,17 @@ type Anime implements Episodic & Media { totalLength: Int "Anime or Manga." type: String! + updatedAt: ISO8601DateTime! "The number of users with this in their library" userCount: Int "Video id for a trailer on YouTube" youtubeTrailerVideoId: String } -type AnimeAmountConsumed implements AmountConsumed { +type AnimeAmountConsumed implements AmountConsumed & WithTimestamps { "Total media completed atleast once." completed: Int! + createdAt: ISO8601DateTime! id: ID! "Total amount of media." media: Int! @@ -391,11 +417,13 @@ type AnimeAmountConsumed implements AmountConsumed { time: Int! "Total progress of library including reconsuming." units: Int! + updatedAt: ISO8601DateTime! } -type AnimeCategoryBreakdown implements CategoryBreakdown { +type AnimeCategoryBreakdown implements CategoryBreakdown & WithTimestamps { "A Map of category_id -> count for all categories present on the library entries" categories: Map! + createdAt: ISO8601DateTime! id: ID! "The profile related to the user for this stat." profile: Profile! @@ -403,6 +431,7 @@ type AnimeCategoryBreakdown implements CategoryBreakdown { recalculatedAt: ISO8601Date! "The total amount of library entries." total: Int! + updatedAt: ISO8601DateTime! } "The connection type for Anime." @@ -439,12 +468,13 @@ type AnimeEdge { node: Anime } -type AnimeMutation { +type AnimeMutation implements WithTimestamps { "Create an Anime." create( "Create an Anime." input: AnimeCreateInput! ): AnimeCreatePayload + createdAt: ISO8601DateTime! "Delete an Anime." delete( "Delete an Anime." @@ -455,6 +485,7 @@ type AnimeMutation { "Update an Anime." input: AnimeUpdateInput! ): AnimeUpdatePayload + updatedAt: ISO8601DateTime! } "Autogenerated return type of AnimeUpdate" @@ -465,7 +496,7 @@ type AnimeUpdatePayload { } "Information about a specific Category" -type Category { +type Category implements WithTimestamps { "The child categories." children( "Returns the elements in the list that come after the specified cursor." @@ -477,6 +508,7 @@ type Category { "Returns the last _n_ elements from the list." last: Int ): CategoryConnection + createdAt: ISO8601DateTime! "A brief summary or description of the catgory." description(locales: [String!]): Map! id: ID! @@ -488,6 +520,7 @@ type Category { slug: String! "The name of the category." title(locales: [String!]): Map! + updatedAt: ISO8601DateTime! } "The connection type for Category." @@ -510,23 +543,25 @@ type CategoryEdge { node: Category } -"A single chapter part of a volume." -type Chapter { +"A single chapter of a manga" +type Chapter implements Unit & WithTimestamps { + createdAt: ISO8601DateTime! + "A brief summary or description of the unit" + description(locales: [String!]): Map! id: ID! "The manga this chapter is in." manga: Manga! - "The number of pages in this chapter." + "The sequence number of this unit" number: Int! - "The date when this chapter was released." - published: ISO8601Date - "A thumbnail image for the chapter." + "When this chapter was released" + releasedAt: ISO8601Date + "A thumbnail image for the unit" thumbnail: Image - "The titles for this chapter in various locales" + "The titles for this unit in various locales" titles: TitlesList! + updatedAt: ISO8601DateTime! "The volume this chapter is in." volume: Volume - "The volume number this chapter is in." - volumeNumber: Int } "The connection type for Chapter." @@ -550,7 +585,8 @@ type ChapterEdge { } "Information about a Character in the Kitsu database" -type Character { +type Character implements WithTimestamps { + createdAt: ISO8601DateTime! "A brief summary or description of the character." description(locales: [String!]): Map! id: ID! @@ -573,10 +609,12 @@ type Character { primaryMedia: Media "The URL-friendly identifier of this character" slug: String! + updatedAt: ISO8601DateTime! } "Information about a VA (Person) voicing a Character in a Media" -type CharacterVoice { +type CharacterVoice implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! "The company who hired this voice actor to play this role" licensor: Producer @@ -586,6 +624,7 @@ type CharacterVoice { mediaCharacter: MediaCharacter! "The person who voice acted this role" person: Person! + updatedAt: ISO8601DateTime! } "The connection type for CharacterVoice." @@ -609,13 +648,14 @@ type CharacterVoiceEdge { } "A comment on a post" -type Comment { +type Comment implements WithTimestamps { "The user who created this comment for the parent post." author: Profile! "Unmodified content." content: String! "Html formatted content." contentFormatted: String! + createdAt: ISO8601DateTime! id: ID! "Users who liked this comment." likes( @@ -643,6 +683,7 @@ type Comment { "Returns the last _n_ elements from the list." last: Int ): CommentConnection! + updatedAt: ISO8601DateTime! } "The connection type for Comment." @@ -666,20 +707,24 @@ type CommentEdge { } "An Episode of a Media" -type Episode { - "The time when the episode aired" - airedAt: ISO8601DateTime - "A brief summary or description of the episode." +type Episode implements Unit & WithTimestamps { + "The anime this episode is in" + anime: Anime! + createdAt: ISO8601DateTime! + "A brief summary or description of the unit" description(locales: [String!]): Map! id: ID! - "The length of the Episode in seconds" + "The length of the episode in seconds" length: Int - "The sequence number of this episode in the season" + "The sequence number of this unit" number: Int! - "A thumbnail image for the episode" + "When this episode aired" + releasedAt: ISO8601DateTime + "A thumbnail image for the unit" thumbnail: Image - "The titles for this episode in various locales" + "The titles for this unit in various locales" titles: TitlesList! + updatedAt: ISO8601DateTime! } "The connection type for Episode." @@ -702,33 +747,72 @@ type EpisodeEdge { node: Episode } -type Generic implements Base { +"Favorite media, characters, and people for a user" +type Favorite implements WithTimestamps { + createdAt: ISO8601DateTime! + id: ID! + "The kitsu object that is mapped" + item: FavoriteItem! + updatedAt: ISO8601DateTime! + "The user who favorited this item" + user: Profile! +} + +"The connection type for Favorite." +type FavoriteConnection { + "A list of edges." + edges: [FavoriteEdge] + "A list of nodes." + nodes: [Favorite] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! +} + +"An edge in a connection." +type FavoriteEdge { + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Favorite +} + +type Generic implements Base & WithTimestamps { "The error code." code: String + createdAt: ISO8601DateTime! "A description of the error" message: String! "Which input value this error came from" path: [String!] + updatedAt: ISO8601DateTime! } -type GenericDelete { +type GenericDelete implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! + updatedAt: ISO8601DateTime! } -type Image { +type Image implements WithTimestamps { "A blurhash-encoded version of this image" blurhash: String + createdAt: ISO8601DateTime! "The original image" original: ImageView! + updatedAt: ISO8601DateTime! "The various generated views of this image" views(names: [String!]): [ImageView!]! } -type ImageView { +type ImageView implements WithTimestamps { + createdAt: ISO8601DateTime! "The height of the image" height: Int "The name of this view of the image" name: String! + updatedAt: ISO8601DateTime! "The URL of this view of the image" url: String! "The width of the image" @@ -736,7 +820,7 @@ type ImageView { } "The user library filterable by media_type and status" -type Library { +type Library implements WithTimestamps { "All Library Entries for a specific Media" all( "Returns the elements in the list that come after the specified cursor." @@ -747,7 +831,8 @@ type Library { first: Int, "Returns the last _n_ elements from the list." last: Int, - mediaType: media_type! + mediaType: media_type!, + status: [LibraryEntryStatus!] ): LibraryEntryConnection! "Library Entries for a specific Media filtered by the completed status" completed( @@ -761,6 +846,7 @@ type Library { last: Int, mediaType: media_type! ): LibraryEntryConnection! + createdAt: ISO8601DateTime! "Library Entries for a specific Media filtered by the current status" current( "Returns the elements in the list that come after the specified cursor." @@ -809,10 +895,12 @@ type Library { last: Int, mediaType: media_type! ): LibraryEntryConnection! + updatedAt: ISO8601DateTime! } "Information about a specific media entry for a user" -type LibraryEntry { +type LibraryEntry implements WithTimestamps { + createdAt: ISO8601DateTime! "History of user actions for this library entry." events( "Returns the elements in the list that come after the specified cursor." @@ -828,8 +916,12 @@ type LibraryEntry { "When the user finished this media." finishedAt: ISO8601DateTime id: ID! + "The last unit consumed" + lastUnit: Unit "The media related to this library entry." media: Media! + "The next unit to be consumed" + nextUnit: Unit "Notes left by the profile related to this library entry." notes: String "If the media related to the library entry is Not-Safe-for-Work." @@ -851,6 +943,7 @@ type LibraryEntry { "When the user started this media." startedAt: ISO8601DateTime status: LibraryEntryStatus! + updatedAt: ISO8601DateTime! "The user who created this library entry." user: Profile! "Volumes that the profile owns (physically or digital)." @@ -891,22 +984,34 @@ type LibraryEntryEdge { node: LibraryEntry } -type LibraryEntryMutation { - "Create a Library Entry." +type LibraryEntryMutation implements WithTimestamps { + "Create a library entry" create( "Create a Library Entry" input: LibraryEntryCreateInput! ): LibraryEntryCreatePayload - "Delete a Library Entry." + createdAt: ISO8601DateTime! + "Delete a library entry" delete( "Delete Library Entry" input: GenericDeleteInput! ): LibraryEntryDeletePayload - "Update a Library Entry." + "Update a library entry" update( "Update Library Entry" input: LibraryEntryUpdateInput! ): LibraryEntryUpdatePayload + "Update a library entry status by id" + updateStatusById( + "Update a library entry status by id" + input: UpdateStatusByIdInput! + ): LibraryEntryUpdateStatusByIdPayload + "Update a library entry status by media" + updateStatusByMedia( + "Update a library entry status by media" + input: UpdateStatusByMediaInput! + ): LibraryEntryUpdateStatusByMediaPayload + updatedAt: ISO8601DateTime! } "Autogenerated return type of LibraryEntryUpdate" @@ -916,10 +1021,25 @@ type LibraryEntryUpdatePayload { libraryEntry: LibraryEntry } +"Autogenerated return type of LibraryEntryUpdateStatusById" +type LibraryEntryUpdateStatusByIdPayload { + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry +} + +"Autogenerated return type of LibraryEntryUpdateStatusByMedia" +type LibraryEntryUpdateStatusByMediaPayload { + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry +} + "History of user actions for a library entry." -type LibraryEvent { +type LibraryEvent implements WithTimestamps { "The data that was changed for this library event." changedData: Map! + createdAt: ISO8601DateTime! id: ID! "The type of library event." kind: LibraryEventKind! @@ -927,6 +1047,7 @@ type LibraryEvent { libraryEntry: LibraryEntry! "The media related to this library event." media: Media! + updatedAt: ISO8601DateTime! "The user who created this library event" user: Profile! } @@ -951,7 +1072,7 @@ type LibraryEventEdge { node: LibraryEvent } -type Manga implements Media { +type Manga implements Media & WithTimestamps { "The recommended minimum age group for this media" ageRating: AgeRating "An explanation of why this received the age rating it did" @@ -997,6 +1118,7 @@ type Manga implements Media { "Returns the last _n_ elements from the list." last: Int ): MediaCharacterConnection! + createdAt: ISO8601DateTime! "A brief (mostly spoiler free) summary or description of the media." description(locales: [String!]): Map! "the day that this media made its final release" @@ -1081,15 +1203,17 @@ type Manga implements Media { titles: TitlesList! "Anime or Manga." type: String! + updatedAt: ISO8601DateTime! "The number of users with this in their library" userCount: Int "The number of volumes in this manga." volumeCount: Int } -type MangaAmountConsumed implements AmountConsumed { +type MangaAmountConsumed implements AmountConsumed & WithTimestamps { "Total media completed atleast once." completed: Int! + createdAt: ISO8601DateTime! id: ID! "Total amount of media." media: Int! @@ -1099,11 +1223,13 @@ type MangaAmountConsumed implements AmountConsumed { recalculatedAt: ISO8601Date! "Total progress of library including reconsuming." units: Int! + updatedAt: ISO8601DateTime! } -type MangaCategoryBreakdown implements CategoryBreakdown { +type MangaCategoryBreakdown implements CategoryBreakdown & WithTimestamps { "A Map of category_id -> count for all categories present on the library entries" categories: Map! + createdAt: ISO8601DateTime! id: ID! "The profile related to the user for this stat." profile: Profile! @@ -1111,6 +1237,7 @@ type MangaCategoryBreakdown implements CategoryBreakdown { recalculatedAt: ISO8601Date! "The total amount of library entries." total: Int! + updatedAt: ISO8601DateTime! } "The connection type for Manga." @@ -1134,7 +1261,8 @@ type MangaEdge { } "Media Mappings from External Sites (MAL, Anilist, etc..) to Kitsu." -type Mapping { +type Mapping implements WithTimestamps { + createdAt: ISO8601DateTime! "The ID of the media from the external site." externalId: ID! "The name of the site which kitsu media is being linked from." @@ -1142,6 +1270,7 @@ type Mapping { id: ID! "The kitsu object that is mapped." item: MappingItem! + updatedAt: ISO8601DateTime! } "The connection type for Mapping." @@ -1165,14 +1294,16 @@ type MappingEdge { } "Information about a Character starring in a Media" -type MediaCharacter { +type MediaCharacter implements WithTimestamps { "The character" character: Character! + createdAt: ISO8601DateTime! id: ID! "The media" media: Media! "The role this character had in the media" role: CharacterRole! + updatedAt: ISO8601DateTime! "The voices of this character" voices( "Returns the elements in the list that come after the specified cursor." @@ -1226,7 +1357,8 @@ type MediaEdge { } "The role a company played in the creation or localization of a media" -type MediaProduction { +type MediaProduction implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! "The media" media: Media! @@ -1234,6 +1366,7 @@ type MediaProduction { person: Producer! "The role this company played" role: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaProduction." @@ -1257,9 +1390,10 @@ type MediaProductionEdge { } "A simple review that is 140 characters long expressing how you felt about a media" -type MediaReaction { +type MediaReaction implements WithTimestamps { "The author who wrote this reaction." author: Profile! + createdAt: ISO8601DateTime! id: ID! "The library entry related to this reaction." libraryEntry: LibraryEntry! @@ -1280,6 +1414,7 @@ type MediaReaction { progress: Int! "The reaction text related to a media." reaction: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaReaction." @@ -1303,7 +1438,8 @@ type MediaReactionEdge { } "Information about a person working on an anime" -type MediaStaff { +type MediaStaff implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! "The media" media: Media! @@ -1311,6 +1447,7 @@ type MediaStaff { person: Person! "The role this person had in the creation of this media" role: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaStaff." @@ -1333,10 +1470,12 @@ type MediaStaffEdge { node: MediaStaff } -type Mutation { +type Mutation implements WithTimestamps { anime: AnimeMutation + createdAt: ISO8601DateTime! libraryEntry: LibraryEntryMutation pro: ProMutation! + updatedAt: ISO8601DateTime! } "Information about pagination in a connection." @@ -1356,9 +1495,10 @@ type PageInfo { A Voice Actor, Director, Animator, or other person who works in the creation and\ localization of media """ -type Person { +type Person implements WithTimestamps { "The day when this person was born" birthday: Date + createdAt: ISO8601DateTime! "A brief biography or description of the person." description(locales: [String!]): Map! id: ID! @@ -1370,6 +1510,7 @@ type Person { names: TitlesList! "The URL-friendly identifier of this person." slug: String! + updatedAt: ISO8601DateTime! "The voice-acting roles this person has had." voices( "Returns the elements in the list that come after the specified cursor." @@ -1384,7 +1525,7 @@ type Person { } "A post that is visible to your followers and globally in the news-feed." -type Post { +type Post implements WithTimestamps { "The user who created this post." author: Profile! "All comments related to this post." @@ -1402,6 +1543,7 @@ type Post { content: String! "Html formatted content." contentFormatted: String! + createdAt: ISO8601DateTime! "Users that are watching this post" follows( "Returns the elements in the list that come after the specified cursor." @@ -1431,6 +1573,7 @@ type Post { ): ProfileConnection! "The media tagged in this post." media: Media + updatedAt: ISO8601DateTime! } "The connection type for Post." @@ -1453,7 +1596,8 @@ type PostEdge { node: Post } -type ProMutation { +type ProMutation implements WithTimestamps { + createdAt: ISO8601DateTime! "Set the user's discord tag" setDiscord( "Your discord tag (Name#1234)" @@ -1466,27 +1610,32 @@ type ProMutation { ): SetMessagePayload "End the user's pro subscription" unsubscribe: UnsubscribePayload + updatedAt: ISO8601DateTime! } "A subscription to Kitsu PRO" -type ProSubscription { +type ProSubscription implements WithTimestamps { "The account which is subscribed to Pro benefits" account: Account! "The billing service used for this subscription" billingService: RecurringBillingService! + createdAt: ISO8601DateTime! "The tier of Pro the account is subscribed to" tier: ProTier! + updatedAt: ISO8601DateTime! } "A company involved in the creation or localization of media" -type Producer { +type Producer implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! "The name of this production company" name: String! + updatedAt: ISO8601DateTime! } "A user profile on Kitsu" -type Profile { +type Profile implements WithTimestamps { "A short biographical blurb about this profile" about: String "An avatar image to easily identify this profile" @@ -1506,6 +1655,18 @@ type Profile { "Returns the last _n_ elements from the list." last: Int ): CommentConnection! + createdAt: ISO8601DateTime! + "Favorite media, characters, and people" + favorites( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): FavoriteConnection! "People that follow the user" followers( "Returns the elements in the list that come after the specified cursor." @@ -1533,6 +1694,18 @@ type Profile { id: ID! "The user library of their media" library: Library! + "A list of library events for this user" + libraryEvents( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + kind: [LibraryEventKind!], + "Returns the last _n_ elements from the list." + last: Int + ): LibraryEventConnection! "The user's general location" location: String "Media reactions written by this user." @@ -1584,6 +1757,7 @@ type Profile { slug: String "The different stats we calculate for this user." stats: ProfileStats! + updatedAt: ISO8601DateTime! "A fully qualified URL to the profile" url: String "The character this profile has declared as their waifu or husbando" @@ -1613,15 +1787,17 @@ type ProfileEdge { } "The different types of user stats that we calculate." -type ProfileStats { +type ProfileStats implements WithTimestamps { "The total amount of anime you have watched over your whole life." animeAmountConsumed: AnimeAmountConsumed! "The breakdown of the different categories related to the anime you have completed" animeCategoryBreakdown: AnimeCategoryBreakdown! + createdAt: ISO8601DateTime! "The total amount of manga you ahve read over your whole life." mangaAmountConsumed: MangaAmountConsumed! "The breakdown of the different categories related to the manga you have completed" mangaCategoryBreakdown: MangaCategoryBreakdown! + updatedAt: ISO8601DateTime! } type Query { @@ -1664,6 +1840,8 @@ type Query { findCharacterBySlug(slug: String!): Character "Find a single Library Entry by ID" findLibraryEntryById(id: ID!): LibraryEntry + "Find a single Library Event by ID" + findLibraryEventById(id: ID!): LibraryEvent "Find a single Manga by ID" findMangaById(id: ID!): Manga "Find a single Manga by Slug" @@ -1766,7 +1944,8 @@ type Query { } "A quote from a media" -type Quote { +type Quote implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! "The lines of the quote" lines( @@ -1781,6 +1960,7 @@ type Quote { ): QuoteLineConnection! "The media this quote is excerpted from" media: Media! + updatedAt: ISO8601DateTime! } "The connection type for Quote." @@ -1804,14 +1984,16 @@ type QuoteEdge { } "A line in a quote" -type QuoteLine { +type QuoteLine implements WithTimestamps { "The character who said this line" character: Character! "The line that was spoken" content: String! + createdAt: ISO8601DateTime! id: ID! "The quote this line is in" quote: Quote! + updatedAt: ISO8601DateTime! } "The connection type for QuoteLine." @@ -1835,11 +2017,13 @@ type QuoteLineEdge { } "Information about a user session" -type Session { +type Session implements WithTimestamps { "The account associated with this session" account: Account + createdAt: ISO8601DateTime! "The profile associated with this session" profile: Profile + updatedAt: ISO8601DateTime! } "Autogenerated return type of SetDiscord" @@ -1857,10 +2041,12 @@ type SetMessagePayload { } "A link to a user's profile on an external site." -type SiteLink { +type SiteLink implements WithTimestamps { "The user profile the site is linked to." author: Profile! + createdAt: ISO8601DateTime! id: ID! + updatedAt: ISO8601DateTime! "A fully qualified URL of the user profile on an external site." url: String! } @@ -1886,7 +2072,8 @@ type SiteLinkEdge { } "The streaming company." -type Streamer { +type Streamer implements WithTimestamps { + createdAt: ISO8601DateTime! id: ID! "The name of the site that is streaming this media." siteName: String! @@ -1901,6 +2088,7 @@ type Streamer { "Returns the last _n_ elements from the list." last: Int ): StreamingLinkConnection! + updatedAt: ISO8601DateTime! "Videos of the media being streamed." videos( "Returns the elements in the list that come after the specified cursor." @@ -1915,7 +2103,8 @@ type Streamer { } "The stream link." -type StreamingLink implements Streamable { +type StreamingLink implements Streamable & WithTimestamps { + createdAt: ISO8601DateTime! "Spoken language is replaced by language of choice." dubs: [String!]! id: ID! @@ -1927,6 +2116,7 @@ type StreamingLink implements Streamable { streamer: Streamer! "Languages this is translated to. Usually placed at bottom of media." subs: [String!]! + updatedAt: ISO8601DateTime! "Fully qualified URL for the streaming link." url: String! } @@ -1951,15 +2141,17 @@ type StreamingLinkEdge { node: StreamingLink } -type TitlesList { +type TitlesList implements WithTimestamps { "A list of additional, alternative, abbreviated, or unofficial titles" alternatives: [String!] "The official or de facto international title" canonical: String "The locale code that identifies which title is used as the canonical title" canonicalLocale: String + createdAt: ISO8601DateTime! "The list of localized titles keyed by locale" localized(locales: [String!]): Map! + updatedAt: ISO8601DateTime! } "Autogenerated return type of Unsubscribe" @@ -1970,7 +2162,8 @@ type UnsubscribePayload { } "The media video." -type Video implements Streamable { +type Video implements Streamable & WithTimestamps { + createdAt: ISO8601DateTime! "Spoken language is replaced by language of choice." dubs: [String!]! "The episode of this video" @@ -1982,6 +2175,7 @@ type Video implements Streamable { streamer: Streamer! "Languages this is translated to. Usually placed at bottom of media." subs: [String!]! + updatedAt: ISO8601DateTime! "The url of the video." url: String! } @@ -2007,7 +2201,7 @@ type VideoEdge { } "A manga volume which can contain multiple chapters." -type Volume { +type Volume implements WithTimestamps { "The chapters in this volume." chapters( "Returns the elements in the list that come after the specified cursor." @@ -2019,6 +2213,7 @@ type Volume { "Returns the last _n_ elements from the list." last: Int ): ChapterConnection + createdAt: ISO8601DateTime! id: ID! "The isbn number of this volume." isbn: [String!]! @@ -2030,6 +2225,7 @@ type Volume { published: ISO8601Date "The titles for this chapter in various locales" titles: TitlesList! + updatedAt: ISO8601DateTime! } enum AgeRating { @@ -2268,6 +2464,17 @@ input TitlesListInput { localized: Map } +input UpdateStatusByIdInput { + id: ID! + status: LibraryEntryStatus! +} + +input UpdateStatusByMediaInput { + mediaId: ID! + mediaType: media_type! + status: LibraryEntryStatus! +} + "A date, expressed as an ISO8601 string" scalar Date From 26a1c464a1f8b4996487ffa6721e6a4ee3d9413f Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 24 Aug 2020 13:10:43 -0400 Subject: [PATCH 45/86] Some syncing cleanup --- src/AnimeClient/Command/SyncLists.php | 21 +++++++++++++++++++-- src/AnimeClient/Controller.php | 1 + src/AnimeClient/Model/Anime.php | 11 ++--------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/AnimeClient/Command/SyncLists.php b/src/AnimeClient/Command/SyncLists.php index 30b2c2f9..63daeef4 100644 --- a/src/AnimeClient/Command/SyncLists.php +++ b/src/AnimeClient/Command/SyncLists.php @@ -655,7 +655,7 @@ final class SyncLists extends BaseCommand { $return['data'] = $update; $return['updateType'] = array_unique($return['updateType']); - // Fill in missing data values for update on Anlist + // Fill in missing data values for update // so I don't have to create a really complex graphql query // to handle each combination of fields if ($return['updateType'][0] === API::ANILIST) @@ -672,6 +672,22 @@ final class SyncLists extends BaseCommand { $return['data']['data'] = array_merge($prevData, $return['data']['data']); } + else if ($return['updateType'][0] === API::KITSU) + { + $prevData = [ + 'notes' => $anilistItem['data']['notes'], + 'private' => $anilistItem['data']['private'], + 'progress' => $anilistItem['data']['progress'] ?? 0, + 'rating' => (((int)$anilistItem['data']['rating']) > 0) + ? $anilistItem['data']['rating'] / 5 + : 0, + 'reconsumeCount' => $anilistItem['data']['reconsumeCount'], + 'reconsuming' => $anilistItem['data']['reconsuming'], + 'status' => $anilistItem['data']['status'], + ]; + + $return['data']['data'] = array_merge($prevData, $return['data']['data']); + } return $return; } @@ -718,6 +734,7 @@ final class SyncLists extends BaseCommand { $responseData = Json::decode($response); $id = $itemsToUpdate[$key]['id']; + $mal_id = $itemsToUpdate[$key]['mal_id']; if ( ! array_key_exists('errors', $responseData)) { $verb = ($action === SyncAction::UPDATE) ? 'updated' : 'created'; @@ -743,7 +760,7 @@ final class SyncLists extends BaseCommand { 'responseData' => $responseData, ]); $verb = ($action === SyncAction::UPDATE) ? SyncAction::UPDATE : SyncAction::CREATE; - $this->echoError("Failed to {$verb} Kitsu {$type} list item with id: {$id}"); + $this->echoError("Failed to {$verb} Kitsu {$type} list item with id: {$id}, and mal_id: {$mal_id}"); } } diff --git a/src/AnimeClient/Controller.php b/src/AnimeClient/Controller.php index e09a9864..8b79b891 100644 --- a/src/AnimeClient/Controller.php +++ b/src/AnimeClient/Controller.php @@ -285,6 +285,7 @@ class Controller { 'title' => $title, 'message' => $message, ], NULL, 404); + exit(); } /** diff --git a/src/AnimeClient/Model/Anime.php b/src/AnimeClient/Model/Anime.php index a0561141..825c9ffe 100644 --- a/src/AnimeClient/Model/Anime.php +++ b/src/AnimeClient/Model/Anime.php @@ -18,6 +18,7 @@ namespace Aviat\AnimeClient\Model; use Aviat\AnimeClient\API\Anilist\Model as AnilistModel; use Aviat\AnimeClient\API\Kitsu\Model as KitsuModel; +use Aviat\AnimeClient\API\Kitsu\Transformer\LibraryEntryTransformer; use Aviat\AnimeClient\API\ParallelAPIRequest; use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; use Aviat\AnimeClient\Types\{ @@ -159,15 +160,7 @@ class Anime extends API { */ public function getLibraryItem(string $itemId): AnimeListItem { - $item = $this->kitsuModel->getListItem($itemId); - $array = $item->toArray(); - - if (is_array($array['notes'])) - { - $array['notes'] = ''; - } - - return AnimeListItem::from($array); + return $this->kitsuModel->getListItem($itemId); } /** From ba276cc86eb0410983154dacb249b01de4e6d6b8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 24 Aug 2020 15:20:07 -0400 Subject: [PATCH 46/86] Update profile page to use GraphQL, see #27 --- app/views/anime/details.php | 16 ++- app/views/manga/details.php | 14 ++- app/views/user/details.php | 19 ++-- src/AnimeClient/API/Kitsu.php | 42 +++++++ src/AnimeClient/API/Kitsu/Model.php | 14 +-- .../API/Kitsu/Queries/UserDetails.graphql | 84 ++++++++++++++ .../Kitsu/Transformer/AnimeTransformer.php | 9 +- .../Kitsu/Transformer/MangaTransformer.php | 7 ++ .../API/Kitsu/Transformer/UserTransformer.php | 106 ++++-------------- src/AnimeClient/Types/AnimePage.php | 5 + src/AnimeClient/Types/MangaPage.php | 5 + 11 files changed, 215 insertions(+), 106 deletions(-) diff --git a/app/views/anime/details.php b/app/views/anime/details.php index b6fa4150..77fac541 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -50,6 +50,18 @@ use function Aviat\AnimeClient\getLocalImg; + + 0): ?> + + External Links + + $externalUrl): ?> +
+ + + + + Genres @@ -58,11 +70,13 @@ use function Aviat\AnimeClient\getLocalImg; + +
-

+

diff --git a/app/views/manga/details.php b/app/views/manga/details.php index 6b21901a..8afe36c4 100644 --- a/app/views/manga/details.php +++ b/app/views/manga/details.php @@ -34,6 +34,18 @@ + + 0): ?> + + External Links + + $externalUrl): ?> +
+ + + + + Genres @@ -45,7 +57,7 @@
-

+

diff --git a/app/views/user/details.php b/app/views/user/details.php index f31d7a79..db0f8a8c 100644 --- a/app/views/user/details.php +++ b/app/views/user/details.php @@ -36,7 +36,7 @@ use Aviat\AnimeClient\API\Kitsu; $character = $data['waifu']['character']; echo $helper->a( $url->generate('character', ['slug' => $character['slug']]), - $character['canonicalName'] + $character['names']['canonical'] ); ?> @@ -59,29 +59,32 @@ use Aviat\AnimeClient\API\Kitsu;

Favorites

tabs('user-favorites', $data['favorites'], static function ($items, $type) use ($component, $helper, $url) { $rendered = []; - if ($type === 'characters') + if ($type === 'character') { - uasort($items, fn ($a, $b) => $a['canonicalName'] <=> $b['canonicalName']); + uasort($items, fn ($a, $b) => $a['names']['canonical'] <=> $b['names']['canonical']); } else { - uasort($items, fn ($a, $b) => Kitsu::filterTitles($a)[0] <=> Kitsu::filterTitles($b)[0]); + uasort($items, fn ($a, $b) => $a['titles']['canonical'] <=> $b['titles']['canonical']); } foreach ($items as $id => $item) { - if ($type === 'characters') + if ($type === 'character') { $rendered[] = $component->character( - $item['canonicalName'], - $url->generate('character', ['slug', $item['slug']]), + $item['names']['canonical'], + $url->generate('character', ['slug' => $item['slug']]), $helper->picture("images/characters/{$item['id']}.webp") ); } else { $rendered[] = $component->media( - Kitsu::filterTitles($item), + array_merge( + [$item['titles']['canonical']], + Kitsu::getFilteredTitles($item['titles']), + ), $url->generate("{$type}.details", ['id' => $item['slug']]), $helper->picture("images/{$type}/{$item['id']}.webp"), ); diff --git a/src/AnimeClient/API/Kitsu.php b/src/AnimeClient/API/Kitsu.php index 5401baf1..8b21bd90 100644 --- a/src/AnimeClient/API/Kitsu.php +++ b/src/AnimeClient/API/Kitsu.php @@ -91,6 +91,48 @@ final class Kitsu { return MangaPublishingStatus::NOT_YET_PUBLISHED; } + public static function mappingsToUrls(array $mappings, string $kitsuLink = ''): array + { + $output = []; + foreach ($mappings as $mapping) + { + switch ($mapping['externalSite']) + { + case 'ANIDB': + $output['AniDB'] = "https://anidb.net/anime/{$mapping['externalId']}"; + break; + + case 'ANILIST_ANIME': + $output['Anilist'] = "https://anilist.co/anime/{$mapping['externalId']}/"; + break; + + case 'ANILIST_MANGA': + $output['Anilist'] = "https://anilist.co/manga/{$mapping['externalId']}/"; + break; + + case 'MYANIMELIST_ANIME': + $output['MyAnimeList'] = "https://myanimelist.net/anime/{$mapping['externalId']}"; + break; + + case 'MYANIMELIST_MANGA': + $output['MyAnimeList'] = "https://myanimelist.net/manga/{$mapping['externalId']}"; + break; + + default: + continue 2; + } + } + + if ($kitsuLink !== '') + { + $output['Kitsu'] = $kitsuLink; + } + + ksort($output); + + return $output; + } + /** * Reorganize streaming links * diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index cb339312..ff210c41 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -231,18 +231,8 @@ final class Model { */ public function getUserData(string $username): array { - return $this->requestBuilder->getRequest('users', [ - 'query' => [ - 'filter' => [ - 'name' => $username, - ], - 'fields' => [ - 'anime' => 'slug,canonicalTitle,posterImage', - 'manga' => 'slug,canonicalTitle,posterImage', - 'characters' => 'slug,canonicalName,image', - ], - 'include' => 'waifu,favorites.item,stats' - ] + return $this->requestBuilder->runQuery('UserDetails', [ + 'slug' => $username, ]); } diff --git a/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql index bb060bda..dd58d89f 100644 --- a/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql @@ -19,6 +19,7 @@ query ($slug: String!) { } birthday id + location name proMessage proTier @@ -29,6 +30,89 @@ query ($slug: String!) { url } } + favorites { + nodes { + id + item { + __typename, + ...on Anime { + id + slug + posterImage { + original { + url + height + width + } + views { + url + height + width + } + } + titles { + canonical + localized + } + } + ...on Manga { + id + slug + posterImage { + original { + url + height + width + } + views { + url + height + width + } + } + titles { + canonical + localized + } + } + ...on Person { + id + slug + image { + original { + url + } + views { + url + height + width + } + } + names { + alternatives + canonical + canonicalLocale + localized + }, + } + ...on Character { + id + slug + image { + original { + url + } + } + names { + alternatives + canonical + canonicalLocale + localized + }, + } + } + } + } stats { animeAmountConsumed { completed diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php index 40d9dec7..c2f022f7 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -38,6 +38,7 @@ final class AnimeTransformer extends AbstractTransformer { ? $item['data']['findAnimeBySlug'] : $item['data']['findAnimeById']; $characters = []; + $links = []; $staff = []; $genres = array_map(fn ($genre) => $genre['title']['en'], $base['categories']['nodes']); @@ -108,6 +109,11 @@ final class AnimeTransformer extends AbstractTransformer { ksort($staff); } + if (count($base['mappings']['nodes']) > 0) + { + $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.io/anime/{$base['slug']}"); + } + return AnimePage::from([ 'age_rating' => $base['ageRating'], 'age_rating_guide' => $base['ageRatingGuide'], @@ -116,12 +122,13 @@ final class AnimeTransformer extends AbstractTransformer { 'episode_count' => $base['episodeCount'], 'episode_length' => $base['episodeLength'], 'genres' => $genres, + 'links' => $links, 'id' => $base['id'], 'slug' => $base['slug'], 'staff' => $staff, 'show_type' => $base['subtype'], 'status' => Kitsu::getAiringStatus($base['startDate'], $base['endDate']), - 'streaming_links' => Kitsu::parseStreamingLinks($base['streamingLinks']['nodes']), + 'streaming_links' => Kitsu::parseStreamingLinks($base['streamingLinks']['nodes'] ?? []), 'synopsis' => $base['description']['en'], 'title' => $title, 'titles' => $titles, diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php index 77f2d3b1..d2e82af2 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php @@ -39,6 +39,7 @@ final class MangaTransformer extends AbstractTransformer { : $item['data']['findMangaById']; $characters = []; + $links = []; $staff = []; $genres = array_map(fn ($genre) => $genre['title']['en'], $base['categories']['nodes']); sort($genres); @@ -108,6 +109,11 @@ final class MangaTransformer extends AbstractTransformer { ksort($staff); } + if (count($base['mappings']['nodes']) > 0) + { + $links = Kitsu::mappingsToUrls($base['mappings']['nodes'], "https://kitsu.io/manga/{$base['slug']}"); + } + $data = [ 'age_rating' => $base['ageRating'], 'age_rating_guide' => $base['ageRatingGuide'], @@ -116,6 +122,7 @@ final class MangaTransformer extends AbstractTransformer { 'volume_count' => $base['volumeCount'], 'cover_image' => $base['posterImage']['views'][1]['url'], 'genres' => $genres, + 'links' => $links, 'manga_type' => $base['subtype'], 'id' => $base['id'], 'staff' => $staff, diff --git a/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php index d9df93f3..30fd38b0 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php @@ -16,9 +16,9 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; +use Aviat\AnimeClient\API\Kitsu; use function Aviat\AnimeClient\getLocalImg; -use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\Types\User; use Aviat\Ion\Transformer\AbstractTransformer; @@ -31,36 +31,24 @@ use Aviat\Ion\Transformer\AbstractTransformer; final class UserTransformer extends AbstractTransformer { public function transform($profileData): User { - $orgData = JsonAPI::organizeData($profileData)[0]; - $attributes = $orgData['attributes']; - - $rels = $orgData['relationships'] ?? []; - $favorites = array_key_exists('favorites', $rels) ? $rels['favorites'] : []; - - $stats = []; - foreach ($rels['stats'] as $sid => &$item) - { - $key = $item['attributes']['kind']; - $stats[$key] = $item['attributes']['statsData']; - unset($item); - } - unset($item); - - $waifu = (array_key_exists('waifu', $rels)) ? [ - 'label' => $attributes['waifuOrHusbando'], - 'character' => $rels['waifu']['attributes'], + $base = $profileData['data']['findProfileBySlug'] ?? []; + $favorites = $base['favorites']['nodes'] ?? []; + $stats = $base['stats'] ?? []; + $waifu = (array_key_exists('waifu', $base)) ? [ + 'label' => $base['waifuOrHusbando'], + 'character' => $base['waifu'], ] : []; return User::from([ - 'about' => $attributes['about'], - 'avatar' => getLocalImg($attributes['avatar']['original'], FALSE), + 'about' => $base['about'], + 'avatar' => getLocalImg($base['avatarImage']['original']['url'], FALSE), 'favorites' => $this->organizeFavorites($favorites), - 'location' => $attributes['location'], - 'name' => $attributes['name'], - 'slug' => $attributes['slug'], - 'stats' => $this->organizeStats($stats, $attributes), + 'location' => $base['location'], + 'name' => $base['name'], + 'slug' => $base['slug'], + 'stats' => $this->organizeStats($stats), 'waifu' => $waifu, - 'website' => $attributes['website'], + 'website' => $base['siteLinks']['nodes'][0]['url'], ]); } @@ -74,58 +62,10 @@ final class UserTransformer extends AbstractTransformer { { $output = []; - unset($rawFavorites['data']); - foreach ($rawFavorites as $item) { - $rank = $item['attributes']['favRank']; - foreach ($item['relationships']['item'] as $key => $fav) - { - $output[$key] = $output[$key] ?? []; - foreach ($fav as $id => $data) - { - $output[$key][$rank] = array_merge(['id' => $id], $data['attributes']); - } - - ksort($output[$key]); - } - } - - return $output; - } - - /** - * Format the time spent on anime in a more readable format - * - * @param int $seconds - * @return string - */ - private function formatAnimeTime(int $seconds): string - { - // All the seconds left - $remSeconds = $seconds % 60; - $minutes = ($seconds - $remSeconds) / 60; - - $minutesPerDay = 1440; - $minutesPerYear = $minutesPerDay * 365; - - // Minutes short of a year - $years = (int)floor($minutes / $minutesPerYear); - $minutes %= $minutesPerYear; - - // Minutes short of a day - $extraMinutes = $minutes % $minutesPerDay; - $days = ($minutes - $extraMinutes) / $minutesPerDay; - - // Minutes short of an hour - $remMinutes = $extraMinutes % 60; - $hours = ($extraMinutes - $remMinutes) / 60; - - $output = "{$days} days, {$hours} hours, {$remMinutes} minutes, and {$remSeconds} seconds."; - - if ($years > 0) - { - $output = "{$years} year(s),{$output}"; + $type = strtolower($item['item']['__typename']); + $output[$type][$item['id']] = $item['item']; } return $output; @@ -137,20 +77,20 @@ final class UserTransformer extends AbstractTransformer { $mangaStats = []; $otherStats = []; - if (array_key_exists('anime-amount-consumed', $stats)) + if (array_key_exists('animeAmountConsumed', $stats)) { $animeStats = [ - 'Time spent watching anime:' => $this->formatAnimeTime($stats['anime-amount-consumed']['time']), - 'Anime series watched:' => number_format($stats['anime-amount-consumed']['media']), - 'Anime episodes watched:' => number_format($stats['anime-amount-consumed']['units']), + 'Time spent watching anime:' => Kitsu::friendlyTime($stats['animeAmountConsumed']['time']), + 'Anime series watched:' => number_format($stats['animeAmountConsumed']['media']), + 'Anime episodes watched:' => number_format($stats['animeAmountConsumed']['units']), ]; } - if (array_key_exists('manga-amount-consumed', $stats)) + if (array_key_exists('mangaAmountConsumed', $stats)) { $mangaStats = [ - 'Manga series read:' => number_format($stats['manga-amount-consumed']['media']), - 'Manga chapters read:' => number_format($stats['manga-amount-consumed']['units']), + 'Manga series read:' => number_format($stats['mangaAmountConsumed']['media']), + 'Manga chapters read:' => number_format($stats['mangaAmountConsumed']['units']), ]; } diff --git a/src/AnimeClient/Types/AnimePage.php b/src/AnimeClient/Types/AnimePage.php index 9c270a14..1924925d 100644 --- a/src/AnimeClient/Types/AnimePage.php +++ b/src/AnimeClient/Types/AnimePage.php @@ -25,6 +25,11 @@ final class AnimePage extends Anime { */ public array $characters = []; + /** + * @var array + */ + public array $links = []; + /** * @var array */ diff --git a/src/AnimeClient/Types/MangaPage.php b/src/AnimeClient/Types/MangaPage.php index 57c49297..f5ccce5c 100644 --- a/src/AnimeClient/Types/MangaPage.php +++ b/src/AnimeClient/Types/MangaPage.php @@ -52,6 +52,11 @@ final class MangaPage extends AbstractType { */ public array $genres; + /** + * @var array + */ + public array $links; + /** * @var string */ From 3f8c0432d25f6e29c1afc6c03d18f7d103a89452 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 24 Aug 2020 19:17:41 -0400 Subject: [PATCH 47/86] Update History to use GraphQL, resolves #29,#30 --- src/AnimeClient/API/Kitsu/AnimeTrait.php | 5 +- src/AnimeClient/API/Kitsu/MangaTrait.php | 5 +- src/AnimeClient/API/Kitsu/Model.php | 61 +------------------ .../API/Kitsu/Queries/GetUserHistory.graphql | 35 +++++++++++ .../Kitsu/Transformer/HistoryTransformer.php | 55 ++++++++--------- 5 files changed, 64 insertions(+), 97 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index 22ee319b..c5d26512 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -102,10 +102,7 @@ trait AnimeTrait { { $raw = $this->getRawHistoryList('anime'); - $organized = JsonAPI::organizeData($raw); - $organized = array_filter($organized, fn ($item) => array_key_exists('relationships', $item)); - - $list = (new AnimeHistoryTransformer())->transform($organized); + $list = (new AnimeHistoryTransformer())->transform($raw); $this->cache->set($key, $list); diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index cd3a938b..6f11ec09 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -97,10 +97,7 @@ trait MangaTrait { if ($list === NULL) { $raw = $this->getRawHistoryList('manga'); - $organized = JsonAPI::organizeData($raw); - $organized = array_filter($organized, fn ($item) => array_key_exists('relationships', $item)); - - $list = (new MangaHistoryTransformer())->transform($organized); + $list = (new MangaHistoryTransformer())->transform($raw); $this->cache->set($key, $list); } diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index ff210c41..b894bf0a 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -355,67 +355,12 @@ final class Model { /** * Get the aggregated pages of anime or manga history * - * @param string $type - * @param int $entries * @return array - * @throws InvalidArgumentException - * @throws Throwable */ - protected function getRawHistoryList(string $type = 'anime', int $entries = 120): array + protected function getRawHistoryList(): array { - $size = 20; - $pages = ceil($entries / $size); - - $requester = new ParallelAPIRequest(); - - // Set up requests - for ($i = 0; $i < $pages; $i++) - { - $offset = $i * $size; - $requester->addRequest($this->getRawHistoryPage($type, $offset, $size)); - } - - $responses = $requester->makeRequests(); - $output = []; - - foreach($responses as $response) - { - $data = Json::decode($response); - $output[] = $data; - } - - return array_merge_recursive(...$output); - } - - /** - * Retrieve one page of the anime or manga history - * - * @param string $type - * @param int $offset - * @param int $limit - * @return Request - * @throws InvalidArgumentException - */ - protected function getRawHistoryPage(string $type, int $offset, int $limit = 20): Request - { - return $this->requestBuilder->setUpRequest('GET', 'library-events', [ - 'query' => [ - 'filter' => [ - 'kind' => 'progressed,updated', - 'userId' => $this->getUserId(), - ], - 'page' => [ - 'offset' => $offset, - 'limit' => $limit, - ], - 'fields' => [ - 'anime' => 'canonicalTitle,titles,slug,posterImage', - 'manga' => 'canonicalTitle,titles,slug,posterImage', - 'libraryEntry' => 'reconsuming,reconsumeCount', - ], - 'sort' => '-updated_at', - 'include' => 'anime,manga,libraryEntry', - ], + return $this->requestBuilder->runQuery('GetUserHistory', [ + 'slug' => $this->getUsername(), ]); } diff --git a/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql b/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql new file mode 100644 index 00000000..66530029 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql @@ -0,0 +1,35 @@ +query ($slug: String!) { + findProfileBySlug(slug: $slug) { + libraryEvents { + nodes { + id + changedData + kind + libraryEntry { + reconsumeCount + reconsuming + private + notes + } + media { + __typename + id + slug + posterImage { + views { + width + height + url + } + } + titles { + alternatives + canonical + localized + } + } + updatedAt + } + } + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php index 74810a22..1bad7db2 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/HistoryTransformer.php @@ -60,18 +60,25 @@ abstract class HistoryTransformer { */ public function transform(array $data): array { + $base = $data['data']['findProfileBySlug']['libraryEvents']['nodes'] ?? []; $output = []; - foreach ($data as $entry) + foreach ($base as $entry) { - if ( ! isset($entry['relationships'][$this->type])) + if ( ! (strtolower($entry['media']['__typename']) === $this->type)) { continue; } - $kind = $entry['attributes']['kind']; + // Hide private library entries + if ($entry['libraryEntry']['private'] === true) + { + continue; + } - if ($kind === 'progressed' && ! empty($entry['attributes']['changedData']['progress'])) + $kind = strtolower($entry['kind']); + + if ($kind === 'progressed' && ! empty($entry['changedData']['progress'])) { $transformed = $this->transformProgress($entry); if ($transformed !== NULL) @@ -130,7 +137,7 @@ abstract class HistoryTransformer { foreach ($entries as $e) { - $progressItem = $e['original']['attributes']['changedData']['progress']; + $progressItem = $e['original']['changedData']['progress']; $items[] = array_pop($progressItem); $updated[] = $e['updated']; } @@ -176,11 +183,11 @@ abstract class HistoryTransformer { protected function transformProgress (array $entry): ?HistoryItem { - $id = array_keys($entry['relationships'][$this->type])[0]; - $data = $entry['relationships'][$this->type][$id]['attributes']; + $id = $entry['media']['id']; + $data = $entry['media']; $title = $this->linkTitle($data); $imgUrl = "images/{$this->type}/{$id}.webp"; - $item = end($entry['attributes']['changedData']['progress']); + $item = end($entry['changedData']['progress']); // No showing episode 0 nonsense if (((int)$item) === 0) @@ -198,23 +205,23 @@ abstract class HistoryTransformer { 'kind' => 'progressed', 'original' => $entry, 'title' => $title, - 'updated' => $this->parseDate($entry['attributes']['updatedAt']), + 'updated' => $this->parseDate($entry['updatedAt']), 'url' => $this->getUrl($data), ]); } protected function transformUpdated($entry): HistoryItem { - $id = array_keys($entry['relationships'][$this->type])[0]; - $data = $entry['relationships'][$this->type][$id]['attributes']; + $id = $entry['media']['id']; + $data = $entry['media']; $title = $this->linkTitle($data); $imgUrl = "images/{$this->type}/{$id}.webp"; - $kind = array_key_first($entry['attributes']['changedData']); + $kind = array_key_first($entry['changedData']); if ($kind === 'status') { - $status = array_pop($entry['attributes']['changedData']['status']); + $status = array_pop($entry['changedData']['status']); $statusName = $this->statusMap[$status]; if ($this->isReconsuming($entry)) @@ -230,7 +237,7 @@ abstract class HistoryTransformer { 'kind' => 'updated', 'original' => $entry, 'title' => $title, - 'updated' => $this->parseDate($entry['attributes']['updatedAt']), + 'updated' => $this->parseDate($entry['updatedAt']), 'url' => $this->getUrl($data), ]); } @@ -240,13 +247,13 @@ abstract class HistoryTransformer { protected function linkTitle (array $data): string { - return $data['canonicalTitle']; + return $data['titles']['canonical']; } protected function parseDate (string $date): DateTimeImmutable { $dateTime = DateTimeImmutable::createFromFormat( - DateTimeInterface::RFC3339_EXTENDED, + DateTimeInterface::RFC3339, $date ); @@ -260,20 +267,6 @@ abstract class HistoryTransformer { protected function isReconsuming ($entry): bool { - $le = $this->getLibraryEntry($entry); - return $le['reconsuming']; - } - - private function getLibraryEntry ($entry): ?array - { - if ( ! isset($entry['relationships']['libraryEntry']['libraryEntries'])) - { - return NULL; - } - - $libraryEntries = $entry['relationships']['libraryEntry']['libraryEntries']; - $id = array_keys($libraryEntries)[0]; - - return $libraryEntries[$id]['attributes']; + return $entry['libraryEntry']['reconsuming']; } } \ No newline at end of file From 980e2726c5e8cd9d69cc8e17ac22e8dab4f9f4ba Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 25 Aug 2020 13:22:38 -0400 Subject: [PATCH 48/86] Start of pulling library from GraphQL --- src/AnimeClient/API/Kitsu/Model.php | 23 ++--- .../API/Kitsu/Queries/GetLibraryAll.graphql | 86 +++++++++++++++++++ .../API/Kitsu/Queries/GetLibraryCount.graphql | 9 ++ 3 files changed, 102 insertions(+), 16 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Queries/GetLibraryAll.graphql create mode 100644 src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index b894bf0a..76fdce86 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -390,27 +390,18 @@ final class Model { private function getListCount(string $type, string $status = ''): int { - $options = [ - 'query' => [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => $type, - ], - 'page' => [ - 'limit' => 1 - ], - 'sort' => '-updated_at' - ] + $args = [ + 'type' => strtoupper($type), + 'slug' => $this->getUsername() ]; - - if ( ! empty($status)) + if ($status !== '') { - $options['query']['filter']['status'] = $status; + $args['status'] = strtoupper($status); } - $response = $this->requestBuilder->getRequest('library-entries', $options); + $res = $this->requestBuilder->runQuery('GetLibraryCount', $args); - return $response['meta']['count']; + return $res['data']['findProfileBySlug']['library']['all']['totalCount']; } /** diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryAll.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibraryAll.graphql new file mode 100644 index 00000000..42507336 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibraryAll.graphql @@ -0,0 +1,86 @@ +query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { + findProfileBySlug(slug: $slug) { + library { + all(mediaType: $type, status: $status) { +# pageInfo { +# endCursor +# hasNextPage +# hasPreviousPage +# startCursor +# } + totalCount + nodes { + id + notes + nsfw + private + progress + progressedAt + rating + reconsumeCount + reconsuming + status + media { + id + ageRating + ageRatingGuide + categories { + nodes { + title + } + } + mappings { + nodes { + externalId + externalSite + } + } + posterImage { + original { + height + name + url + width + } + views { + height + name + url + width + } + } + sfw + slug + status + type + titles { + canonical + localized + alternatives + } + ...on Anime { + episodeCount + streamingLinks { + nodes { + dubs + subs + regions + streamer { + id + siteName + } + url + } + } + subtype + } + ...on Manga { + chapterCount + subtype + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql new file mode 100644 index 00000000..e3c6ceaa --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql @@ -0,0 +1,9 @@ +query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { + findProfileBySlug(slug: $slug) { + library { + all(mediaType: $type, status: $status) { + totalCount + } + } + } +} \ No newline at end of file From 69991a126a3da1d42a04324e020df2100d641243 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 25 Aug 2020 15:11:08 -0400 Subject: [PATCH 49/86] Misc fixes and tweaks --- CHANGELOG.md | 4 ++++ app/views/header.php | 2 +- app/views/person/details.php | 2 +- src/AnimeClient/API/Kitsu.php | 6 +++--- .../Queries/{GetLibraryAll.graphql => GetLibrary.graphql} | 0 5 files changed, 9 insertions(+), 5 deletions(-) rename src/AnimeClient/API/Kitsu/Queries/{GetLibraryAll.graphql => GetLibrary.graphql} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d602057..95e39fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 5.1 +* Added session check, so when coming back to a page, if the session is expired, the page will refresh. +* Updated logging config so that much fewer, much smaller files are generated. + ## Version 5 * Updated PHP requirement to 7.4 * Added anime watching history view diff --git a/app/views/header.php b/app/views/header.php index 16fc6d55..930bba74 100644 --- a/app/views/header.php +++ b/app/views/header.php @@ -26,7 +26,7 @@ -
+
character( $item['character']['canonicalName'], $url->generate('character', ['slug' => $item['character']['slug']]), - $helper->picture(getLocalImg($item['character']['image']['original'])) + $helper->picture(getLocalImg($item['character']['image']['original'] ?? null)) ); $medias = []; foreach ($item['media'] as $sid => $series) diff --git a/src/AnimeClient/API/Kitsu.php b/src/AnimeClient/API/Kitsu.php index 8b21bd90..08ecf1e8 100644 --- a/src/AnimeClient/API/Kitsu.php +++ b/src/AnimeClient/API/Kitsu.php @@ -119,7 +119,7 @@ final class Kitsu { break; default: - continue 2; + // Do Nothing } } @@ -328,7 +328,7 @@ final class Kitsu { } } - // Don't return the canonical titles + // Don't return the canonical title array_shift($valid); return $valid; @@ -356,7 +356,7 @@ final class Kitsu { } } - // Don't return the canonical titles + // Don't return the canonical title array_shift($valid); return $valid; diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryAll.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql similarity index 100% rename from src/AnimeClient/API/Kitsu/Queries/GetLibraryAll.graphql rename to src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql From 08176be4d0045b2ee47ac9b274bb29c106399aa0 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 25 Aug 2020 16:02:15 -0400 Subject: [PATCH 50/86] Abort previous requests when search for anime or manga --- frontEndSrc/js/anime-client.js | 5 ++++- frontEndSrc/js/anime.js | 10 ++++++++-- frontEndSrc/js/manga.js | 10 ++++++++-- public/js/anon.min.js | 2 +- public/js/anon.min.js.map | 2 +- public/js/scripts.min.js | 18 +++++++++--------- public/js/scripts.min.js.map | 2 +- 7 files changed, 32 insertions(+), 17 deletions(-) diff --git a/frontEndSrc/js/anime-client.js b/frontEndSrc/js/anime-client.js index 04869dba..da05b7c5 100644 --- a/frontEndSrc/js/anime-client.js +++ b/frontEndSrc/js/anime-client.js @@ -261,7 +261,7 @@ function ajaxSerialize(data) { * * @param {string} url - the url to request * @param {Object} config - the configuration object - * @return {void} + * @return {XMLHttpRequest} */ AnimeClient.ajax = (url, config) => { // Set some sane defaults @@ -322,6 +322,8 @@ AnimeClient.ajax = (url, config) => { } else { request.send(config.data); } + + return request }; /** @@ -330,6 +332,7 @@ AnimeClient.ajax = (url, config) => { * @param {string} url * @param {object|function} data * @param {function} [callback] + * @return {XMLHttpRequest} */ AnimeClient.get = (url, data, callback = null) => { if (callback === null) { diff --git a/frontEndSrc/js/anime.js b/frontEndSrc/js/anime.js index 4ae2af36..85aad368 100644 --- a/frontEndSrc/js/anime.js +++ b/frontEndSrc/js/anime.js @@ -6,7 +6,7 @@ const search = (query) => { _.show('.cssload-loader'); // Do the api search - _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => { + return _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); // Hide the loader @@ -18,13 +18,19 @@ const search = (query) => { }; if (_.hasElement('.anime #search')) { + let prevRequest = null; + _.on('#search', 'input', _.throttle(250, (e) => { const query = encodeURIComponent(e.target.value); if (query === '') { return; } - search(query); + if (prevRequest !== null) { + prevRequest.abort(); + } + + prevRequest = search(query); })); } diff --git a/frontEndSrc/js/manga.js b/frontEndSrc/js/manga.js index 6af89f93..54cbf51d 100644 --- a/frontEndSrc/js/manga.js +++ b/frontEndSrc/js/manga.js @@ -3,7 +3,7 @@ import { renderMangaSearchResults } from './template-helpers.js' const search = (query) => { _.show('.cssload-loader'); - _.get(_.url('/manga/search'), { query }, (searchResults, status) => { + return _.get(_.url('/manga/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); _.hide('.cssload-loader'); _.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data); @@ -11,13 +11,19 @@ const search = (query) => { }; if (_.hasElement('.manga #search')) { + let prevRequest = null + _.on('#search', 'input', _.throttle(250, (e) => { let query = encodeURIComponent(e.target.value); if (query === '') { return; } - search(query); + if (prevRequest !== null) { + prevRequest.abort(); + } + + prevRequest = search(query); })); } diff --git a/public/js/anon.min.js b/public/js/anon.min.js index 132eda24..2cb4064d 100644 --- a/public/js/anon.min.js +++ b/public/js/anon.min.js @@ -6,7 +6,7 @@ undefined)return current.closest(parentSelector);while(current!==document.docume element){listener.call(element,e);e.stopPropagation()}})})}AnimeClient.on=function(sel,event,target,listener){if(listener===undefined){listener=target;AnimeClient.$(sel).forEach(function(el){addEvent(el,event,listener)})}else AnimeClient.$(sel).forEach(function(el){delegateEvent(el,target,event,listener)})};function ajaxSerialize(data){var pairs=[];Object.keys(data).forEach(function(name){var value=data[name].toString();name=encodeURIComponent(name);value=encodeURIComponent(value);pairs.push(name+ "="+value)});return pairs.join("&")}AnimeClient.ajax=function(url,config){var defaultConfig={data:{},type:"GET",dataType:"",success:AnimeClient.noop,mimeType:"application/x-www-form-urlencoded",error:AnimeClient.noop};config=Object.assign({},defaultConfig,config);var request=new XMLHttpRequest;var method=String(config.type).toUpperCase();if(method==="GET")url+=url.match(/\?/)?ajaxSerialize(config.data):"?"+ajaxSerialize(config.data);request.open(method,url);request.onreadystatechange=function(){if(request.readyState=== 4){var responseText="";if(request.responseType==="json")responseText=JSON.parse(request.responseText);else responseText=request.responseText;if(request.status>299)config.error.call(null,request.status,responseText,request.response);else config.success.call(null,responseText,request.status)}};if(config.dataType==="json"){config.data=JSON.stringify(config.data);config.mimeType="application/json"}else config.data=ajaxSerialize(config.data);request.setRequestHeader("Content-Type",config.mimeType);if(method=== -"GET")request.send(null);else request.send(config.data)};AnimeClient.get=function(url,data,callback){callback=callback===undefined?null:callback;if(callback===null){callback=data;data={}}return AnimeClient.ajax(url,{data:data,success:callback})};AnimeClient.on("header","click",".message",hide);AnimeClient.on("form.js-delete","submit",confirmDelete);AnimeClient.on(".js-clear-cache","click",clearAPICache);AnimeClient.on(".vertical-tabs input","change",scrollToSection);AnimeClient.on(".media-filter", +"GET")request.send(null);else request.send(config.data);return request};AnimeClient.get=function(url,data,callback){callback=callback===undefined?null:callback;if(callback===null){callback=data;data={}}return AnimeClient.ajax(url,{data:data,success:callback})};AnimeClient.on("header","click",".message",hide);AnimeClient.on("form.js-delete","submit",confirmDelete);AnimeClient.on(".js-clear-cache","click",clearAPICache);AnimeClient.on(".vertical-tabs input","change",scrollToSection);AnimeClient.on(".media-filter", "input",filterMedia);function hide(event){AnimeClient.hide(event.target)}function confirmDelete(event){var proceed=confirm("Are you ABSOLUTELY SURE you want to delete this item?");if(proceed===false){event.preventDefault();event.stopPropagation()}}function clearAPICache(){AnimeClient.get("/cache_purge",function(){AnimeClient.showMessage("success","Successfully purged api cache")})}function scrollToSection(event){var el=event.currentTarget.parentElement;var rect=el.getBoundingClientRect();var top= rect.top+window.pageYOffset;window.scrollTo({top:top,behavior:"smooth"})}function filterMedia(event){var rawFilter=event.target.value;var filter=new RegExp(rawFilter,"i");if(rawFilter!==""){AnimeClient.$("article.media").forEach(function(article){var titleLink=AnimeClient.$(".name a",article)[0];var title=String(titleLink.textContent).trim();if(!filter.test(title))AnimeClient.hide(article);else AnimeClient.show(article)});AnimeClient.$("table.media-wrap tbody tr").forEach(function(tr){var titleCell= AnimeClient.$("td.align-left",tr)[0];var titleLink=AnimeClient.$("a",titleCell)[0];var linkTitle=String(titleLink.textContent).trim();var textTitle=String(titleCell.textContent).trim();if(!(filter.test(linkTitle)||filter.test(textTitle)))AnimeClient.hide(tr);else AnimeClient.show(tr)})}else{AnimeClient.show("article.media");AnimeClient.show("table.media-wrap tbody tr")}}(function(){var hidden=null;var visibilityChange=null;if(typeof document.hidden!=="undefined"){hidden="hidden";visibilityChange= diff --git a/public/js/anon.min.js.map b/public/js/anon.min.js.map index 80a528d7..1f7188a7 100644 --- a/public/js/anon.min.js.map +++ b/public/js/anon.min.js.map @@ -1 +1 @@ -{"version":3,"file":"anon.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {void}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Other event setup\n// ----------------------------------------------------------------------------\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","reload","console","info","navigator","serviceWorker","register","then","reg","log","catch"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,IAAV,CAAAA,OACX,IAAI,MAAOZ,SAAX,GAAwB,QAAxB,CACC,MAAOA,SAGRY,QAAA,CAAWA,OAAD,GAAa,IAAb,EAAqBA,OAAAC,SAArB,GAA0C,CAA1C,CACPD,OADO,CAEPR,QAEH,KAAIU,SAAW,EACf,IAAId,QAAAe,MAAA,CAAe,YAAf,CAAJ,CACCD,QAAAE,KAAA,CAAcZ,QAAAa,eAAA,CAAwBjB,QAAAkB,MAAA,CAAe,GAAf,CAAA,CAAoB,CAApB,CAAxB,CAAd,CADD;IAGCJ,SAAA,CAAW,EAAAK,MAAAC,MAAA,CAAeR,OA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IAEvB,IAAI,MAAOnI,SAAAkI,OAAX,GAA+B,WAA/B,CAA4C,CAC3CA,MAAA,CAAS,QACTC,iBAAA;AAAmB,kBAFwB,CAA5C,IAGO,IAAI,MAAOnI,SAAAoI,SAAX,GAAiC,WAAjC,CAA8C,CACpDF,MAAA,CAAS,UACTC,iBAAA,CAAmB,oBAFiC,CAA9C,IAGA,IAAI,MAAOnI,SAAAqI,aAAX,GAAqC,WAArC,CAAkD,CACxDH,MAAA,CAAS,cACTC,iBAAA,CAAmB,wBAFqC,CAKzDG,QAASA,uBAAsB,EAAG,CAGjC,GAAK,CAAEtI,QAAA,CAASkI,MAAT,CAAP,CACChB,WAAAA,IAAAA,CAAM,YAANA,CAAoB,QAAA,CAACqB,IAAD,CAAU,CAC7B,2BAIA,IAAIjC,MAAAkC,QAAJ,GAAuB,IAAvB,CACCxF,QAAAyF,OAAA,EAN4B,CAA9BvB,CAJgC,CAgBlC,GAAIgB,MAAJ,GAAe,IAAf,CACCQ,OAAAC,KAAA,CAAa,mEAAb,CADD;IAGC3I,SAAA8D,iBAAA,CAA0BqE,gBAA1B,CAA4CG,sBAA5C,CAAoE,KAApE,CAnCK,CAAN,CAAD,EChHA,IAAI,eAAJ,EAAuBM,UAAvB,CACCA,SAAAC,cAAAC,SAAA,CAAiC,QAAjC,CAAAC,KAAA,CAAgD,QAAA,CAAAC,GAAA,CAAO,CACtDN,OAAAO,IAAA,CAAY,2BAAZ,CAAyCD,GAAA1F,MAAzC,CADsD,CAAvD,CAAA4F,CAEG,OAFHA,CAAA,CAES,QAAA,CAAA3D,KAAA,CAAS,CACjBmD,OAAAnD,MAAA,CAAc,mCAAd,CAAmDA,KAAnD,CADiB,CAFlB;"} \ No newline at end of file +{"version":3,"file":"anon.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Other event setup\n// ----------------------------------------------------------------------------\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","reload","console","info","navigator","serviceWorker","register","then","reg","log","catch"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CA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,SAAA8D,iBAAA,CAA0BqE,gBAA1B,CAA4CG,sBAA5C,CAAoE,KAApE,CAnCK,CAAN,CAAD,EChHA,IAAI,eAAJ,EAAuBM,UAAvB,CACCA,SAAAC,cAAAC,SAAA,CAAiC,QAAjC,CAAAC,KAAA,CAAgD,QAAA,CAAAC,GAAA,CAAO,CACtDN,OAAAO,IAAA,CAAY,2BAAZ,CAAyCD,GAAA1F,MAAzC,CADsD,CAAvD,CAAA4F,CAEG,OAFHA,CAAA,CAES,QAAA,CAAA3D,KAAA,CAAS,CACjBmD,OAAAnD,MAAA,CAAc,mCAAd,CAAmDA,KAAnD,CADiB,CAFlB;"} \ No newline at end of file diff --git a/public/js/scripts.min.js b/public/js/scripts.min.js index 4146a1dd..f2316f8e 100644 --- a/public/js/scripts.min.js +++ b/public/js/scripts.min.js @@ -6,7 +6,7 @@ undefined)return current.closest(parentSelector);while(current!==document.docume element){listener.call(element,e);e.stopPropagation()}})})}AnimeClient.on=function(sel,event,target,listener){if(listener===undefined){listener=target;AnimeClient.$(sel).forEach(function(el){addEvent(el,event,listener)})}else AnimeClient.$(sel).forEach(function(el){delegateEvent(el,target,event,listener)})};function ajaxSerialize(data){var pairs=[];Object.keys(data).forEach(function(name){var value=data[name].toString();name=encodeURIComponent(name);value=encodeURIComponent(value);pairs.push(name+ "="+value)});return pairs.join("&")}AnimeClient.ajax=function(url,config){var defaultConfig={data:{},type:"GET",dataType:"",success:AnimeClient.noop,mimeType:"application/x-www-form-urlencoded",error:AnimeClient.noop};config=Object.assign({},defaultConfig,config);var request=new XMLHttpRequest;var method=String(config.type).toUpperCase();if(method==="GET")url+=url.match(/\?/)?ajaxSerialize(config.data):"?"+ajaxSerialize(config.data);request.open(method,url);request.onreadystatechange=function(){if(request.readyState=== 4){var responseText="";if(request.responseType==="json")responseText=JSON.parse(request.responseText);else responseText=request.responseText;if(request.status>299)config.error.call(null,request.status,responseText,request.response);else config.success.call(null,responseText,request.status)}};if(config.dataType==="json"){config.data=JSON.stringify(config.data);config.mimeType="application/json"}else config.data=ajaxSerialize(config.data);request.setRequestHeader("Content-Type",config.mimeType);if(method=== -"GET")request.send(null);else request.send(config.data)};AnimeClient.get=function(url,data,callback){callback=callback===undefined?null:callback;if(callback===null){callback=data;data={}}return AnimeClient.ajax(url,{data:data,success:callback})};AnimeClient.on("header","click",".message",hide);AnimeClient.on("form.js-delete","submit",confirmDelete);AnimeClient.on(".js-clear-cache","click",clearAPICache);AnimeClient.on(".vertical-tabs input","change",scrollToSection);AnimeClient.on(".media-filter", +"GET")request.send(null);else request.send(config.data);return request};AnimeClient.get=function(url,data,callback){callback=callback===undefined?null:callback;if(callback===null){callback=data;data={}}return AnimeClient.ajax(url,{data:data,success:callback})};AnimeClient.on("header","click",".message",hide);AnimeClient.on("form.js-delete","submit",confirmDelete);AnimeClient.on(".js-clear-cache","click",clearAPICache);AnimeClient.on(".vertical-tabs input","change",scrollToSection);AnimeClient.on(".media-filter", "input",filterMedia);function hide(event){AnimeClient.hide(event.target)}function confirmDelete(event){var proceed=confirm("Are you ABSOLUTELY SURE you want to delete this item?");if(proceed===false){event.preventDefault();event.stopPropagation()}}function clearAPICache(){AnimeClient.get("/cache_purge",function(){AnimeClient.showMessage("success","Successfully purged api cache")})}function scrollToSection(event){var el=event.currentTarget.parentElement;var rect=el.getBoundingClientRect();var top= rect.top+window.pageYOffset;window.scrollTo({top:top,behavior:"smooth"})}function filterMedia(event){var rawFilter=event.target.value;var filter=new RegExp(rawFilter,"i");if(rawFilter!==""){AnimeClient.$("article.media").forEach(function(article){var titleLink=AnimeClient.$(".name a",article)[0];var title=String(titleLink.textContent).trim();if(!filter.test(title))AnimeClient.hide(article);else AnimeClient.show(article)});AnimeClient.$("table.media-wrap tbody tr").forEach(function(tr){var titleCell= AnimeClient.$("td.align-left",tr)[0];var titleLink=AnimeClient.$("a",titleCell)[0];var linkTitle=String(titleLink.textContent).trim();var textTitle=String(titleCell.textContent).trim();if(!(filter.test(linkTitle)||filter.test(textTitle)))AnimeClient.hide(tr);else AnimeClient.show(tr)})}else{AnimeClient.show("article.media");AnimeClient.show("table.media-wrap tbody tr")}}(function(){var hidden=null;var visibilityChange=null;if(typeof document.hidden!=="undefined"){hidden="hidden";visibilityChange= @@ -16,12 +16,12 @@ x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'+item.canonicalTitle+"
\n\t\t\t\t\t\t\t"+titles+'\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t')}); return results.join("")}function renderMangaSearchResults(data){var results=[];data.forEach(function(x){var item=x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search"))AnimeClient.on("#search", -"input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;search(query)}));AnimeClient.on("body.anime.list","click",".plus-one",function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId, -mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&&watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+ -". ");AnimeClient.scrollToTop();return}if(resData.data.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader"); -AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search"))AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;search$1(query)}));AnimeClient.on(".manga.list","click",".edit-buttons button", -function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId, -data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="current";if(!isNaN(completed)&&completed+1===total)data.data.status="completed";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(data.data.status==="completed")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent= -completed;AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() +item.slug+'">Info Page\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search")){var prevRequest= +null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search(query)}))}AnimeClient.on("body.anime.list","click",".plus-one",function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent, +10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&&watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow"); +AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})}); +var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value); +if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName= +AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="current";if(!isNaN(completed)&&completed+1===total)data.data.status="completed";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(data.data.status=== +"completed")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed;AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() //# sourceMappingURL=scripts.min.js.map diff --git a/public/js/scripts.min.js.map b/public/js/scripts.min.js.map index 2b2472fd..ca06159e 100644 --- a/public/js/scripts.min.js.map +++ b/public/js/scripts.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {void}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Other event setup\n// ----------------------------------------------------------------------------\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\t_.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tsearch(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\t_.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tsearch(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (data.data.status === 'completed') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","reload","console","info","navigator","serviceWorker","register","then","reg","log","catch","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,IAAV,CAAAA,OACX,IAAI,MAAOZ,SAAX,GAAwB,QAAxB,CACC,MAAOA,SAGRY,QAAA,CAAWA,OAAD,GAAa,IAAb,EAAqBA,OAAAC,SAArB,GAA0C,CAA1C,CACPD,OADO,CAEPR,QAEH,KAAIU,SAAW,EACf,IAAId,QAAAe,MAAA,CAAe,YAAf,CAAJ,CACCD,QAAAE,KAAA,CAAcZ,Q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kC,CAAlCA,CAAAA,YAAAA;AAAoD6D,SACpD7D,YAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA,CAAiD+D,SAAjD/D,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA,YAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2C+D,SAA3C/D,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file +{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Other event setup\n// ----------------------------------------------------------------------------\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (data.data.status === 'completed') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","reload","console","info","navigator","serviceWorker","register","then","reg","log","catch","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc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AAMO,SAAN,CAAJ,EAAwBA,SAAxB,GAAsC,CAAtC,CACCzG,IAAAA,KAAA8B,OAAA,CAAmB,SAIpB,IAAK,CAACoE,KAAA,CAAMO,SAAN,CAAN,EAA4BA,SAA5B,CAAwC,CAAxC,GAA+CC,KAA/C,CACC1G,IAAAA,KAAA8B,OAAA,CAAmB,WAIpB9B,KAAAA,KAAAiG,SAAA,CAAqB,EAAEQ,SAEvB/D,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,KAAAA,CAAOA,WAAAA,IAAAA,CAAM,kBAANA,CAAPA,CAAkC,CACjC1C,KAAAA,IADiC,CAEjCY,SAAU,MAFuB,CAGjCrD,KAAM,MAH2B,CAIjCuD,SAAU,kBAJuB,CAKjCD,QAASA,QAAA,EAAM,CACd,GAAIb,IAAAA,KAAA8B,OAAJ;AAAyB,WAAzB,CACCY,WAAAA,KAAAA,CAAOgD,SAAPhD,CAGDA,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,EAAAA,CAAI,GAAJA,CAAQnF,IAARmF,CAAI,QAAJA,CAAsBgD,SAAtBhD,CAAAA,CAAkC,CAAlCA,CAAAA,YAAAA,CAAoD+D,SACpD/D,YAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA,CAAiDiE,SAAjDjE,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA,YAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CiE,SAA3CjE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file From e20601053cfa69c0118a2fc2e1abe828c1ec0404 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 25 Aug 2020 16:06:00 -0400 Subject: [PATCH 51/86] Missing pieces of previous commit --- public/es/anon.js | 5 ++++- public/es/scripts.js | 25 ++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/public/es/anon.js b/public/es/anon.js index 12a6db00..4e6ae6f5 100644 --- a/public/es/anon.js +++ b/public/es/anon.js @@ -260,7 +260,7 @@ function ajaxSerialize(data) { * * @param {string} url - the url to request * @param {Object} config - the configuration object - * @return {void} + * @return {XMLHttpRequest} */ AnimeClient.ajax = (url, config) => { // Set some sane defaults @@ -321,6 +321,8 @@ AnimeClient.ajax = (url, config) => { } else { request.send(config.data); } + + return request }; /** @@ -329,6 +331,7 @@ AnimeClient.ajax = (url, config) => { * @param {string} url * @param {object|function} data * @param {function} [callback] + * @return {XMLHttpRequest} */ AnimeClient.get = (url, data, callback = null) => { if (callback === null) { diff --git a/public/es/scripts.js b/public/es/scripts.js index 56e000ff..96ea1f5f 100644 --- a/public/es/scripts.js +++ b/public/es/scripts.js @@ -260,7 +260,7 @@ function ajaxSerialize(data) { * * @param {string} url - the url to request * @param {Object} config - the configuration object - * @return {void} + * @return {XMLHttpRequest} */ AnimeClient.ajax = (url, config) => { // Set some sane defaults @@ -321,6 +321,8 @@ AnimeClient.ajax = (url, config) => { } else { request.send(config.data); } + + return request }; /** @@ -329,6 +331,7 @@ AnimeClient.ajax = (url, config) => { * @param {string} url * @param {object|function} data * @param {function} [callback] + * @return {XMLHttpRequest} */ AnimeClient.get = (url, data, callback = null) => { if (callback === null) { @@ -589,7 +592,7 @@ const search = (query) => { AnimeClient.show('.cssload-loader'); // Do the api search - AnimeClient.get(AnimeClient.url('/anime-collection/search'), { query }, (searchResults, status) => { + return AnimeClient.get(AnimeClient.url('/anime-collection/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); // Hide the loader @@ -601,13 +604,19 @@ const search = (query) => { }; if (AnimeClient.hasElement('.anime #search')) { + let prevRequest = null; + AnimeClient.on('#search', 'input', AnimeClient.throttle(250, (e) => { const query = encodeURIComponent(e.target.value); if (query === '') { return; } - search(query); + if (prevRequest !== null) { + prevRequest.abort(); + } + + prevRequest = search(query); })); } @@ -675,7 +684,7 @@ AnimeClient.on('body.anime.list', 'click', '.plus-one', (e) => { const search$1 = (query) => { AnimeClient.show('.cssload-loader'); - AnimeClient.get(AnimeClient.url('/manga/search'), { query }, (searchResults, status) => { + return AnimeClient.get(AnimeClient.url('/manga/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); AnimeClient.hide('.cssload-loader'); AnimeClient.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data); @@ -683,13 +692,19 @@ const search$1 = (query) => { }; if (AnimeClient.hasElement('.manga #search')) { + let prevRequest = null; + AnimeClient.on('#search', 'input', AnimeClient.throttle(250, (e) => { let query = encodeURIComponent(e.target.value); if (query === '') { return; } - search$1(query); + if (prevRequest !== null) { + prevRequest.abort(); + } + + prevRequest = search$1(query); })); } From aace368b241bed2e91416cf9ea18abb02f4e9228 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 26 Aug 2020 15:22:14 -0400 Subject: [PATCH 52/86] Move Kitsu class out of API namespace --- app/views/anime/details.php | 2 +- app/views/anime/list.php | 4 +- app/views/character/details.php | 2 +- app/views/collection/list.php | 4 +- app/views/person/details.php | 2 +- app/views/user/details.php | 2 +- src/AnimeClient/API/Kitsu/AnimeTrait.php | 4 +- src/AnimeClient/API/Kitsu/Auth.php | 6 +- src/AnimeClient/API/Kitsu/MangaTrait.php | 4 +- src/AnimeClient/API/Kitsu/Model.php | 2 +- src/AnimeClient/API/Kitsu/RequestBuilder.php | 2 +- .../Transformer/AnimeListTransformer.php | 2 +- .../Kitsu/Transformer/AnimeTransformer.php | 2 +- .../Transformer/CharacterTransformer.php | 2 +- .../Transformer/LibraryEntryTransformer.php | 2 +- .../Transformer/MangaListTransformer.php | 2 +- .../Kitsu/Transformer/MangaTransformer.php | 2 +- .../API/Kitsu/Transformer/UserTransformer.php | 2 +- src/AnimeClient/AnimeClient.php | 70 +++--- src/AnimeClient/Command/CachePrime.php | 2 +- src/AnimeClient/Command/SyncLists.php | 5 +- .../Controller/MangaCollection.php | 205 ------------------ src/AnimeClient/{API => }/Kitsu.php | 2 +- src/AnimeClient/Model/MangaCollection.php | 43 ---- tests/AnimeClient/ControllerTest.php | 6 +- tests/AnimeClient/{API => }/KitsuTest.php | 2 +- 26 files changed, 62 insertions(+), 321 deletions(-) delete mode 100644 src/AnimeClient/Controller/MangaCollection.php rename src/AnimeClient/{API => }/Kitsu.php (99%) delete mode 100644 src/AnimeClient/Model/MangaCollection.php rename tests/AnimeClient/{API => }/KitsuTest.php (97%) diff --git a/app/views/anime/details.php b/app/views/anime/details.php index 77fac541..72b1f8ca 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -1,6 +1,6 @@ diff --git a/app/views/anime/list.php b/app/views/anime/list.php index 1c2d482b..ae4a5613 100644 --- a/app/views/anime/list.php +++ b/app/views/anime/list.php @@ -1,4 +1,4 @@ - +
isAuthenticated()): ?> Add Item @@ -15,7 +15,7 @@

There's nothing here!

diff --git a/app/views/character/details.php b/app/views/character/details.php index b047b6cb..d4db6384 100644 --- a/app/views/character/details.php +++ b/app/views/character/details.php @@ -1,7 +1,7 @@
diff --git a/app/views/collection/list.php b/app/views/collection/list.php index 092d307c..3fa1be75 100644 --- a/app/views/collection/list.php +++ b/app/views/collection/list.php @@ -1,4 +1,4 @@ - +
isAuthenticated()): ?> Add Item @@ -12,7 +12,7 @@
$items): ?> - +
diff --git a/app/views/person/details.php b/app/views/person/details.php index e2b1f935..b2c20a28 100644 --- a/app/views/person/details.php +++ b/app/views/person/details.php @@ -1,6 +1,6 @@
diff --git a/app/views/user/details.php b/app/views/user/details.php index db0f8a8c..bca971a1 100644 --- a/app/views/user/details.php +++ b/app/views/user/details.php @@ -1,5 +1,5 @@

diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index c5d26512..dc50309b 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -17,9 +17,9 @@ namespace Aviat\AnimeClient\API\Kitsu; use Amp\Http\Client\Request; +use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; use Aviat\AnimeClient\API\JsonAPI; -use Aviat\AnimeClient\API\Kitsu as K; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeHistoryTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer; @@ -100,7 +100,7 @@ trait AnimeTrait { if ($list === NULL) { - $raw = $this->getRawHistoryList('anime'); + $raw = $this->getRawHistoryList(); $list = (new AnimeHistoryTransformer())->transform($raw); diff --git a/src/AnimeClient/API/Kitsu/Auth.php b/src/AnimeClient/API/Kitsu/Auth.php index 3403e0e5..5a995af2 100644 --- a/src/AnimeClient/API/Kitsu/Auth.php +++ b/src/AnimeClient/API/Kitsu/Auth.php @@ -20,10 +20,8 @@ use Aura\Session\Segment; use const Aviat\AnimeClient\SESSION_SEGMENT; -use Aviat\AnimeClient\API\{ - CacheTrait, - Kitsu as K -}; +use Aviat\AnimeClient\Kitsu as K; +use Aviat\AnimeClient\API\CacheTrait; use Aviat\Ion\Di\{ContainerAware, ContainerInterface}; use Aviat\Ion\Di\Exception\{ContainerException, NotFoundException}; use Aviat\Ion\Event; diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index 6f11ec09..ef2b15fa 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -17,9 +17,9 @@ namespace Aviat\AnimeClient\API\Kitsu; use Amp\Http\Client\Request; +use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\MangaReadingStatus\Kitsu as KitsuReadingStatus; use Aviat\AnimeClient\API\JsonAPI; -use Aviat\AnimeClient\API\Kitsu as K; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaHistoryTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; @@ -96,7 +96,7 @@ trait MangaTrait { if ($list === NULL) { - $raw = $this->getRawHistoryList('manga'); + $raw = $this->getRawHistoryList(); $list = (new MangaHistoryTransformer())->transform($raw); $this->cache->set($key, $list); diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 76fdce86..45907948 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -19,10 +19,10 @@ namespace Aviat\AnimeClient\API\Kitsu; use function Amp\Promise\wait; use Amp\Http\Client\Request; +use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\{ CacheTrait, JsonAPI, - Kitsu as K, ParallelAPIRequest }; use Aviat\AnimeClient\API\Kitsu\Transformer\{ diff --git a/src/AnimeClient/API/Kitsu/RequestBuilder.php b/src/AnimeClient/API/Kitsu/RequestBuilder.php index 586efb27..e103c42a 100644 --- a/src/AnimeClient/API/Kitsu/RequestBuilder.php +++ b/src/AnimeClient/API/Kitsu/RequestBuilder.php @@ -24,9 +24,9 @@ use function Aviat\AnimeClient\getResponse; use Amp\Http\Client\Request; use Amp\Http\Client\Response; +use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\APIRequestBuilder; use Aviat\AnimeClient\API\FailedResponseException; -use Aviat\AnimeClient\API\Kitsu as K; use Aviat\AnimeClient\Enum\EventType; use Aviat\Ion\Di\ContainerAware; use Aviat\Ion\Di\ContainerInterface; diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php index 0bd3f81d..078b8105 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\{ FormItem, AnimeListItem diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php index c2f022f7..3a007c17 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\AnimePage; use Aviat\Ion\Transformer\AbstractTransformer; diff --git a/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php index 168b9839..42f73e5b 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\Character; use Aviat\Ion\Transformer\AbstractTransformer; diff --git a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php index 47e10586..269fedec 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/LibraryEntryTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\{FormItem, AnimeListItem, MangaListItem, MangaListItemDetail}; use Aviat\Ion\Transformer\AbstractTransformer; use Aviat\Ion\Type\StringType; diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php index 41b0f913..435faf34 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\{ FormItem, FormItemData, MangaListItem, MangaListItemDetail diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php index d2e82af2..350a4486 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\MangaPage; use Aviat\Ion\Transformer\AbstractTransformer; diff --git a/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php index 30fd38b0..e9e42ba5 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/UserTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use function Aviat\AnimeClient\getLocalImg; use Aviat\AnimeClient\Types\User; diff --git a/src/AnimeClient/AnimeClient.php b/src/AnimeClient/AnimeClient.php index c1932ccd..eb35e2f9 100644 --- a/src/AnimeClient/AnimeClient.php +++ b/src/AnimeClient/AnimeClient.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Psr\SimpleCache\CacheInterface; use Psr\SimpleCache\InvalidArgumentException; use function Amp\Promise\wait; @@ -83,43 +83,6 @@ function loadTomlFile(string $filename): array return Toml::parseFile($filename); } -/** - * Recursively create a toml file from a data array - * - * @param TomlBuilder $builder - * @param iterable $data - * @param null $parentKey - */ -function _iterateToml(TomlBuilder $builder, iterable $data, $parentKey = NULL): void -{ - foreach ($data as $key => $value) - { - if ($value === NULL) - { - continue; - } - - - if (is_scalar($value) || isSequentialArray($value)) - { - // $builder->addTable(''); - $builder->addValue($key, $value); - continue; - } - - $newKey = ($parentKey !== NULL) - ? "{$parentKey}.{$key}" - : $key; - - if ( ! isSequentialArray($value)) - { - $builder->addTable($newKey); - } - - _iterateToml($builder, $value, $newKey); - } -} - /** * Serialize config data into a Toml file * @@ -129,6 +92,35 @@ function _iterateToml(TomlBuilder $builder, iterable $data, $parentKey = NULL): function arrayToToml(iterable $data): string { $builder = new TomlBuilder(); + function _iterateToml(TomlBuilder $builder, iterable $data, $parentKey = NULL): void + { + foreach ($data as $key => $value) + { + if ($value === NULL) + { + continue; + } + + + if (is_scalar($value) || isSequentialArray($value)) + { + // $builder->addTable(''); + $builder->addValue($key, $value); + continue; + } + + $newKey = ($parentKey !== NULL) + ? "{$parentKey}.{$key}" + : $key; + + if ( ! isSequentialArray($value)) + { + $builder->addTable($newKey); + } + + _iterateToml($builder, $value, $newKey); + } + } _iterateToml($builder, $data); @@ -346,7 +338,7 @@ function createPlaceholderImage ($path, ?int $width, ?int $height, $text = 'Imag * @param string $key * @return bool */ -function col_not_empty(array $search, string $key): bool +function colNotEmpty(array $search, string $key): bool { $items = array_filter(array_column($search, $key), fn ($x) => ( ! empty($x))); return count($items) > 0; diff --git a/src/AnimeClient/Command/CachePrime.php b/src/AnimeClient/Command/CachePrime.php index fc89fcf8..ea44076c 100644 --- a/src/AnimeClient/Command/CachePrime.php +++ b/src/AnimeClient/Command/CachePrime.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\Command; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\Ion\Di\Exception\ContainerException; use Aviat\Ion\Di\Exception\NotFoundException; use function Aviat\AnimeClient\clearCache; diff --git a/src/AnimeClient/Command/SyncLists.php b/src/AnimeClient/Command/SyncLists.php index 63daeef4..d16fc9c5 100644 --- a/src/AnimeClient/Command/SyncLists.php +++ b/src/AnimeClient/Command/SyncLists.php @@ -26,7 +26,6 @@ use Aviat\AnimeClient\API\{ }; use Aviat\AnimeClient\API; use Aviat\AnimeClient\API\Anilist; -use Aviat\AnimeClient\API\Kitsu; use Aviat\AnimeClient\API\Mapping\{AnimeWatchingStatus, MangaReadingStatus}; use Aviat\AnimeClient\Enum\{APISource, ListType, SyncAction}; use Aviat\AnimeClient\Types\FormItem; @@ -50,9 +49,9 @@ final class SyncLists extends BaseCommand { /** * Model for making requests to Kitsu API - * @var Kitsu\Model + * @var API\Kitsu\Model */ - private Kitsu\Model $kitsuModel; + private API\Kitsu\Model $kitsuModel; /** * Does the Kitsu API have valid authentication? diff --git a/src/AnimeClient/Controller/MangaCollection.php b/src/AnimeClient/Controller/MangaCollection.php deleted file mode 100644 index 40bf3102..00000000 --- a/src/AnimeClient/Controller/MangaCollection.php +++ /dev/null @@ -1,205 +0,0 @@ - - * @copyright 2015 - 2020 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 5.1 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\Controller; - -use Aura\Router\Exception\RouteNotFound; -use Aviat\AnimeClient\Controller as BaseController; -use Aviat\Ion\Di\Exception\ContainerException; -use Aviat\Ion\Di\Exception\NotFoundException; -use Aviat\Ion\Exception\DoubleRenderException; -use Aviat\AnimeClient\Model\{ - Manga as MangaModel, - MangaCollection as MangaCollectionModel -}; -use Aviat\Ion\Di\ContainerInterface; - -use InvalidArgumentException; - -/** - * Controller for manga collection pages - */ -final class MangaCollection extends BaseController { - - /** - * The manga collection model - * @var MangaCollectionModel $mangaCollectionModel - */ - private $mangaCollectionModel; - - /** - * The manga API model - * @var MangaModel $mangaModel - */ - private $mangaModel; - - /** - * Constructor - * - * @param ContainerInterface $container - * @throws ContainerException - * @throws NotFoundException - * @throws \InvalidArgumentException - */ - public function __construct(ContainerInterface $container) - { - parent::__construct($container); - - $this->mangaModel = $container->get('manga-model'); - $this->mangaCollectionModel = $container->get('manga-collection-model'); - $this->baseData = array_merge($this->baseData, [ - 'collection_type' => 'manga', - 'menu_name' => 'manga-collection', - 'other_type' => 'anime', - 'url_type' => 'manga', - ]); - } - - /** - * Search for manga - * - * @throws DoubleRenderException - * @return void - */ - public function search(): void - { - $queryParams = $this->request->getQueryParams(); - $query = $queryParams['query']; - $this->outputJSON($this->mangaModel->search($query)); - } - - /** - * Show the manga collection page - * - * @param string $view - * @throws ContainerException - * @throws NotFoundException - * @throws InvalidArgumentException - * @return void - */ - public function index($view): void - { - $viewMap = [ - '' => 'cover', - 'list' => 'list' - ]; - - $data = $this->mangaCollectionModel->getCollection(); - - $this->outputHTML('collection/' . $viewMap[$view], [ - 'title' => $this->config->get('whose_list') . "'s Manga Collection", - 'sections' => $data, - 'genres' => $this->mangaCollectionModel->getGenreList() - ]); - } - - /** - * Show the manga collection add/edit form - * - * @param integer|null $id - * @throws ContainerException - * @throws NotFoundException - * @throws RouteNotFound - * @throws InvalidArgumentException - * @return void - */ - public function form($id = NULL): void - { - $this->setSessionRedirect(); - - $action = $id === NULL ? 'Add' : 'Edit'; - $urlAction = strtolower($action); - - $this->outputHTML('collection/' . $urlAction, [ - 'action' => $action, - 'action_url' => $this->url->generate("manga.collection.{$urlAction}.post"), - 'title' => $this->formatTitle( - $this->config->get('whose_list') . "'s manga Collection", - $action - ), - 'media_items' => $this->mangaCollectionModel->getMediaTypeList(), - 'item' => ($action === 'Edit') ? $this->mangaCollectionModel->get($id) : [] - ]); - } - - /** - * Update a collection item - * - * @throws ContainerException - * @throws NotFoundException - * @throws InvalidArgumentException - * @return void - */ - public function edit(): void - { - $data = $this->request->getParsedBody(); - if (array_key_exists('hummingbird_id', $data)) - { - $this->mangaCollectionModel->update($data); - $this->setFlashMessage('Successfully updated collection item.', 'success'); - } - else - { - $this->setFlashMessage('Failed to update collection item', 'error'); - } - - $this->sessionRedirect(); - } - - /** - * Add a collection item - * - * @throws ContainerException - * @throws NotFoundException - * @throws InvalidArgumentException - * @return void - */ - public function add(): void - { - $data = $this->request->getParsedBody(); - if (array_key_exists('id', $data)) - { - $this->mangaCollectionModel->add($data); - $this->setFlashMessage('Successfully added collection item', 'success'); - } - else - { - $this->setFlashMessage('Failed to add collection item.', 'error'); - } - - $this->sessionRedirect(); - } - - /** - * Remove a collection item - * - * @return void - */ - public function delete(): void - { - $data = $this->request->getParsedBody(); - if ( ! array_key_exists('hummingbird_id', $data)) - { - $this->redirect('/manga-collection/view', 303); - } - - $this->mangaCollectionModel->delete($data); - $this->setFlashMessage('Successfully removed manga from collection.', 'success'); - - $this->redirect('/manga-collection/view', 303); - } -} -// End of CollectionController.php \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu.php b/src/AnimeClient/Kitsu.php similarity index 99% rename from src/AnimeClient/API/Kitsu.php rename to src/AnimeClient/Kitsu.php index 08ecf1e8..c2f7d261 100644 --- a/src/AnimeClient/API/Kitsu.php +++ b/src/AnimeClient/Kitsu.php @@ -14,7 +14,7 @@ * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient */ -namespace Aviat\AnimeClient\API; +namespace Aviat\AnimeClient; use Aviat\AnimeClient\API\Kitsu\Enum\AnimeAiringStatus; use Aviat\AnimeClient\API\Kitsu\Enum\MangaPublishingStatus; diff --git a/src/AnimeClient/Model/MangaCollection.php b/src/AnimeClient/Model/MangaCollection.php deleted file mode 100644 index fa36f6e3..00000000 --- a/src/AnimeClient/Model/MangaCollection.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @copyright 2015 - 2020 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 5.1 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\Model; - -use Aviat\Ion\Di\ContainerInterface; - -/** - * Model for getting anime collection data - */ -final class MangaCollection extends Collection { - - /** - * Manga API Model - * @var Manga $mangaModel - */ - protected $mangaModel; - - /** - * Create the collection model - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - parent::__construct($container); - $this->mangaModel = $container->get('manga-model'); - } -} -// End of MangaCollectionModel.php \ No newline at end of file diff --git a/tests/AnimeClient/ControllerTest.php b/tests/AnimeClient/ControllerTest.php index 71c25fc6..723c38be 100644 --- a/tests/AnimeClient/ControllerTest.php +++ b/tests/AnimeClient/ControllerTest.php @@ -23,7 +23,7 @@ use Aviat\AnimeClient\Controller\{ Anime as AnimeController, Character as CharacterController, AnimeCollection as AnimeCollectionController, - MangaCollection as MangaCollectionController, + // MangaCollection as MangaCollectionController, Manga as MangaController }; @@ -73,10 +73,10 @@ class ControllerTest extends AnimeClientTestCase { Controller::class, new AnimeCollectionController($this->container) ); - $this->assertInstanceOf( + /* $this->assertInstanceOf( Controller::class, new MangaCollectionController($this->container) - ); + ); */ } public function testBaseControllerSanity() diff --git a/tests/AnimeClient/API/KitsuTest.php b/tests/AnimeClient/KitsuTest.php similarity index 97% rename from tests/AnimeClient/API/KitsuTest.php rename to tests/AnimeClient/KitsuTest.php index 1fa0d7b1..5ca24b9b 100644 --- a/tests/AnimeClient/API/KitsuTest.php +++ b/tests/AnimeClient/KitsuTest.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\Tests\API; -use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\API\Kitsu\Enum\AnimeAiringStatus; use PHPUnit\Framework\TestCase; From 608cd4004ef4d8fc89e4e785926b09792b72117a Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 26 Aug 2020 15:23:47 -0400 Subject: [PATCH 53/86] Fix Dispatcher test --- tests/AnimeClient/DispatcherTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/AnimeClient/DispatcherTest.php b/tests/AnimeClient/DispatcherTest.php index 6b299976..0c7446e7 100644 --- a/tests/AnimeClient/DispatcherTest.php +++ b/tests/AnimeClient/DispatcherTest.php @@ -211,7 +211,6 @@ class DispatcherTest extends AnimeClientTestCase { 'character' => Controller\Character::class, 'misc' => Controller\Misc::class, 'manga' => Controller\Manga::class, - 'manga-collection' => Controller\MangaCollection::class, 'people' => Controller\People::class, 'settings' => Controller\Settings::class, 'user' => Controller\User::class, From 3714a93dcfe11c57ffc6d6a49926b5fb73cdf102 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 26 Aug 2020 15:24:49 -0400 Subject: [PATCH 54/86] Extract common methods for Anime and Manga models into a trait --- src/AnimeClient/Model/Anime.php | 182 +---------------------- src/AnimeClient/Model/Manga.php | 167 +-------------------- src/AnimeClient/Model/MediaTrait.php | 213 +++++++++++++++++++++++++++ 3 files changed, 217 insertions(+), 345 deletions(-) create mode 100644 src/AnimeClient/Model/MediaTrait.php diff --git a/src/AnimeClient/Model/Anime.php b/src/AnimeClient/Model/Anime.php index 825c9ffe..143f8314 100644 --- a/src/AnimeClient/Model/Anime.php +++ b/src/AnimeClient/Model/Anime.php @@ -16,9 +16,6 @@ namespace Aviat\AnimeClient\Model; -use Aviat\AnimeClient\API\Anilist\Model as AnilistModel; -use Aviat\AnimeClient\API\Kitsu\Model as KitsuModel; -use Aviat\AnimeClient\API\Kitsu\Transformer\LibraryEntryTransformer; use Aviat\AnimeClient\API\ParallelAPIRequest; use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; use Aviat\AnimeClient\Types\{ @@ -26,7 +23,6 @@ use Aviat\AnimeClient\Types\{ FormItem, AnimeListItem }; -use Aviat\Ion\Di\ContainerInterface; use Aviat\Ion\Json; use Throwable; @@ -36,41 +32,9 @@ use function is_array; * Model for handling requests dealing with the anime list */ class Anime extends API { + use MediaTrait; - /** - * Is the Anilist API enabled? - * - * @var boolean - */ - protected bool $anilistEnabled; - - /** - * Model for making requests to Anilist API - * - * @var AnilistModel - */ - protected AnilistModel $anilistModel; - - /** - * Model for making requests to Kitsu API - * - * @var KitsuModel - */ - protected KitsuModel $kitsuModel; - - /** - * Anime constructor. - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->anilistModel = $container->get('anilist-model'); - $this->kitsuModel = $container->get('kitsu-model'); - - $config = $container->get('config'); - $this->anilistEnabled = (bool) $config->get(['anilist', 'enabled']); - } + protected string $type = 'anime'; /** * Get a category out of the full list @@ -140,147 +104,5 @@ class Anime extends API { return $this->kitsuModel->getAnimeHistory(); } - /** - * Search for anime by name - * - * @param string $name - * @return array - */ - public function search(string $name): array - { - return $this->kitsuModel->search('anime', urldecode($name)); - } - /** - * Get information about a specific list item - * for editing/updating that item - * - * @param string $itemId - * @return AnimeListItem - */ - public function getLibraryItem(string $itemId): AnimeListItem - { - return $this->kitsuModel->getListItem($itemId); - } - - /** - * Add an anime to your list - * - * @param array $data - * @return bool - * @throws Throwable - */ - public function createLibraryItem(array $data): bool - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->createListItem($data), 'kitsu'); - - if ($this->anilistEnabled && $data['mal_id'] !== null) - { - // If can't map MAL id, this will be null - $maybeRequest = $this->anilistModel->createListItem($data, 'ANIME'); - if ($maybeRequest !== NULL) - { - $requester->addRequest($maybeRequest, 'anilist'); - } - } - - $results = $requester->makeRequests(); - - return count($results) > 0; - } - - /** - * Increment progress for the specified anime - * - * @param FormItem $data - * @return array - * @throws Throwable - */ - public function incrementLibraryItem(FormItem $data): array - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->incrementListItem($data), 'kitsu'); - - if (( ! empty($data['mal_id'])) && $this->anilistEnabled) - { - // If can't map MAL id, this will be null - $maybeRequest = $this->anilistModel->incrementListItem($data, 'ANIME'); - if ($maybeRequest !== NULL) - { - $requester->addRequest($maybeRequest, 'anilist'); - } - } - - $results = $requester->makeRequests(); - - $body = Json::decode($results['kitsu']); - $statusCode = array_key_exists('error', $body) ? 400 : 200; - - return [ - 'body' => Json::decode($results['kitsu']), - 'statusCode' => $statusCode - ]; - } - - /** - * Update a list entry - * - * @param FormItem $data - * @return array - * @throws Throwable - */ - public function updateLibraryItem(FormItem $data): array - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->updateListItem($data), 'kitsu'); - - if (( ! empty($data['mal_id'])) && $this->anilistEnabled) - { - // If can't map MAL id, this will be null - $maybeRequest = $this->anilistModel->updateListItem($data, 'ANIME'); - if ($maybeRequest !== NULL) - { - $requester->addRequest($maybeRequest, 'anilist'); - } - } - - $results = $requester->makeRequests(); - - $body = Json::decode($results['kitsu']); - $statusCode = array_key_exists('errors', $body) ? 400: 200; - - return [ - 'body' => Json::decode($results['kitsu']), - 'statusCode' => $statusCode - ]; - } - - /** - * Delete a list entry - * - * @param string $id - * @param string|null $malId - * @return bool - * @throws Throwable - */ - public function deleteLibraryItem(string $id, string $malId = NULL): bool - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->deleteListItem($id), 'kitsu'); - - if ($this->anilistEnabled && $malId !== null) - { - // If can't map MAL id, this will be null - $maybeRequest = $this->anilistModel->deleteListItem($malId, 'ANIME'); - if ($maybeRequest !== NULL) - { - $requester->addRequest($maybeRequest, 'anilist'); - } - } - - $results = $requester->makeRequests(); - - return count($results) > 0; - } } \ No newline at end of file diff --git a/src/AnimeClient/Model/Manga.php b/src/AnimeClient/Model/Manga.php index 9aa9ab1a..d7e81d1d 100644 --- a/src/AnimeClient/Model/Manga.php +++ b/src/AnimeClient/Model/Manga.php @@ -19,55 +19,18 @@ namespace Aviat\AnimeClient\Model; use Aviat\AnimeClient\API\{ Enum\MangaReadingStatus\Title, Mapping\MangaReadingStatus, - ParallelAPIRequest }; use Aviat\AnimeClient\Types\{ - FormItem, - MangaListItem, MangaPage }; -use Aviat\AnimeClient\API\{Anilist, Kitsu}; -use Aviat\Ion\Di\ContainerInterface; -use Aviat\Ion\Json; - -use Throwable; /** * Model for handling requests dealing with the manga list */ class Manga extends API { - /** - * Is the Anilist API enabled? - * - * @var boolean - */ - protected bool $anilistEnabled; + use MediaTrait; - /** - * Model for making requests to the Anilist API - * @var Anilist\Model - */ - protected Anilist\Model $anilistModel; - - /** - * Model for making requests to Kitsu API - * @var Kitsu\Model - */ - protected Kitsu\Model $kitsuModel; - - /** - * Constructor - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->anilistModel = $container->get('anilist-model'); - $this->kitsuModel = $container->get('kitsu-model'); - - $config = $container->get('config'); - $this->anilistEnabled = (bool)$config->get(['anilist', 'enabled']); - } + protected string $type = 'manga'; /** * Get a category out of the full list @@ -116,132 +79,6 @@ class Manga extends API { return $this->kitsuModel->getMangaById($animeId); } - /** - * Get information about a specific list item - * for editing/updating that item - * - * @param string $itemId - * @return MangaListItem - */ - public function getLibraryItem(string $itemId): MangaListItem - { - return $this->kitsuModel->getListItem($itemId); - } - - /** - * Create a new manga list item - * - * @param array $data - * @return bool - * @throws Throwable - */ - public function createLibraryItem(array $data): bool - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->createListItem($data), 'kitsu'); - - if ($this->anilistEnabled && array_key_exists('mal_id', $data)) - { - $requester->addRequest($this->anilistModel->createListItem($data, 'MANGA'), 'anilist'); - } - - $results = $requester->makeRequests(); - - return count($results) > 0; - } - - /** - * Update a list entry - * - * @param FormItem $data - * @return array - * @throws Throwable - */ - public function updateLibraryItem(FormItem $data): array - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->updateListItem($data), 'kitsu'); - - $array = $data->toArray(); - - if ($this->anilistEnabled && array_key_exists('mal_id', $array)) - { - $requester->addRequest($this->anilistModel->updateListItem($data, 'MANGA'), 'anilist'); - } - - $results = $requester->makeRequests(); - $body = Json::decode($results['kitsu']); - $statusCode = array_key_exists('errors', $body) ? 400: 200; - - return [ - 'body' => Json::decode($results['kitsu']), - 'statusCode' => $statusCode - ]; - } - - /** - * Increase the progress of a list entry - * - * @param FormItem $data - * @return array - * @throws Throwable - */ - public function incrementLibraryItem(FormItem $data): array - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->incrementListItem($data), 'kitsu'); - - $array = $data->toArray(); - - if ($this->anilistEnabled && array_key_exists('mal_id', $array)) - { - $requester->addRequest($this->anilistModel->incrementListItem($data, 'MANGA'), 'anilist'); - } - - $results = $requester->makeRequests(); - - $body = Json::decode($results['kitsu']); - $statusCode = array_key_exists('errors', $body) - ? $body['errors'][0]['status'] - : 200; - - return [$body, $statusCode]; - } - - /** - * Delete a list entry - * - * @param string $id - * @param string|null $malId - * @return bool - * @throws Throwable - */ - public function deleteLibraryItem(string $id, string $malId = NULL): bool - { - $requester = new ParallelAPIRequest(); - $requester->addRequest($this->kitsuModel->deleteListItem($id), 'kitsu'); - - if ($this->anilistEnabled && $malId !== null) - { - $requester->addRequest($this->anilistModel->deleteListItem($malId, 'MANGA'), 'anilist'); - } - - $results = $requester->makeRequests(); - - return count($results) > 0; - } - - /** - * Search for manga by name - * - * @param string $name - * @return array - */ - public function search($name): array - { - return $this->kitsuModel->search('manga', $name); - } - /** * Get recent reading history * diff --git a/src/AnimeClient/Model/MediaTrait.php b/src/AnimeClient/Model/MediaTrait.php new file mode 100644 index 00000000..57ed4109 --- /dev/null +++ b/src/AnimeClient/Model/MediaTrait.php @@ -0,0 +1,213 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Model; + +use Aviat\AnimeClient\API\Anilist; +use Aviat\AnimeClient\API\Kitsu; +use Aviat\AnimeClient\API\ParallelAPIRequest; +use Aviat\AnimeClient\Types\AnimeListItem; +use Aviat\AnimeClient\Types\FormItem; +use Aviat\AnimeClient\Types\MangaListItem; +use Aviat\Ion\Di\ContainerInterface; +use Aviat\Ion\Json; + +use Throwable; + +/** + * Common functionality for Anime/Manga Models + */ +trait MediaTrait { + + /** + * Is the Anilist API enabled? + * + * @var boolean + */ + protected bool $anilistEnabled; + + /** + * Model for making requests to Anilist API + * + * @var Anilist\Model + */ + protected Anilist\Model $anilistModel; + + /** + * Model for making requests to Kitsu API + * + * @var Kitsu\Model + */ + protected Kitsu\Model $kitsuModel; + + /** + * Anime constructor. + * + * @param ContainerInterface $container + */ + public function __construct(ContainerInterface $container) + { + $this->anilistModel = $container->get('anilist-model'); + $this->kitsuModel = $container->get('kitsu-model'); + + $config = $container->get('config'); + $this->anilistEnabled = (bool) $config->get(['anilist', 'enabled']); + } + + /** + * Search for anime by name + * + * @param string $name + * @return array + */ + public function search(string $name): array + { + return $this->kitsuModel->search($this->type, urldecode($name)); + } + + /** + * Get information about a specific list item + * for editing/updating that item + * + * @param string $itemId + * @return AnimeListItem|MangaListItem + */ + public function getLibraryItem(string $itemId) + { + return $this->kitsuModel->getListItem($itemId); + } + + /** + * Add an anime to your list + * + * @param array $data + * @return bool + * @throws Throwable + */ + public function createLibraryItem(array $data): bool + { + $requester = new ParallelAPIRequest(); + $requester->addRequest($this->kitsuModel->createListItem($data), 'kitsu'); + + if ($this->anilistEnabled && $data['mal_id'] !== null) + { + // If can't map MAL id, this will be null + $maybeRequest = $this->anilistModel->createListItem($data, strtoupper($this->type)); + if ($maybeRequest !== NULL) + { + $requester->addRequest($maybeRequest, 'anilist'); + } + } + + $results = $requester->makeRequests(); + + return count($results) > 0; + } + + /** + * Increment progress for the specified anime + * + * @param FormItem $data + * @return array + * @throws Throwable + */ + public function incrementLibraryItem(FormItem $data): array + { + $requester = new ParallelAPIRequest(); + $requester->addRequest($this->kitsuModel->incrementListItem($data), 'kitsu'); + + if (( ! empty($data['mal_id'])) && $this->anilistEnabled) + { + // If can't map MAL id, this will be null + $maybeRequest = $this->anilistModel->incrementListItem($data, strtoupper($this->type)); + if ($maybeRequest !== NULL) + { + $requester->addRequest($maybeRequest, 'anilist'); + } + } + + $results = $requester->makeRequests(); + + $body = Json::decode($results['kitsu']); + $statusCode = array_key_exists('error', $body) ? 400 : 200; + + return [ + 'body' => Json::decode($results['kitsu']), + 'statusCode' => $statusCode + ]; + } + + /** + * Update a list entry + * + * @param FormItem $data + * @return array + * @throws Throwable + */ + public function updateLibraryItem(FormItem $data): array + { + $requester = new ParallelAPIRequest(); + $requester->addRequest($this->kitsuModel->updateListItem($data), 'kitsu'); + + if (( ! empty($data['mal_id'])) && $this->anilistEnabled) + { + // If can't map MAL id, this will be null + $maybeRequest = $this->anilistModel->updateListItem($data, strtoupper($this->type)); + if ($maybeRequest !== NULL) + { + $requester->addRequest($maybeRequest, 'anilist'); + } + } + + $results = $requester->makeRequests(); + + $body = Json::decode($results['kitsu']); + $statusCode = array_key_exists('errors', $body) ? 400: 200; + + return [ + 'body' => Json::decode($results['kitsu']), + 'statusCode' => $statusCode + ]; + } + + /** + * Delete a list entry + * + * @param string $id + * @param string|null $malId + * @return bool + * @throws Throwable + */ + public function deleteLibraryItem(string $id, string $malId = NULL): bool + { + $requester = new ParallelAPIRequest(); + $requester->addRequest($this->kitsuModel->deleteListItem($id), 'kitsu'); + + if ($this->anilistEnabled && $malId !== null) + { + // If can't map MAL id, this will be null + $maybeRequest = $this->anilistModel->deleteListItem($malId, strtoupper($this->type)); + if ($maybeRequest !== NULL) + { + $requester->addRequest($maybeRequest, 'anilist'); + } + } + + $results = $requester->makeRequests(); + + return count($results) > 0; + } +} \ No newline at end of file From 9c01f3fbd0352e09fb6254fb962d39dd1cff995e Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 26 Aug 2020 15:25:31 -0400 Subject: [PATCH 55/86] Misc tweaks --- src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql | 12 ++++++------ src/AnimeClient/Controller.php | 9 ++++++++- src/AnimeClient/Types/Config/Cache.php | 6 ++++++ src/Ion/View/HttpView.php | 1 + 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql index 42507336..094b821e 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql @@ -2,12 +2,12 @@ query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { findProfileBySlug(slug: $slug) { library { all(mediaType: $type, status: $status) { -# pageInfo { -# endCursor -# hasNextPage -# hasPreviousPage -# startCursor -# } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } totalCount nodes { id diff --git a/src/AnimeClient/Controller.php b/src/AnimeClient/Controller.php index 8b79b891..8bb2e7f9 100644 --- a/src/AnimeClient/Controller.php +++ b/src/AnimeClient/Controller.php @@ -424,7 +424,14 @@ class Controller { */ protected function redirect(string $url, int $code): void { - (new HttpView())->redirect($url, $code)->send(); + try + { + (new HttpView())->redirect($url, $code)->send(); + } + catch (\Throwable $e) + { + + } } } // End of BaseController.php \ No newline at end of file diff --git a/src/AnimeClient/Types/Config/Cache.php b/src/AnimeClient/Types/Config/Cache.php index dfbd38dc..5c055159 100644 --- a/src/AnimeClient/Types/Config/Cache.php +++ b/src/AnimeClient/Types/Config/Cache.php @@ -24,6 +24,12 @@ class Cache extends AbstractType { */ public $driver; + public $host; + + public $port; + + public $database; + /** * @var array */ diff --git a/src/Ion/View/HttpView.php b/src/Ion/View/HttpView.php index 47097649..7e859c51 100644 --- a/src/Ion/View/HttpView.php +++ b/src/Ion/View/HttpView.php @@ -147,6 +147,7 @@ class HttpView implements ViewInterface{ public function redirect(string $url, int $code = 302, array $headers = []): self { $this->response = new Response\RedirectResponse($url, $code, $headers); + return $this; } /** From 1b74df5269b8ae9d863fc3e4e89f3937deec7caf Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 26 Aug 2020 17:26:42 -0400 Subject: [PATCH 56/86] More components, resolve #31 --- app/bootstrap.php | 10 ++- .../anime-cover.php} | 12 +-- app/templates/manga-cover.php | 74 ++++++++++++++++++ app/templates/tabs.php | 9 +++ app/templates/vertical-tabs.php | 2 +- app/views/anime/cover.php | 2 +- app/views/collection/add.php | 2 +- app/views/collection/cover.php | 41 ++++------ app/views/collection/edit.php | 3 +- app/views/collection/list-all.php | 44 ----------- app/views/collection/list-item.php | 3 + app/views/collection/list.php | 76 +++++++++++-------- ...-select-list.php => media-select-list.php} | 0 app/views/manga/cover.php | 75 +----------------- src/AnimeClient/AnimeClient.php | 15 ++++ src/AnimeClient/Component/AnimeCover.php | 30 ++++++++ src/AnimeClient/Component/ComponentTrait.php | 28 ++++++- src/AnimeClient/Component/MangaCover.php | 31 ++++++++ src/AnimeClient/Component/Tabs.php | 6 +- .../Controller/AnimeCollection.php | 8 +- 20 files changed, 276 insertions(+), 195 deletions(-) rename app/{views/anime/cover-item.php => templates/anime-cover.php} (92%) create mode 100644 app/templates/manga-cover.php delete mode 100644 app/views/collection/list-all.php rename app/views/collection/{_media-select-list.php => media-select-list.php} (100%) create mode 100644 src/AnimeClient/Component/AnimeCover.php create mode 100644 src/AnimeClient/Component/MangaCover.php diff --git a/app/bootstrap.php b/app/bootstrap.php index 627fb5c7..149c1c2a 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -101,9 +101,11 @@ return static function (array $configArray = []): Container { }); // Create Component helpers - $container->set('component-helper', static function () { + $container->set('component-helper', static function (ContainerInterface $container) { $helper = (new HelperLocatorFactory)->newInstance(); $components = [ + 'animeCover' => Component\AnimeCover::class, + 'mangaCover' => Component\MangaCover::class, 'character' => Component\Character::class, 'media' => Component\Media::class, 'tabs' => Component\Tabs::class, @@ -112,7 +114,11 @@ return static function (array $configArray = []): Container { foreach ($components as $name => $componentClass) { - $helper->set($name, fn () => new $componentClass); + $helper->set($name, static function () use ($container, $componentClass) { + $helper = new $componentClass; + $helper->setContainer($container); + return $helper; + }); } return $helper; diff --git a/app/views/anime/cover-item.php b/app/templates/anime-cover.php similarity index 92% rename from app/views/anime/cover-item.php rename to app/templates/anime-cover.php index af680967..aef5ec2b 100644 --- a/app/views/anime/cover-item.php +++ b/app/templates/anime-cover.php @@ -1,7 +1,7 @@
isAuthenticated()): ?> @@ -31,13 +31,13 @@ 0): ?>
-
Rewatched once
+
Rewatched once
-
Rewatched twice
+
Rewatched twice
-
Rewatched thrice
+
Rewatched thrice
-
Rewatched times
+
Rewatched times
diff --git a/app/templates/manga-cover.php b/app/templates/manga-cover.php new file mode 100644 index 00000000..feb646bc --- /dev/null +++ b/app/templates/manga-cover.php @@ -0,0 +1,74 @@ +
+ isAuthenticated()): ?> + + + picture("images/manga/{$item['manga']['id']}.webp") ?> + +
+ isAuthenticated()): ?> +
+ + + Edit + + +
+ +
+
+
Rating: / 10
+
+ + +
+ + + + + +
+ + + 0): ?> +
+ +
Reread once
+ +
Reread twice
+ +
Reread thrice
+ +
Reread times
+ +
+ + +
+
+ Chapters: / + +
+ +
*/ ?> +
+ Volumes: +
+
+
+
\ No newline at end of file diff --git a/app/templates/tabs.php b/app/templates/tabs.php index 17294e63..c7f70b91 100644 --- a/app/templates/tabs.php +++ b/app/templates/tabs.php @@ -11,6 +11,11 @@ /> + + +
+ +
+ + +
+

\ No newline at end of file diff --git a/app/templates/vertical-tabs.php b/app/templates/vertical-tabs.php index 72e3827f..a36a2bb1 100644 --- a/app/templates/vertical-tabs.php +++ b/app/templates/vertical-tabs.php @@ -7,7 +7,7 @@ type="radio" role='tab' aria-controls="_" - name="staff-roles" + name="" id="" /> diff --git a/app/views/anime/cover.php b/app/views/anime/cover.php index 9c872607..96cdf359 100644 --- a/app/views/anime/cover.php +++ b/app/views/anime/cover.php @@ -20,7 +20,7 @@
isAuthenticated()) continue; ?> - + animeCover($item) ?>
diff --git a/app/views/collection/add.php b/app/views/collection/add.php index 7a8bca88..aa625fa5 100644 --- a/app/views/collection/add.php +++ b/app/views/collection/add.php @@ -19,7 +19,7 @@
diff --git a/app/views/collection/cover.php b/app/views/collection/cover.php index 0d4c1345..924d03e1 100644 --- a/app/views/collection/cover.php +++ b/app/views/collection/cover.php @@ -1,3 +1,4 @@ +
isAuthenticated()): ?> Add Item @@ -8,30 +9,20 @@

-
- - $items): ?> - - -
-
- - - -
-
- - - - - -
-
- - - -
-
-
+ tabs('collection-tab', $sections, static function ($items) use ($auth, $collection_type, $helper, $url, $component) { + $rendered = []; + foreach ($items as $item) + { + $rendered[] = renderTemplate(__DIR__ . '/cover-item.php', [ + 'auth' => $auth, + 'collection_type' => $collection_type, + 'helper' => $helper, + 'item' => $item, + 'url' => $url, + ]); + } + + return implode('', array_map('mb_trim', $rendered)); + }, 'media-wrap', true) ?>
diff --git a/app/views/collection/edit.php b/app/views/collection/edit.php index c3b8f2b0..65129799 100644 --- a/app/views/collection/edit.php +++ b/app/views/collection/edit.php @@ -1,3 +1,4 @@ +isAuthenticated()): ?>

Edit Anime Collection Item

@@ -24,7 +25,7 @@
diff --git a/app/views/collection/list-all.php b/app/views/collection/list-all.php deleted file mode 100644 index b14db2b1..00000000 --- a/app/views/collection/list-all.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
-
- +
- +
- - - isAuthenticated()): ?> - - - - - - - - - - - - - generate($collection_type . '.collection.edit.get', ['id' => $item['hummingbird_id']]); ?> - - isAuthenticated()): ?> - - - - - - - - - - - - - -
 TitleMediaEpisode CountEpisode LengthShow TypeAge RatingNotesGenres
- Edit - - - - - ' . $item['alternate_title'] . '' : '' ?> - 1) ? $item['episode_count'] : '-' ?>
- \ No newline at end of file diff --git a/app/views/collection/list-item.php b/app/views/collection/list-item.php index 9c8ac967..4fd1191a 100644 --- a/app/views/collection/list-item.php +++ b/app/views/collection/list-item.php @@ -11,6 +11,9 @@ ' . $item['alternate_title'] . '' : '' ?> + + + 1) ? $item['episode_count'] : '-' ?> diff --git a/app/views/collection/list.php b/app/views/collection/list.php index 3fa1be75..ec3fd5e8 100644 --- a/app/views/collection/list.php +++ b/app/views/collection/list.php @@ -1,4 +1,4 @@ - +
isAuthenticated()): ?> Add Item @@ -9,38 +9,48 @@

- -
- $items): ?> - - - -
- - - - isAuthenticated()): ?> - - - - - - - - - - - - - - -
 TitleEpisode CountEpisode LengthShow TypeAge RatingNotesGenres
-
- - - - -
+ tabs('collection-tab', $sections, static function ($items, $section) use ($auth, $helper, $url, $collection_type) { + $hasNotes = colNotEmpty($items, 'notes'); + $hasMedia = $section === 'All'; + $firstTh = ($auth->isAuthenticated()) ? ' ' : ''; + $mediaTh = ($hasMedia) ? 'Media' : ''; + $noteTh = ($hasNotes) ? 'Notes' : ''; + + $rendered = []; + foreach ($items as $item) + { + $rendered[] = renderTemplate(__DIR__ . '/list-item.php', [ + 'auth' => $auth, + 'collection_type' => $collection_type, + 'hasMedia' => $hasMedia, + 'hasNotes' => $hasNotes, + 'helper' => $helper, + 'item' => $item, + 'url' => $url, + ]); + } + $rows = implode('', array_map('mb_trim', $rendered)); + + return << + + + {$firstTh} + Title + {$mediaTh} + Episode Count + Episode Length + Show Type + Age Rating + {$noteTh} + Genres + + + {$rows} + +HTML; + + }) ?>
\ No newline at end of file diff --git a/app/views/collection/_media-select-list.php b/app/views/collection/media-select-list.php similarity index 100% rename from app/views/collection/_media-select-list.php rename to app/views/collection/media-select-list.php diff --git a/app/views/manga/cover.php b/app/views/manga/cover.php index 7d3edbae..8d4822c7 100644 --- a/app/views/manga/cover.php +++ b/app/views/manga/cover.php @@ -19,80 +19,7 @@

html($name) ?>

-
- isAuthenticated()): ?> - - - picture("images/manga/{$item['manga']['id']}.webp") ?> - -
- isAuthenticated()): ?> -
- - - Edit - - -
- -
-
-
Rating: / 10
-
- - -
- - - - - -
- - - 0): ?> -
- -
Reread once
- -
Reread twice
- -
Reread thrice
- -
Reread times
- -
- - -
-
- Chapters: / - -
- -
*/ ?> -
- Volumes: -
-
-
-
+ mangaCover($item, $name) ?>
diff --git a/src/AnimeClient/AnimeClient.php b/src/AnimeClient/AnimeClient.php index eb35e2f9..c9c70216 100644 --- a/src/AnimeClient/AnimeClient.php +++ b/src/AnimeClient/AnimeClient.php @@ -369,4 +369,19 @@ function clearCache(CacheInterface $cache): bool : TRUE; return $cleared && $saved; +} + +/** + * Render a PHP code template as a string + * + * @param string $path + * @param array $data + * @return string + */ +function renderTemplate(string $path, array $data): string +{ + ob_start(); + extract($data, EXTR_OVERWRITE); + include $path; + return ob_get_clean(); } \ No newline at end of file diff --git a/src/AnimeClient/Component/AnimeCover.php b/src/AnimeClient/Component/AnimeCover.php new file mode 100644 index 00000000..d34db72f --- /dev/null +++ b/src/AnimeClient/Component/AnimeCover.php @@ -0,0 +1,30 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +use Aviat\AnimeClient\Types\AnimeListItem; + +final class AnimeCover { + use ComponentTrait; + + public function __invoke(AnimeListItem $item): string + { + return $this->render('anime-cover.php', [ + 'item' => $item, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/Component/ComponentTrait.php b/src/AnimeClient/Component/ComponentTrait.php index d4f909ae..1e71ae4e 100644 --- a/src/AnimeClient/Component/ComponentTrait.php +++ b/src/AnimeClient/Component/ComponentTrait.php @@ -16,15 +16,35 @@ namespace Aviat\AnimeClient\Component; +use Aviat\Ion\Di\ContainerAware; +use const TEMPLATE_DIR; +use function Aviat\AnimeClient\renderTemplate; + /** * Shared logic for component-based functionality, like Tabs */ trait ComponentTrait { + use ContainerAware; + + /** + * Render a template with common container values + * + * @param string $path + * @param array $data + * @return string + */ public function render(string $path, array $data): string { - ob_start(); - extract($data, EXTR_OVERWRITE); - include \TEMPLATE_DIR . '/' .$path; - return ob_get_clean(); + $container = $this->getContainer(); + $helper = $container->get('html-helper'); + + $baseData = [ + 'auth' => $container->get('auth'), + 'escape' => $helper->escape(), + 'helper' => $helper, + 'url' => $container->get('aura-router')->getGenerator(), + ]; + + return renderTemplate(TEMPLATE_DIR . '/' . $path, array_merge($baseData, $data)); } } \ No newline at end of file diff --git a/src/AnimeClient/Component/MangaCover.php b/src/AnimeClient/Component/MangaCover.php new file mode 100644 index 00000000..422e4ecc --- /dev/null +++ b/src/AnimeClient/Component/MangaCover.php @@ -0,0 +1,31 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Component; + +use Aviat\AnimeClient\Types\MangaListItem; + +final class MangaCover { + use ComponentTrait; + + public function __invoke(MangaListItem $item, string $name): string + { + return $this->render('manga-cover.php', [ + 'item' => $item, + 'name' => $name, + ]); + } +} \ No newline at end of file diff --git a/src/AnimeClient/Component/Tabs.php b/src/AnimeClient/Component/Tabs.php index 91c9d572..f30276e8 100644 --- a/src/AnimeClient/Component/Tabs.php +++ b/src/AnimeClient/Component/Tabs.php @@ -26,13 +26,16 @@ final class Tabs { * also used to generate id attributes * @param array $tabData The data used to create the tab content, indexed by the tab label * @param callable $cb The function to generate the tab content + * @param string $className + * @param bool $hasSectionWrapper * @return string */ public function __invoke( string $name, array $tabData, callable $cb, - string $className = 'content media-wrap flex flex-wrap flex-justify-start' + string $className = 'content media-wrap flex flex-wrap flex-justify-start', + bool $hasSectionWrapper = false ): string { return $this->render('tabs.php', [ @@ -40,6 +43,7 @@ final class Tabs { 'data' => $tabData, 'callback' => $cb, 'className' => $className, + 'hasSectionWrapper' => $hasSectionWrapper, ]); } } \ No newline at end of file diff --git a/src/AnimeClient/Controller/AnimeCollection.php b/src/AnimeClient/Controller/AnimeCollection.php index 547f2aa0..10aaf9d6 100644 --- a/src/AnimeClient/Controller/AnimeCollection.php +++ b/src/AnimeClient/Controller/AnimeCollection.php @@ -101,10 +101,14 @@ final class AnimeCollection extends BaseController { 'list' => 'list' ]; + $sections = array_merge( + ['All' => $this->animeCollectionModel->getFlatCollection()], + $this->animeCollectionModel->getCollection() + ); + $this->outputHTML('collection/' . $viewMap[$view], [ 'title' => $this->config->get('whose_list') . "'s Anime Collection", - 'sections' => $this->animeCollectionModel->getCollection(), - 'all' => $this->animeCollectionModel->getFlatCollection(), + 'sections' => $sections, ]); } From e2f29c6731a3cbdb449eeec1dc5230bc769a819d Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 27 Aug 2020 15:01:00 -0400 Subject: [PATCH 57/86] Get Person detail pages via GraphQL, resolves #27 --- app/appConf/routes.php | 3 +- app/templates/single-tab.php | 5 + app/views/anime/details.php | 2 +- app/views/character/details.php | 5 +- app/views/manga/details.php | 2 +- app/views/person/details.php | 16 +- frontEndSrc/css/src/components.css | 11 +- frontEndSrc/css/src/dark-override.css | 3 +- public/css/auto.min.css | 2 +- public/css/dark.min.css | 2 +- public/css/light.min.css | 2 +- src/AnimeClient/API/Kitsu/Model.php | 21 +- .../API/Kitsu/Queries/PersonDetails.graphql | 36 ++- .../Transformer/CharacterTransformer.php | 2 +- .../Kitsu/Transformer/PersonTransformer.php | 169 +++++++------ src/AnimeClient/API/Kitsu/schema.graphql | 224 +++++++++++++----- src/AnimeClient/Component/Tabs.php | 11 + src/AnimeClient/Controller/People.php | 7 +- src/AnimeClient/Types/Person.php | 24 +- 19 files changed, 349 insertions(+), 198 deletions(-) create mode 100644 app/templates/single-tab.php diff --git a/app/appConf/routes.php b/app/appConf/routes.php index 353c1e3d..48f3a357 100644 --- a/app/appConf/routes.php +++ b/app/appConf/routes.php @@ -186,9 +186,8 @@ $routes = [ ] ], 'person' => [ - 'path' => '/people/{id}{/slug}', + 'path' => '/people/{slug}', 'tokens' => [ - 'id' => SLUG_PATTERN, 'slug' => SLUG_PATTERN, ] ], diff --git a/app/templates/single-tab.php b/app/templates/single-tab.php new file mode 100644 index 00000000..0b2ceb53 --- /dev/null +++ b/app/templates/single-tab.php @@ -0,0 +1,5 @@ +
+ $tabData): ?> + + +
\ No newline at end of file diff --git a/app/views/anime/details.php b/app/views/anime/details.php index 72b1f8ca..161c02ee 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -186,7 +186,7 @@ use function Aviat\AnimeClient\getLocalImg; } $rendered[] = $component->character( $person['name'], - $url->generate('person', ['id' => $person['id'], 'slug' => $person['slug']]), + $url->generate('person', ['slug' => $person['slug']]), $helper->picture(getLocalImg($person['image']['original'] ?? NULL)), 'character small-person', ); diff --git a/app/views/character/details.php b/app/views/character/details.php index d4db6384..842da727 100644 --- a/app/views/character/details.php +++ b/app/views/character/details.php @@ -120,10 +120,7 @@ use Aviat\AnimeClient\Kitsu; foreach ($casting as $id => $c): $person = $component->character( $c['person']['name'], - $url->generate('person', [ - 'id' => $c['person']['id'], - 'slug' => $c['person']['slug'] - ]), + $url->generate('person', ['slug' => $c['person']['slug']]), $helper->picture(getLocalImg($c['person']['image'])) ); $medias = array_map(fn ($series) => $component->media( diff --git a/app/views/manga/details.php b/app/views/manga/details.php index 8afe36c4..0df57deb 100644 --- a/app/views/manga/details.php +++ b/app/views/manga/details.php @@ -95,7 +95,7 @@ fn($people) => implode('', array_map( fn ($person) => $component->character( $person['name'], - $url->generate('person', ['id' => $person['id'], 'slug' => $person['slug']]), + $url->generate('person', ['slug' => $person['slug']]), $helper->picture("images/people/{$person['id']}.webp") ), $people diff --git a/app/views/person/details.php b/app/views/person/details.php index b2c20a28..fc868e22 100644 --- a/app/views/person/details.php +++ b/app/views/person/details.php @@ -1,6 +1,5 @@
@@ -9,6 +8,14 @@ use Aviat\AnimeClient\Kitsu;

+ +

+ +
+
+
+

', $data['description']) ?>

+
@@ -24,7 +31,6 @@ use Aviat\AnimeClient\Kitsu; type="radio" name="staff-roles" id="staff-role" /> $casting): ?> -

@@ -32,7 +38,7 @@ use Aviat\AnimeClient\Kitsu; $series): ?> media( - Kitsu::filterTitles($series), + $series['titles'], $url->generate("{$mediaType}.details", ['id' => $series['slug']]), $helper->picture("images/{$type}/{$sid}.webp") ) ?> @@ -46,7 +52,7 @@ use Aviat\AnimeClient\Kitsu; - +

Voice Acting Roles

tabs('voice-acting-roles', $data['characters'], static function ($characterList) use ($component, $helper, $url) { @@ -61,7 +67,7 @@ use Aviat\AnimeClient\Kitsu; foreach ($item['media'] as $sid => $series) { $medias[] = $component->media( - Kitsu::filterTitles($series), + $series['titles'], $url->generate('anime.details', ['id' => $series['slug']]), $helper->picture("images/anime/{$sid}.webp") ); diff --git a/frontEndSrc/css/src/components.css b/frontEndSrc/css/src/components.css index e50deaaf..f0181df2 100644 --- a/frontEndSrc/css/src/components.css +++ b/frontEndSrc/css/src/components.css @@ -163,7 +163,7 @@ CSS Tabs /* text-align: center; */ } -.tabs .content { +.tabs .content, .single-tab { display: none; max-height: 950px; border: 1px solid #e5e5e5; @@ -175,7 +175,14 @@ CSS Tabs overflow: auto; } -.tabs .content.full-height { +.single-tab { + display: block; + border: 1px solid #e5e5e5; + box-shadow: 0 48px 80px -32px rgba(0, 0, 0, 0.3); + margin-top: 1.5em; +} + +.tabs .content.full-height, .single-tab.full-height { max-height: none; } diff --git a/frontEndSrc/css/src/dark-override.css b/frontEndSrc/css/src/dark-override.css index 890b2e12..46dd8d67 100644 --- a/frontEndSrc/css/src/dark-override.css +++ b/frontEndSrc/css/src/dark-override.css @@ -147,7 +147,8 @@ button:active { .tabs > [type="radio"]:checked + label, .tabs > [type="radio"]:checked + label + .content, .vertical-tabs [type="radio"]:checked + label, -.vertical-tabs [type="radio"]:checked ~ .content { +.vertical-tabs [type="radio"]:checked ~ .content, +.single-tab { /* border-color: #333; */ border: 0; background: #666; diff --git a/public/css/auto.min.css b/public/css/auto.min.css index 9c8c3b0a..af1e63c3 100644 --- a/public/css/auto.min.css +++ b/public/css/auto.min.css @@ -1 +1 @@ -:root{--default-font-list:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--monospace-font-list:"Anonymous Pro","Fira Code",Menlo,Monaco,Consolas,"Courier New",monospace;--serif-font-list:Georgia,Times,"Times New Roman",serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);line-height:1.4;overflow-y:scroll;-moz-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}audio:not([controls]){display:none}details{display:block}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{margin:0 auto;padding:0 1.6rem 1.6rem}main,pre,summary{display:block}pre{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);font-size:1.4em;font-size:1.4rem;margin:1.6rem 0;overflow:auto;padding:1.6rem;word-break:break-all;word-wrap:break-word}progress{display:inline-block}small{color:#777;font-size:75%}big{font-size:125%}template{display:none}textarea{border:.1rem solid #ccc;border-radius:0;display:block;margin-bottom:.8rem;overflow:auto;padding:.8rem;resize:vertical;vertical-align:middle}[hidden]{display:none}[unselectable]{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit;margin:0;padding:0}:after,:before{text-decoration:inherit;vertical-align:inherit}a{-webkit-transition:.25s ease;color:#1271db;text-decoration:none;transition:.25s ease}audio,canvas,iframe,img,svg,video{vertical-align:middle}input,textarea{border:.1rem solid #ccc;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.4em}code,kbd,pre,samp{font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list)}table{border-collapse:collapse;border-spacing:0;margin-bottom:1.6rem}::-moz-selection{background-color:#b3d4fc;text-shadow:none}::selection{background-color:#b3d4fc;text-shadow:none}button::-moz-focus-inner{border:0}body{color:#444;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);font-size:1.6rem;font-style:normal;font-weight:400;padding:0}p{margin:0 0 1.6rem}h1,h2,h3,h4,h5,h6{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem}h1{border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem}h1,h2{font-style:normal;font-weight:500}h2{font-size:3em;font-size:3rem}h3{font-size:2.4em;font-size:2.4rem;font-style:normal;font-weight:500;margin:1.6rem 0 .4rem}h4{font-size:1.8em;font-size:1.8rem}h4,h5{font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}h5{font-size:1.6em;font-size:1.6rem}h6{color:#777;font-size:1.4em;font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}code,h6{font-size:1.4rem}code{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);word-break:break-all;word-wrap:break-word}a:focus,a:hover{text-decoration:none}dl{margin-bottom:1.6rem}dd{margin-left:4rem}ol,ul{margin-bottom:.8rem;padding-left:2rem}blockquote{border-left:.2rem solid #1271db;font-style:italic;margin:1.6rem 0;padding-left:1.6rem}blockquote,figcaption{font-family:Georgia,Times,Times New Roman,serif;font-family:var(--serif-font-list)}html{font-size:62.5%}article,aside,details,footer,header,main,section,summary{display:block;height:auto;margin:0 auto;width:100%}footer{clear:both;display:inline-block;float:left;max-width:100%;padding:1rem 0;text-align:center}footer,hr{border-top:.1rem solid rgba(0,0,0,.2)}hr{display:block;margin-bottom:1.6rem;width:100%}img{height:auto;vertical-align:baseline}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{border:.1rem solid #ccc;border-radius:0;display:inline-block;padding:.8rem;vertical-align:middle}input:not([type]){-webkit-appearance:none;background-clip:padding-box;background-color:#fff;border:.1rem solid #ccc;border-radius:0;color:#444;display:inline-block;padding:.8rem;text-align:left}input[type=color]{padding:.8rem 1.6rem}input:not([type]):focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{border-color:#b3d4fc}input[type=checkbox],input[type=radio]{vertical-align:middle}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:.1rem thin solid #444}input:not([type])[disabled],input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled],textarea[disabled]{background-color:#efefef;color:#777;cursor:not-allowed}input[readonly],textarea[readonly]{background-color:#efefef;border-color:#ccc;color:#777}input:focus:invalid,textarea:focus:invalid{border-color:#e9322d;color:#b94a48}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#ff4136}select[multiple]{height:auto}label{line-height:2}fieldset{border:0;margin:0;padding:.8rem 0}legend{border-bottom:.1rem solid #ccc;color:#444;display:block;margin-bottom:.8rem;padding:.8rem 0;width:100%}button,input[type=submit]{-moz-user-select:none;-ms-user-select:none;-webkit-transition:.25s ease;-webkit-user-drag:none;-webkit-user-select:none;border:.2rem solid #444;border-radius:0;color:#444;cursor:pointer;display:inline-block;margin-bottom:.8rem;margin-right:.4rem;padding:.8rem 1.6rem;text-align:center;text-decoration:none;text-transform:uppercase;transition:.25s ease;user-select:none;vertical-align:baseline}button a,input[type=submit] a{color:#444}button::-moz-focus-inner,input[type=submit]::-moz-focus-inner{padding:0}button:hover,input[type=submit]:hover{background:#444;border-color:#444;color:#fff}button:hover a,input[type=submit]:hover a{color:#fff}button:active,input[type=submit]:active{background:#6a6a6a;border-color:#6a6a6a;color:#fff}button:active a,input[type=submit]:active a{color:#fff}button:disabled,input[type=submit]:disabled{box-shadow:none;cursor:not-allowed;opacity:.4}nav ul{list-style:none;margin:0;padding:0;text-align:center}nav ul li{display:inline}nav a{-webkit-transition:.25s ease;border-bottom:.2rem solid transparent;color:#444;padding:.8rem 1.6rem;text-decoration:none;transition:.25s ease}nav a:hover,nav li.selected a{border-color:rgba(0,0,0,.2)}nav a:active{border-color:rgba(0,0,0,.56)}caption{padding:.8rem 0}thead th{background:#efefef;color:#444}tr{background:#fff;margin-bottom:.8rem}td,th{border:.1rem solid #ccc;padding:.8rem 1.6rem;text-align:center;vertical-align:inherit}tfoot tr{background:none}tfoot td{color:#efefef;font-size:.8rem;font-style:italic;padding:1.6rem .4rem}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0)!important;position:absolute!important}}@media screen and max-width 40rem{article,aside,section{clear:both;display:block;max-width:100%}img{margin-right:1.6rem}}:root{--blue-link:#1271db;--link-shadow:1px 1px 1px #000;--white-link-shadow:1px 1px 1px #fff;--shadow:2px 2px 2px #000;--title-overlay:rgba(0,0,0,0.45);--title-overlay-fallback:#000;--text-color:#fff;--normal-padding:0.25em 0.125em;--link-hover-color:#7d12db;--edit-link-hover-color:#db7d12;--edit-link-color:#12db18;--radius:5px}.media[hidden],[hidden=hidden],template{display:none}body{margin:.5em}button{background:#fff;background:linear-gradient(#ddd,#eee,#fff,#eee,#ddd);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#555;color:#555}button:hover{background:#bbb;background:linear-gradient(#cfcfcf,#dfdfdf,#efefef,#dfdfdf,#cfcfcf)}button:active{background:#ddd;background:linear-gradient(#ddd,#ddd)}.media:hover button{background:linear-gradient(#bbb,#ccc,#ddd,#ccc,#bbb)}.media:hover button:hover{background:linear-gradient(#afafaf,#bfbfbf,#cfcfcf,#bfbfbf,#afafaf)}table{box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto}td{padding:1rem}thead td,thead th{padding:.5rem}input[type=number]{min-width:0;width:4.5em}input[type=checkbox],input[type=radio]{min-width:auto;vertical-align:inherit}input,textarea{min-width:30em;min-width:30rem}tbody>tr:nth-child(odd){background:#ddd}a:active,a:hover{color:#7d12db;color:var(--link-hover-color)}iframe{display:block;margin:0 auto}.bracketed{color:#12db18;color:var(--edit-link-color)}#main-nav a,.bracketed{text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}.bracketed:before{content:"[\00a0"}.bracketed:after{content:"\00a0]"}.bracketed:active,.bracketed:hover{color:#db7d12;color:var(--edit-link-hover-color)}.grow-1{flex-grow:1}.flex-wrap{flex-wrap:wrap}.flex-no-wrap{flex-wrap:nowrap}.flex-align-start{align-content:flex-start}.flex-align-end{align-items:flex-end}.flex-align-space-around{align-content:space-around}.flex-justify-start{justify-content:flex-start}.flex-justify-space-around{justify-content:space-around}.flex-center{justify-content:center}.flex-self-center{align-self:center}.flex-space-evenly{justify-content:space-evenly}.flex{display:inline-block;display:flex}.small-font{font-size:1.6rem}.justify{text-align:justify}.align-center{text-align:center!important}.align-left{text-align:left!important}.align-right{text-align:right!important}.valign-top{vertical-align:top}.no-border{border:none}.media-wrap{text-align:center;margin:0 auto;position:relative}.media-wrap-flex{display:inline-block;display:flex;flex-wrap:wrap;align-content:space-evenly;justify-content:space-between;position:relative}td .media-wrap-flex{justify-content:center}.danger{background-color:#ff4136;border-color:#924949;color:#924949}.danger:active,.danger:hover{background-color:#924949;border-color:#ff4136;color:#ff4136}td.danger,td.danger:active,td.danger:hover{background-color:transparent;color:#924949}.user-btn{background:transparent;border-color:#12db18;border-color:var(--edit-link-color);color:#12db18;color:var(--edit-link-color);text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow);padding:0 .5rem}.user-btn:active,.user-btn:hover{background:transparent;border-color:#db7d12;border-color:var(--edit-link-hover-color);color:#db7d12;color:var(--edit-link-hover-color)}.user-btn:active{background:#db7d12;background:var(--edit-link-hover-color);color:#fff}.full-width{width:100%}.full-height{max-height:none}.toph{margin-top:0}#main-nav{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem;border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem;font-style:normal;font-weight:500}.sorting,.sorting-asc,.sorting-desc{vertical-align:text-bottom}.sorting:before{content:" ↕\00a0"}.sorting-asc:before{content:" ↑\00a0"}.sorting-desc:before{content:" ↓\00a0"}.form thead th,.form thead tr{background:inherit;border:0}.form tr>td:nth-child(odd){text-align:right;min-width:25px;max-width:30%}.form tr>td:nth-child(2n){text-align:left}.invisible tbody>tr:nth-child(odd){background:inherit}.borderless,.borderless td,.borderless th,.borderless tr,.invisible td,.invisible th,.invisible tr{box-shadow:none;border:0}.message,.static-message{position:relative;margin:.5em auto;padding:.5em;width:95%}.message .close{width:1em;height:1em;position:absolute;right:.5em;top:.5em;text-align:center;vertical-align:middle;line-height:1em}.message:hover .close:after{content:"☒"}.message:hover{cursor:pointer}.message .icon{left:.5em;top:.5em;margin-right:1em}.message.error,.static-message.error{border:1px solid #924949;background:#f3e6e6}.message.error .icon:after{content:"✘"}.message.success,.static-message.success{border:1px solid #1f8454;background:#70dda9}.message.success .icon:after{content:"✔"}.message.info,.static-message.info{border:1px solid #bfbe3a;background:#ffc}.message.info .icon:after{content:"⚠"}.character,.media,.small-character{position:relative;vertical-align:top;display:inline-block;text-align:center;width:220px;height:312px;margin:.25em .125em;margin:var(--normal-padding);z-index:0;background:rgba(0,0,0,.15)}.details picture.cover,picture.cover{display:inline;display:initial;width:100%}.character>img,.media>img,.small-character>img{width:100%}.media .edit-buttons>button{margin:.5em auto}.media-metadata>div,.medium-metadata>div,.name,.row{text-shadow:2px 2px 2px #000;text-shadow:var(--shadow);color:#fff;color:var(--text-color);padding:.25em .125em;padding:var(--normal-padding);text-align:right;z-index:2}.age-rating,.media-type{text-align:left}.media>.media-metadata{position:absolute;bottom:0;right:0}.media>.medium-metadata{position:absolute;bottom:0;left:0}.media>.name{position:absolute;top:0}.media>.name a{display:inline-block;transition:none}.media .name a:before{content:"";display:block;height:312px;left:0;position:absolute;top:0;width:220px;z-index:-1}.media-list .media:hover .name a:before{background:rgba(0,0,0,.75)}.media>.name span.canonical{font-weight:700}.media>.name small{font-weight:400}.media:hover .name{background:rgba(0,0,0,.75)}.media-list .media>.name a:hover,.media-list .media>.name a:hover small{color:#1271db;color:var(--blue-link)}.media:hover>.edit-buttons[hidden],.media:hover>button[hidden]{transition:.25s ease;display:block}.media:hover{transition:.25s ease}.character>.name a,.character>.name a small,.media>.name a,.media>.name a small,.small-character>.name a,.small-character>.name a small{background:none;color:#fff;text-shadow:2px 2px 2px #000;text-shadow:var(--shadow)}.anime .name,.manga .name{background:#000;background:var(--title-overlay-fallback);background:rgba(0,0,0,.45);background:var(--title-overlay);text-align:center;width:100%;padding:.5em .25em}.anime .age-rating,.anime .airing-status,.anime .completion,.anime .delete,.anime .edit,.anime .media-type,.anime .user-rating{background:none;text-align:center}.anime .table,.manga .table{position:absolute;bottom:0;left:0;width:100%}.anime .row,.manga .row{width:100%;display:inline-block;display:flex;align-content:space-around;justify-content:space-around;text-align:center;padding:0 inherit}.anime .row>span,.manga .row>span{text-align:left;z-index:2}.anime .row>div,.manga .row>div{font-size:.8em;display:inline-block;display:flex-item;align-self:center;text-align:center;vertical-align:middle;z-index:2}.anime .media>button.plus-one{border-color:hsla(0,0%,100%,.65);position:absolute;top:138px;top:calc(50% - 21.2px);left:44px;left:calc(50% - 57.8px);z-index:50}.manga .row{padding:1px}.manga .media{height:310px;margin:.25em}.manga .media>.edit-buttons{position:absolute;top:86px;top:calc(50% - 21.2px);left:43.5px;left:calc(50% - 57.8px);z-index:40}.manga .media>.edit-buttons button{border-color:hsla(0,0%,100%,.65)}.media.search>.name{background-color:#555;background-color:rgba(0,0,0,.35);background-size:cover;background-size:contain;background-repeat:no-repeat}.media.search>.row{z-index:6}.big-check,.mal-check{display:none}.big-check:checked+label{transition:.25s ease;background:rgba(0,0,0,.75)}.big-check:checked+label:after{content:"✓";font-size:15em;font-size:15rem;text-align:center;color:#adff2f;position:absolute;top:147px;left:0;width:100%;z-index:5}#series-list article.media{position:relative}#series-list .name,#series-list .name label{position:absolute;display:block;top:0;left:0;height:100%;width:100%;vertical-align:middle;line-height:1.25em}#series-list .name small{color:#fff}.details{margin:1.5rem auto 0;padding:1rem;font-size:inherit}.fixed{max-width:115em;max-width:115rem;margin:0 auto}.details .cover{display:block}.details .flex>*{margin:1rem}.details .media-details td{padding:0 1.5rem}.details p{text-align:justify}.details .media-details td:nth-child(odd){width:1%;white-space:nowrap;text-align:right}.details .media-details td:nth-child(2n){text-align:left}.details a h1,.details a h2{margin-top:0}.character,.person,.small-character{width:225px;height:350px;vertical-align:middle;white-space:nowrap;position:relative}.person{width:225px;height:338px}.small-person{width:200px;height:300px}.character a{height:350px}.character:hover .name,.small-character:hover .name{background:rgba(0,0,0,.8)}.small-character a{display:inline-block;width:100%;height:100%}.character .name,.small-character .name{position:absolute;bottom:0;left:0;z-index:10}.character img,.character picture,.person img,.person picture,.small-character img,.small-character picture{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;max-height:350px;max-width:225px}.person img,.person picture{max-height:338px}.small-person img,.small-person picture{max-height:300px;max-width:200px}.min-table{min-width:0;margin-left:0}.max-table{min-width:100%;margin:0}aside.info{max-width:33%}.fixed aside{max-width:390px}aside img,aside picture{display:block;margin:0 auto}.small-character{width:160px;height:250px}.small-character img,.small-character picture{max-height:250px;max-width:160px}.user-page .media-wrap{text-align:left}.media a{display:inline-block;width:100%;height:100%}.streaming-logo{width:50px;height:50px;vertical-align:middle}.small-streaming-logo{width:25px;height:25px;vertical-align:middle}.cover-streaming-link{display:none}.media:hover .cover-streaming-link{display:block}.cover-streaming-link .streaming-logo{width:20px;height:20px;-webkit-filter:drop-shadow(0 -1px 4px #fff);filter:drop-shadow(0 -1px 4px #fff)}.history-img{width:110px;height:156px}.settings.form .content article{margin:1em;display:inline-block;width:auto}.responsive-iframe{margin-top:1em;overflow:hidden;padding-bottom:56.25%;position:relative;height:0}.responsive-iframe iframe{left:0;top:0;height:100%;width:100%;position:absolute}.cssload-loader{position:relative;left:calc(50% - 31px);width:62px;height:62px;border-radius:50%;perspective:780px}.cssload-inner{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:50%}.cssload-inner.cssload-one{left:0;top:0;-webkit-animation:cssload-rotate-one 1.15s linear infinite;animation:cssload-rotate-one 1.15s linear infinite;border-bottom:3px solid #000}.cssload-inner.cssload-two{right:0;top:0;-webkit-animation:cssload-rotate-two 1.15s linear infinite;animation:cssload-rotate-two 1.15s linear infinite;border-right:3px solid #000}.cssload-inner.cssload-three{right:0;bottom:0;-webkit-animation:cssload-rotate-three 1.15s linear infinite;animation:cssload-rotate-three 1.15s linear infinite;border-top:3px solid #000}@-webkit-keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}@keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}#loading-shadow{background:rgba(0,0,0,.8);z-index:500}#loading-shadow,#loading-shadow .loading-wrapper{position:fixed;top:0;left:0;width:100%;height:100%}#loading-shadow .loading-wrapper{z-index:501;display:flex;align-items:center;justify-content:center}#loading-shadow .loading-content{position:relative;color:#fff}.loading-content .cssload-inner.cssload-one,.loading-content .cssload-inner.cssload-three,.loading-content .cssload-inner.cssload-two{border-color:#fff}.tabs{display:inline-block;display:flex;flex-wrap:wrap;background:#efefef;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.tabs>label{border:1px solid #e5e5e5;width:100%;padding:20px 30px;background:#e5e5e5;cursor:pointer;font-weight:700;font-size:18px;color:#7f7f7f;transition:background .1s,color .1s}.tabs>label:hover{background:#d8d8d8}.tabs>label:active{background:#ccc}.tabs>[type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.tabs>[type=radio]{position:absolute;opacity:0}.tabs>[type=radio]:checked+label{border-bottom:1px solid #fff;background:#fff;color:#000}.tabs>[type=radio]:checked+label+.content{display:block}.tabs .content,.tabs>[type=radio]:checked+label+.content{border:1px solid #e5e5e5;border-top:0;padding:15px;background:#fff;width:100%;margin:0 auto;overflow:auto}.tabs .content{display:none;max-height:950px}.tabs .content.full-height{max-height:none}@media (min-width:800px){.tabs>label{width:auto}.tabs .content{order:99}}.vertical-tabs{border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto;position:relative;width:100%}.vertical-tabs input[type=radio]{position:absolute;opacity:0}.vertical-tabs .tab{align-items:center;display:inline-block;display:flex;flex-wrap:nowrap}.vertical-tabs .tab label{align-items:center;background:#e5e5e5;border:1px solid #e5e5e5;color:#7f7f7f;cursor:pointer;font-size:18px;font-weight:700;padding:0 20px;width:28%}.vertical-tabs .tab label:hover{background:#d8d8d8}.vertical-tabs .tab label:active{background:#ccc}.vertical-tabs .tab .content{display:none;border:1px solid #e5e5e5;border-left:0;border-right:0;max-height:950px;overflow:auto}.vertical-tabs .tab .content.full-height{max-height:none}.vertical-tabs [type=radio]:checked+label{border:0;background:#fff;color:#000;width:38%}.vertical-tabs [type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.vertical-tabs [type=radio]:checked~.content{display:block}@media screen and (max-width:1100px){.flex{flex-wrap:wrap}.fixed aside.info,.fixed aside.info+article,aside.info,aside.info+article{max-width:none;width:100%}}@media screen and (max-width:800px){*{max-width:none}table{box-shadow:none}.details .flex>*,body{margin:0}table,table.align-center,table .align-right,table td,table th{border:0;margin-left:auto;margin-right:auto;text-align:left;width:100%}table td{display:inline-block}table.media-details,table tbody{width:100%}table.media-details td{display:block;text-align:left!important;width:100%}table thead{display:none}.details .media-details td:nth-child(odd){font-weight:700;width:100%}table.streaming-links tr td:not(:first-child){display:none}}@media screen and (max-width:40em){nav a{line-height:4em;line-height:4rem}img,picture{width:100%}main{padding:0 .5rem .5rem}.media{margin:2px 0}.details{padding:.5rem}.tabs>[type=radio]:checked+label{background:#fff}.vertical-tabs .tab{flex-wrap:wrap}.tabs .content,.tabs>[type=radio]:checked+label+.content,.vertical-tabs .tab .content{display:block;border:0;max-height:none}.tabs>[type=radio]:checked+label,.tabs>label,.tabs>label:active,.tabs>label:hover,.vertical-tabs .tab label,.vertical-tabs .tab label:active,.vertical-tabs .tab label:hover,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:focus+label{background:#fff;border:0;width:100%;cursor:default;color:#000}} @media (prefers-color-scheme: dark) { a{color:#1978e2;text-shadow:var(--link-shadow)}a:hover{color:#9e34fd}body,legend,nav ul li a{background:#333;color:#eee}nav a:hover,nav li.selected a{border-color:#fff}header button{background:transparent}table{box-shadow:none}td,th{border-color:#111}thead td,thead th{background:#333;color:#eee}tbody>tr:nth-child(2n){background:#555;color:#eee}tbody>tr:nth-child(odd){background:#333}footer,hr,legend{border-color:#ddd}small{color:#fff}input,input[type],select,textarea{border-color:#bbb;color:#bbb;background:#333;padding:.8em}button{background:#444;background:linear-gradient(#666,#555,#444,#555,#666);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#ddd;color:#ddd}button:hover{background:#222;background:linear-gradient(#444,#333,#222,#333,#444)}button:active{background:#333;background:linear-gradient(#333,#333)}.media:hover button{background:linear-gradient(#666,#555,#444,#555,#666)}.media:hover button:hover{background:linear-gradient(#444,#555,#666,#555,#444)}.message,.static-message{text-shadow:var(--white-link-shadow)}.message.success,.static-message.success{background:#1f8454;border-color:#70dda9}.message.error,.static-message.error{border-color:#f3e6e6;background:#924949}.message.info,.static-message.info{border-color:#ffc;background:#bfbe3a}.invisible tbody>tr:nth-child(2n),.invisible tbody>tr:nth-child(odd),.invisible td,.invisible th,.invisible tr{background:transparent}#main-nav{border-bottom:.1rem solid #ddd}.tabs,.vertical-tabs{background:#333}.tabs>label,.vertical-tabs .tab label{background:#222;border:0;color:#eee}.vertical-tabs .tab label{width:100%}.tabs>label:hover,.vertical-tabs .tab>label:hover{background:#888}.tabs>label:active,.vertical-tabs .tab>label:active{background:#999}.tabs>[type=radio]:checked+label,.tabs>[type=radio]:checked+label+.content,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:checked~.content{border:0;background:#666;color:#eee}.vertical-tabs{background:#222;border:1px solid #444}.vertical-tabs .tab{background:#666;border-bottom:1px solid #444}.streaming-logo{-webkit-filter:drop-shadow(0 0 2px #fff);filter:drop-shadow(0 0 2px #fff)} } \ No newline at end of file +:root{--default-font-list:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--monospace-font-list:"Anonymous Pro","Fira Code",Menlo,Monaco,Consolas,"Courier New",monospace;--serif-font-list:Georgia,Times,"Times New Roman",serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);line-height:1.4;overflow-y:scroll;-moz-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}audio:not([controls]){display:none}details{display:block}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{margin:0 auto;padding:0 1.6rem 1.6rem}main,pre,summary{display:block}pre{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);font-size:1.4em;font-size:1.4rem;margin:1.6rem 0;overflow:auto;padding:1.6rem;word-break:break-all;word-wrap:break-word}progress{display:inline-block}small{color:#777;font-size:75%}big{font-size:125%}template{display:none}textarea{border:.1rem solid #ccc;border-radius:0;display:block;margin-bottom:.8rem;overflow:auto;padding:.8rem;resize:vertical;vertical-align:middle}[hidden]{display:none}[unselectable]{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit;margin:0;padding:0}:after,:before{text-decoration:inherit;vertical-align:inherit}a{-webkit-transition:.25s ease;color:#1271db;text-decoration:none;transition:.25s ease}audio,canvas,iframe,img,svg,video{vertical-align:middle}input,textarea{border:.1rem solid #ccc;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.4em}code,kbd,pre,samp{font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list)}table{border-collapse:collapse;border-spacing:0;margin-bottom:1.6rem}::-moz-selection{background-color:#b3d4fc;text-shadow:none}::selection{background-color:#b3d4fc;text-shadow:none}button::-moz-focus-inner{border:0}body{color:#444;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);font-size:1.6rem;font-style:normal;font-weight:400;padding:0}p{margin:0 0 1.6rem}h1,h2,h3,h4,h5,h6{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem}h1{border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem}h1,h2{font-style:normal;font-weight:500}h2{font-size:3em;font-size:3rem}h3{font-size:2.4em;font-size:2.4rem;font-style:normal;font-weight:500;margin:1.6rem 0 .4rem}h4{font-size:1.8em;font-size:1.8rem}h4,h5{font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}h5{font-size:1.6em;font-size:1.6rem}h6{color:#777;font-size:1.4em;font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}code,h6{font-size:1.4rem}code{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);word-break:break-all;word-wrap:break-word}a:focus,a:hover{text-decoration:none}dl{margin-bottom:1.6rem}dd{margin-left:4rem}ol,ul{margin-bottom:.8rem;padding-left:2rem}blockquote{border-left:.2rem solid #1271db;font-style:italic;margin:1.6rem 0;padding-left:1.6rem}blockquote,figcaption{font-family:Georgia,Times,Times New Roman,serif;font-family:var(--serif-font-list)}html{font-size:62.5%}article,aside,details,footer,header,main,section,summary{display:block;height:auto;margin:0 auto;width:100%}footer{clear:both;display:inline-block;float:left;max-width:100%;padding:1rem 0;text-align:center}footer,hr{border-top:.1rem solid rgba(0,0,0,.2)}hr{display:block;margin-bottom:1.6rem;width:100%}img{height:auto;vertical-align:baseline}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{border:.1rem solid #ccc;border-radius:0;display:inline-block;padding:.8rem;vertical-align:middle}input:not([type]){-webkit-appearance:none;background-clip:padding-box;background-color:#fff;border:.1rem solid #ccc;border-radius:0;color:#444;display:inline-block;padding:.8rem;text-align:left}input[type=color]{padding:.8rem 1.6rem}input:not([type]):focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{border-color:#b3d4fc}input[type=checkbox],input[type=radio]{vertical-align:middle}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:.1rem thin solid #444}input:not([type])[disabled],input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled],textarea[disabled]{background-color:#efefef;color:#777;cursor:not-allowed}input[readonly],textarea[readonly]{background-color:#efefef;border-color:#ccc;color:#777}input:focus:invalid,textarea:focus:invalid{border-color:#e9322d;color:#b94a48}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#ff4136}select[multiple]{height:auto}label{line-height:2}fieldset{border:0;margin:0;padding:.8rem 0}legend{border-bottom:.1rem solid #ccc;color:#444;display:block;margin-bottom:.8rem;padding:.8rem 0;width:100%}button,input[type=submit]{-moz-user-select:none;-ms-user-select:none;-webkit-transition:.25s ease;-webkit-user-drag:none;-webkit-user-select:none;border:.2rem solid #444;border-radius:0;color:#444;cursor:pointer;display:inline-block;margin-bottom:.8rem;margin-right:.4rem;padding:.8rem 1.6rem;text-align:center;text-decoration:none;text-transform:uppercase;transition:.25s ease;user-select:none;vertical-align:baseline}button a,input[type=submit] a{color:#444}button::-moz-focus-inner,input[type=submit]::-moz-focus-inner{padding:0}button:hover,input[type=submit]:hover{background:#444;border-color:#444;color:#fff}button:hover a,input[type=submit]:hover a{color:#fff}button:active,input[type=submit]:active{background:#6a6a6a;border-color:#6a6a6a;color:#fff}button:active a,input[type=submit]:active a{color:#fff}button:disabled,input[type=submit]:disabled{box-shadow:none;cursor:not-allowed;opacity:.4}nav ul{list-style:none;margin:0;padding:0;text-align:center}nav ul li{display:inline}nav a{-webkit-transition:.25s ease;border-bottom:.2rem solid transparent;color:#444;padding:.8rem 1.6rem;text-decoration:none;transition:.25s ease}nav a:hover,nav li.selected a{border-color:rgba(0,0,0,.2)}nav a:active{border-color:rgba(0,0,0,.56)}caption{padding:.8rem 0}thead th{background:#efefef;color:#444}tr{background:#fff;margin-bottom:.8rem}td,th{border:.1rem solid #ccc;padding:.8rem 1.6rem;text-align:center;vertical-align:inherit}tfoot tr{background:none}tfoot td{color:#efefef;font-size:.8rem;font-style:italic;padding:1.6rem .4rem}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0)!important;position:absolute!important}}@media screen and max-width 40rem{article,aside,section{clear:both;display:block;max-width:100%}img{margin-right:1.6rem}}:root{--blue-link:#1271db;--link-shadow:1px 1px 1px #000;--white-link-shadow:1px 1px 1px #fff;--shadow:2px 2px 2px #000;--title-overlay:rgba(0,0,0,0.45);--title-overlay-fallback:#000;--text-color:#fff;--normal-padding:0.25em 0.125em;--link-hover-color:#7d12db;--edit-link-hover-color:#db7d12;--edit-link-color:#12db18;--radius:5px}.media[hidden],[hidden=hidden],template{display:none}body{margin:.5em}button{background:#fff;background:linear-gradient(#ddd,#eee,#fff,#eee,#ddd);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#555;color:#555}button:hover{background:#bbb;background:linear-gradient(#cfcfcf,#dfdfdf,#efefef,#dfdfdf,#cfcfcf)}button:active{background:#ddd;background:linear-gradient(#ddd,#ddd)}.media:hover button{background:linear-gradient(#bbb,#ccc,#ddd,#ccc,#bbb)}.media:hover button:hover{background:linear-gradient(#afafaf,#bfbfbf,#cfcfcf,#bfbfbf,#afafaf)}table{box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto}td{padding:1rem}thead td,thead th{padding:.5rem}input[type=number]{min-width:0;width:4.5em}input[type=checkbox],input[type=radio]{min-width:auto;vertical-align:inherit}input,textarea{min-width:30em;min-width:30rem}tbody>tr:nth-child(odd){background:#ddd}a:active,a:hover{color:#7d12db;color:var(--link-hover-color)}iframe{display:block;margin:0 auto;border:0}.bracketed{color:#12db18;color:var(--edit-link-color)}#main-nav a,.bracketed{text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}.bracketed:before{content:"[\00a0"}.bracketed:after{content:"\00a0]"}.bracketed:active,.bracketed:hover{color:#db7d12;color:var(--edit-link-hover-color)}.grow-1{flex-grow:1}.flex-wrap{flex-wrap:wrap}.flex-no-wrap{flex-wrap:nowrap}.flex-align-start{align-content:flex-start}.flex-align-end{align-items:flex-end}.flex-align-space-around{align-content:space-around}.flex-justify-start{justify-content:flex-start}.flex-justify-space-around{justify-content:space-around}.flex-center{justify-content:center}.flex-self-center{align-self:center}.flex-space-evenly{justify-content:space-evenly}.flex{display:inline-block;display:flex}.small-font{font-size:1.6rem}.justify{text-align:justify}.align-center{text-align:center!important}.align-left{text-align:left!important}.align-right{text-align:right!important}.valign-top{vertical-align:top}.no-border{border:none}.media-wrap{text-align:center;margin:0 auto;position:relative}.media-wrap-flex{display:inline-block;display:flex;flex-wrap:wrap;align-content:space-evenly;justify-content:space-between;position:relative}td .media-wrap-flex{justify-content:center}.danger{background-color:#ff4136;border-color:#924949;color:#924949}.danger:active,.danger:hover{background-color:#924949;border-color:#ff4136;color:#ff4136}td.danger,td.danger:active,td.danger:hover{background-color:transparent;color:#924949}.user-btn{background:transparent;border-color:#12db18;border-color:var(--edit-link-color);color:#12db18;color:var(--edit-link-color);text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow);padding:0 .5rem}.user-btn:active,.user-btn:hover{background:transparent;border-color:#db7d12;border-color:var(--edit-link-hover-color);color:#db7d12;color:var(--edit-link-hover-color)}.user-btn:active{background:#db7d12;background:var(--edit-link-hover-color);color:#fff}.full-width{width:100%}.full-height{max-height:none}.toph{margin-top:0}#main-nav{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem;border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem;font-style:normal;font-weight:500}.sorting,.sorting-asc,.sorting-desc{vertical-align:text-bottom}.sorting:before{content:" ↕\00a0"}.sorting-asc:before{content:" ↑\00a0"}.sorting-desc:before{content:" ↓\00a0"}.form thead th,.form thead tr{background:inherit;border:0}.form tr>td:nth-child(odd){text-align:right;min-width:25px;max-width:30%}.form tr>td:nth-child(2n){text-align:left}.invisible tbody>tr:nth-child(odd){background:inherit}.borderless,.borderless td,.borderless th,.borderless tr,.invisible td,.invisible th,.invisible tr{box-shadow:none;border:0}.message,.static-message{position:relative;margin:.5em auto;padding:.5em;width:95%}.message .close{width:1em;height:1em;position:absolute;right:.5em;top:.5em;text-align:center;vertical-align:middle;line-height:1em}.message:hover .close:after{content:"☒"}.message:hover{cursor:pointer}.message .icon{left:.5em;top:.5em;margin-right:1em}.message.error,.static-message.error{border:1px solid #924949;background:#f3e6e6}.message.error .icon:after{content:"✘"}.message.success,.static-message.success{border:1px solid #1f8454;background:#70dda9}.message.success .icon:after{content:"✔"}.message.info,.static-message.info{border:1px solid #bfbe3a;background:#ffc}.message.info .icon:after{content:"⚠"}.character,.media,.small-character{position:relative;vertical-align:top;display:inline-block;text-align:center;width:220px;height:312px;margin:.25em .125em;margin:var(--normal-padding);z-index:0;background:rgba(0,0,0,.15)}.details picture.cover,picture.cover{display:inline;display:initial;width:100%}.character>img,.media>img,.small-character>img{width:100%}.media .edit-buttons>button{margin:.5em auto}.media-metadata>div,.medium-metadata>div,.name,.row{text-shadow:2px 2px 2px #000;text-shadow:var(--shadow);color:#fff;color:var(--text-color);padding:.25em .125em;padding:var(--normal-padding);text-align:right;z-index:2}.age-rating,.media-type{text-align:left}.media>.media-metadata{position:absolute;bottom:0;right:0}.media>.medium-metadata{position:absolute;bottom:0;left:0}.media>.name{position:absolute;top:0}.media>.name a{display:inline-block;transition:none}.media .name a:before{content:"";display:block;height:312px;left:0;position:absolute;top:0;width:220px;z-index:-1}.media-list .media:hover .name a:before{background:rgba(0,0,0,.75)}.media>.name span.canonical{font-weight:700}.media>.name small{font-weight:400}.media:hover .name{background:rgba(0,0,0,.75)}.media-list .media>.name a:hover,.media-list .media>.name a:hover small{color:#1271db;color:var(--blue-link)}.media:hover>.edit-buttons[hidden],.media:hover>button[hidden]{transition:.25s ease;display:block}.media:hover{transition:.25s ease}.character>.name a,.character>.name a small,.media>.name a,.media>.name a small,.small-character>.name a,.small-character>.name a small{background:none;color:#fff;text-shadow:2px 2px 2px #000;text-shadow:var(--shadow)}.anime .name,.manga .name{background:#000;background:var(--title-overlay-fallback);background:rgba(0,0,0,.45);background:var(--title-overlay);text-align:center;width:100%;padding:.5em .25em}.anime .age-rating,.anime .airing-status,.anime .completion,.anime .delete,.anime .edit,.anime .media-type,.anime .user-rating{background:none;text-align:center}.anime .table,.manga .table{position:absolute;bottom:0;left:0;width:100%}.anime .row,.manga .row{width:100%;display:inline-block;display:flex;align-content:space-around;justify-content:space-around;text-align:center;padding:0 inherit}.anime .row>span,.manga .row>span{text-align:left;z-index:2}.anime .row>div,.manga .row>div{font-size:.8em;display:inline-block;display:flex-item;align-self:center;text-align:center;vertical-align:middle;z-index:2}.anime .media>button.plus-one{border-color:hsla(0,0%,100%,.65);position:absolute;top:138px;top:calc(50% - 21.2px);left:44px;left:calc(50% - 57.8px);z-index:50}.manga .row{padding:1px}.manga .media{height:310px;margin:.25em}.manga .media>.edit-buttons{position:absolute;top:86px;top:calc(50% - 21.2px);left:43.5px;left:calc(50% - 57.8px);z-index:40}.manga .media>.edit-buttons button{border-color:hsla(0,0%,100%,.65)}.media.search>.name{background-color:#555;background-color:rgba(0,0,0,.35);background-size:cover;background-size:contain;background-repeat:no-repeat}.media.search>.row{z-index:6}.big-check,.mal-check{display:none}.big-check:checked+label{transition:.25s ease;background:rgba(0,0,0,.75)}.big-check:checked+label:after{content:"✓";font-size:15em;font-size:15rem;text-align:center;color:#adff2f;position:absolute;top:147px;left:0;width:100%;z-index:5}#series-list article.media{position:relative}#series-list .name,#series-list .name label{position:absolute;display:block;top:0;left:0;height:100%;width:100%;vertical-align:middle;line-height:1.25em}#series-list .name small{color:#fff}.details{margin:1.5rem auto 0;padding:1rem;font-size:inherit}.fixed{max-width:115em;max-width:115rem;margin:0 auto}.details .cover{display:block}.details .flex>*{margin:1rem}.details .media-details td{padding:0 1.5rem}.details p{text-align:justify}.details .media-details td:nth-child(odd){width:1%;white-space:nowrap;text-align:right}.details .media-details td:nth-child(2n){text-align:left}.details a h1,.details a h2{margin-top:0}.character,.person,.small-character{width:225px;height:350px;vertical-align:middle;white-space:nowrap;position:relative}.person{width:225px;height:338px}.small-person{width:200px;height:300px}.character a{height:350px}.character:hover .name,.small-character:hover .name{background:rgba(0,0,0,.8)}.small-character a{display:inline-block;width:100%;height:100%}.character .name,.small-character .name{position:absolute;bottom:0;left:0;z-index:10}.character img,.character picture,.person img,.person picture,.small-character img,.small-character picture{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;max-height:350px;max-width:225px}.person img,.person picture{max-height:338px}.small-person img,.small-person picture{max-height:300px;max-width:200px}.min-table{min-width:0;margin-left:0}.max-table{min-width:100%;margin:0}aside.info{max-width:33%}.fixed aside{max-width:390px}aside img,aside picture{display:block;margin:0 auto}.small-character{width:160px;height:250px}.small-character img,.small-character picture{max-height:250px;max-width:160px}.user-page .media-wrap{text-align:left}.media a{display:inline-block;width:100%;height:100%}.streaming-logo{width:50px;height:50px;vertical-align:middle}.small-streaming-logo{width:25px;height:25px;vertical-align:middle}.cover-streaming-link{display:none}.media:hover .cover-streaming-link{display:block}.cover-streaming-link .streaming-logo{width:20px;height:20px;-webkit-filter:drop-shadow(0 -1px 4px #fff);filter:drop-shadow(0 -1px 4px #fff)}.history-img{width:110px;height:156px}.settings.form .content article{margin:1em;display:inline-block;width:auto}.responsive-iframe{margin-top:1em;overflow:hidden;padding-bottom:56.25%;position:relative;height:0}.responsive-iframe iframe{left:0;top:0;height:100%;width:100%;position:absolute}.cssload-loader{position:relative;left:calc(50% - 31px);width:62px;height:62px;border-radius:50%;perspective:780px}.cssload-inner{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:50%}.cssload-inner.cssload-one{left:0;top:0;-webkit-animation:cssload-rotate-one 1.15s linear infinite;animation:cssload-rotate-one 1.15s linear infinite;border-bottom:3px solid #000}.cssload-inner.cssload-two{right:0;top:0;-webkit-animation:cssload-rotate-two 1.15s linear infinite;animation:cssload-rotate-two 1.15s linear infinite;border-right:3px solid #000}.cssload-inner.cssload-three{right:0;bottom:0;-webkit-animation:cssload-rotate-three 1.15s linear infinite;animation:cssload-rotate-three 1.15s linear infinite;border-top:3px solid #000}@-webkit-keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}@keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}#loading-shadow{background:rgba(0,0,0,.8);z-index:500}#loading-shadow,#loading-shadow .loading-wrapper{position:fixed;top:0;left:0;width:100%;height:100%}#loading-shadow .loading-wrapper{z-index:501;display:flex;align-items:center;justify-content:center}#loading-shadow .loading-content{position:relative;color:#fff}.loading-content .cssload-inner.cssload-one,.loading-content .cssload-inner.cssload-three,.loading-content .cssload-inner.cssload-two{border-color:#fff}.tabs{display:inline-block;display:flex;flex-wrap:wrap;background:#efefef;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.tabs>label{border:1px solid #e5e5e5;width:100%;padding:20px 30px;background:#e5e5e5;cursor:pointer;font-weight:700;font-size:18px;color:#7f7f7f;transition:background .1s,color .1s}.tabs>label:hover{background:#d8d8d8}.tabs>label:active{background:#ccc}.tabs>[type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.tabs>[type=radio]{position:absolute;opacity:0}.tabs>[type=radio]:checked+label{border-bottom:1px solid #fff;background:#fff;color:#000}.tabs>[type=radio]:checked+label+.content{display:block}.single-tab,.tabs .content,.tabs>[type=radio]:checked+label+.content{border:1px solid #e5e5e5;border-top:0;padding:15px;background:#fff;width:100%;margin:0 auto;overflow:auto}.single-tab,.tabs .content{display:none;max-height:950px}.single-tab{display:block;border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.single-tab.full-height,.tabs .content.full-height{max-height:none}@media (min-width:800px){.tabs>label{width:auto}.tabs .content{order:99}}.vertical-tabs{border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto;position:relative;width:100%}.vertical-tabs input[type=radio]{position:absolute;opacity:0}.vertical-tabs .tab{align-items:center;display:inline-block;display:flex;flex-wrap:nowrap}.vertical-tabs .tab label{align-items:center;background:#e5e5e5;border:1px solid #e5e5e5;color:#7f7f7f;cursor:pointer;font-size:18px;font-weight:700;padding:0 20px;width:28%}.vertical-tabs .tab label:hover{background:#d8d8d8}.vertical-tabs .tab label:active{background:#ccc}.vertical-tabs .tab .content{display:none;border:1px solid #e5e5e5;border-left:0;border-right:0;max-height:950px;overflow:auto}.vertical-tabs .tab .content.full-height{max-height:none}.vertical-tabs [type=radio]:checked+label{border:0;background:#fff;color:#000;width:38%}.vertical-tabs [type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.vertical-tabs [type=radio]:checked~.content{display:block}@media screen and (max-width:1100px){.flex{flex-wrap:wrap}.fixed aside.info,.fixed aside.info+article,aside.info,aside.info+article{max-width:none;width:100%}}@media screen and (max-width:800px){*{max-width:none}table{box-shadow:none}.details .flex>*,body{margin:0}table,table.align-center,table .align-right,table td,table th{border:0;margin-left:auto;margin-right:auto;text-align:left;width:100%}table td{display:inline-block}table.media-details,table tbody{width:100%}table.media-details td{display:block;text-align:left!important;width:100%}table thead{display:none}.details .media-details td:nth-child(odd){font-weight:700;width:100%}table.streaming-links tr td:not(:first-child){display:none}}@media screen and (max-width:40em){nav a{line-height:4em;line-height:4rem}img,picture{width:100%}main{padding:0 .5rem .5rem}.media{margin:2px 0}.details{padding:.5rem}.tabs>[type=radio]:checked+label{background:#fff}.vertical-tabs .tab{flex-wrap:wrap}.tabs .content,.tabs>[type=radio]:checked+label+.content,.vertical-tabs .tab .content{display:block;border:0;max-height:none}.tabs>[type=radio]:checked+label,.tabs>label,.tabs>label:active,.tabs>label:hover,.vertical-tabs .tab label,.vertical-tabs .tab label:active,.vertical-tabs .tab label:hover,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:focus+label{background:#fff;border:0;width:100%;cursor:default;color:#000}} @media (prefers-color-scheme: dark) { a{color:#1978e2;text-shadow:var(--link-shadow)}a:hover{color:#9e34fd}body,legend,nav ul li a{background:#333;color:#eee}nav a:hover,nav li.selected a{border-color:#fff}header button{background:transparent}table{box-shadow:none}td,th{border-color:#111}thead td,thead th{background:#333;color:#eee}tbody>tr:nth-child(2n){background:#555;color:#eee}tbody>tr:nth-child(odd){background:#333}footer,hr,legend{border-color:#ddd}small{color:#fff}input,input[type],select,textarea{border-color:#bbb;color:#bbb;background:#333;padding:.8em}button{background:#444;background:linear-gradient(#666,#555,#444,#555,#666);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#ddd;color:#ddd}button:hover{background:#222;background:linear-gradient(#444,#333,#222,#333,#444)}button:active{background:#333;background:linear-gradient(#333,#333)}.media:hover button{background:linear-gradient(#666,#555,#444,#555,#666)}.media:hover button:hover{background:linear-gradient(#444,#555,#666,#555,#444)}.message,.static-message{text-shadow:var(--white-link-shadow)}.message.success,.static-message.success{background:#1f8454;border-color:#70dda9}.message.error,.static-message.error{border-color:#f3e6e6;background:#924949}.message.info,.static-message.info{border-color:#ffc;background:#bfbe3a}.invisible tbody>tr:nth-child(2n),.invisible tbody>tr:nth-child(odd),.invisible td,.invisible th,.invisible tr{background:transparent}#main-nav{border-bottom:.1rem solid #ddd}.tabs,.vertical-tabs{background:#333}.tabs>label,.vertical-tabs .tab label{background:#222;border:0;color:#eee}.vertical-tabs .tab label{width:100%}.tabs>label:hover,.vertical-tabs .tab>label:hover{background:#888}.tabs>label:active,.vertical-tabs .tab>label:active{background:#999}.single-tab,.tabs>[type=radio]:checked+label,.tabs>[type=radio]:checked+label+.content,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:checked~.content{border:0;background:#666;color:#eee}.vertical-tabs{background:#222;border:1px solid #444}.vertical-tabs .tab{background:#666;border-bottom:1px solid #444}.streaming-logo{-webkit-filter:drop-shadow(0 0 2px #fff);filter:drop-shadow(0 0 2px #fff)} } \ No newline at end of file diff --git a/public/css/dark.min.css b/public/css/dark.min.css index 56639f74..9c38ae7a 100644 --- a/public/css/dark.min.css +++ b/public/css/dark.min.css @@ -1 +1 @@ -:root{--default-font-list:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--monospace-font-list:"Anonymous Pro","Fira Code",Menlo,Monaco,Consolas,"Courier New",monospace;--serif-font-list:Georgia,Times,"Times New Roman",serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);line-height:1.4;overflow-y:scroll;-moz-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}audio:not([controls]){display:none}details{display:block}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{margin:0 auto;padding:0 1.6rem 1.6rem}main,pre,summary{display:block}pre{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);font-size:1.4em;font-size:1.4rem;margin:1.6rem 0;overflow:auto;padding:1.6rem;word-break:break-all;word-wrap:break-word}progress{display:inline-block}small{color:#777;font-size:75%}big{font-size:125%}template{display:none}textarea{border:.1rem solid #ccc;border-radius:0;display:block;margin-bottom:.8rem;overflow:auto;padding:.8rem;resize:vertical;vertical-align:middle}[hidden]{display:none}[unselectable]{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit;margin:0;padding:0}:after,:before{text-decoration:inherit;vertical-align:inherit}a{-webkit-transition:.25s ease;color:#1271db;text-decoration:none;transition:.25s ease}audio,canvas,iframe,img,svg,video{vertical-align:middle}input,textarea{border:.1rem solid #ccc;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.4em}code,kbd,pre,samp{font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list)}table{border-collapse:collapse;border-spacing:0;margin-bottom:1.6rem}::-moz-selection{background-color:#b3d4fc;text-shadow:none}::selection{background-color:#b3d4fc;text-shadow:none}button::-moz-focus-inner{border:0}body{color:#444;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);font-size:1.6rem;font-style:normal;font-weight:400;padding:0}p{margin:0 0 1.6rem}h1,h2,h3,h4,h5,h6{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem}h1{border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem}h1,h2{font-style:normal;font-weight:500}h2{font-size:3em;font-size:3rem}h3{font-size:2.4em;font-size:2.4rem;font-style:normal;font-weight:500;margin:1.6rem 0 .4rem}h4{font-size:1.8em;font-size:1.8rem}h4,h5{font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}h5{font-size:1.6em;font-size:1.6rem}h6{color:#777;font-size:1.4em;font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}code,h6{font-size:1.4rem}code{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);word-break:break-all;word-wrap:break-word}a:focus,a:hover{text-decoration:none}dl{margin-bottom:1.6rem}dd{margin-left:4rem}ol,ul{margin-bottom:.8rem;padding-left:2rem}blockquote{border-left:.2rem solid #1271db;font-style:italic;margin:1.6rem 0;padding-left:1.6rem}blockquote,figcaption{font-family:Georgia,Times,Times New Roman,serif;font-family:var(--serif-font-list)}html{font-size:62.5%}article,aside,details,footer,header,main,section,summary{display:block;height:auto;margin:0 auto;width:100%}footer{clear:both;display:inline-block;float:left;max-width:100%;padding:1rem 0;text-align:center}footer,hr{border-top:.1rem solid rgba(0,0,0,.2)}hr{display:block;margin-bottom:1.6rem;width:100%}img{height:auto;vertical-align:baseline}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{border:.1rem solid #ccc;border-radius:0;display:inline-block;padding:.8rem;vertical-align:middle}input:not([type]){-webkit-appearance:none;background-clip:padding-box;background-color:#fff;border:.1rem solid #ccc;border-radius:0;color:#444;display:inline-block;padding:.8rem;text-align:left}input[type=color]{padding:.8rem 1.6rem}input:not([type]):focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{border-color:#b3d4fc}input[type=checkbox],input[type=radio]{vertical-align:middle}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:.1rem thin solid #444}input:not([type])[disabled],input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled],textarea[disabled]{background-color:#efefef;color:#777;cursor:not-allowed}input[readonly],textarea[readonly]{background-color:#efefef;border-color:#ccc;color:#777}input:focus:invalid,textarea:focus:invalid{border-color:#e9322d;color:#b94a48}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#ff4136}select[multiple]{height:auto}label{line-height:2}fieldset{border:0;margin:0;padding:.8rem 0}legend{border-bottom:.1rem solid #ccc;color:#444;display:block;margin-bottom:.8rem;padding:.8rem 0;width:100%}button,input[type=submit]{-moz-user-select:none;-ms-user-select:none;-webkit-transition:.25s ease;-webkit-user-drag:none;-webkit-user-select:none;border:.2rem solid #444;border-radius:0;color:#444;cursor:pointer;display:inline-block;margin-bottom:.8rem;margin-right:.4rem;padding:.8rem 1.6rem;text-align:center;text-decoration:none;text-transform:uppercase;transition:.25s ease;user-select:none;vertical-align:baseline}button a,input[type=submit] a{color:#444}button::-moz-focus-inner,input[type=submit]::-moz-focus-inner{padding:0}button:hover,input[type=submit]:hover{background:#444;border-color:#444;color:#fff}button:hover a,input[type=submit]:hover a{color:#fff}button:active,input[type=submit]:active{background:#6a6a6a;border-color:#6a6a6a;color:#fff}button:active a,input[type=submit]:active a{color:#fff}button:disabled,input[type=submit]:disabled{box-shadow:none;cursor:not-allowed;opacity:.4}nav ul{list-style:none;margin:0;padding:0;text-align:center}nav ul li{display:inline}nav a{-webkit-transition:.25s ease;border-bottom:.2rem solid transparent;color:#444;padding:.8rem 1.6rem;text-decoration:none;transition:.25s ease}nav a:hover,nav li.selected a{border-color:rgba(0,0,0,.2)}nav a:active{border-color:rgba(0,0,0,.56)}caption{padding:.8rem 0}thead th{background:#efefef;color:#444}tr{background:#fff;margin-bottom:.8rem}td,th{border:.1rem solid #ccc;padding:.8rem 1.6rem;text-align:center;vertical-align:inherit}tfoot tr{background:none}tfoot td{color:#efefef;font-size:.8rem;font-style:italic;padding:1.6rem .4rem}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0)!important;position:absolute!important}}@media screen and max-width 40rem{article,aside,section{clear:both;display:block;max-width:100%}img{margin-right:1.6rem}}:root{--blue-link:#1271db;--link-shadow:1px 1px 1px #000;--white-link-shadow:1px 1px 1px #fff;--shadow:2px 2px 2px #000;--title-overlay:rgba(0,0,0,0.45);--title-overlay-fallback:#000;--text-color:#fff;--normal-padding:0.25em 0.125em;--link-hover-color:#7d12db;--edit-link-hover-color:#db7d12;--edit-link-color:#12db18;--radius:5px}.media[hidden],[hidden=hidden],template{display:none}body{margin:.5em}button{background:#fff;background:linear-gradient(#ddd,#eee,#fff,#eee,#ddd)}button,button:hover{border-color:#555;color:#555}button:hover{background:#bbb;background:linear-gradient(#cfcfcf,#dfdfdf,#efefef,#dfdfdf,#cfcfcf)}button:active{background:#ddd;background:linear-gradient(#ddd,#ddd)}.media:hover button{background:linear-gradient(#bbb,#ccc,#ddd,#ccc,#bbb)}.media:hover button:hover{background:linear-gradient(#afafaf,#bfbfbf,#cfcfcf,#bfbfbf,#afafaf)}table{box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto}td{padding:1rem}thead td,thead th{padding:.5rem}input[type=number]{min-width:0;width:4.5em}input[type=checkbox],input[type=radio]{min-width:auto;vertical-align:inherit}input,textarea{min-width:30em;min-width:30rem}tbody>tr:nth-child(odd){background:#ddd}a:active,a:hover{color:#7d12db;color:var(--link-hover-color)}iframe{display:block;margin:0 auto}.bracketed{color:#12db18;color:var(--edit-link-color)}#main-nav a,.bracketed{text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}.bracketed:before{content:"[\00a0"}.bracketed:after{content:"\00a0]"}.bracketed:active,.bracketed:hover{color:#db7d12;color:var(--edit-link-hover-color)}.grow-1{flex-grow:1}.flex-wrap{flex-wrap:wrap}.flex-no-wrap{flex-wrap:nowrap}.flex-align-start{align-content:flex-start}.flex-align-end{align-items:flex-end}.flex-align-space-around{align-content:space-around}.flex-justify-start{justify-content:flex-start}.flex-justify-space-around{justify-content:space-around}.flex-center{justify-content:center}.flex-self-center{align-self:center}.flex-space-evenly{justify-content:space-evenly}.flex{display:inline-block;display:flex}.small-font{font-size:1.6rem}.justify{text-align:justify}.align-center{text-align:center!important}.align-left{text-align:left!important}.align-right{text-align:right!important}.valign-top{vertical-align:top}.no-border{border:none}.media-wrap{text-align:center;margin:0 auto;position:relative}.media-wrap-flex{display:inline-block;display:flex;flex-wrap:wrap;align-content:space-evenly;justify-content:space-between;position:relative}td .media-wrap-flex{justify-content:center}.danger{background-color:#ff4136;border-color:#924949;color:#924949}.danger:active,.danger:hover{background-color:#924949;border-color:#ff4136;color:#ff4136}td.danger,td.danger:active,td.danger:hover{background-color:transparent;color:#924949}.user-btn{background:transparent;border-color:#12db18;border-color:var(--edit-link-color);color:#12db18;color:var(--edit-link-color);text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow);padding:0 .5rem}.user-btn:active,.user-btn:hover{background:transparent;border-color:#db7d12;border-color:var(--edit-link-hover-color);color:#db7d12;color:var(--edit-link-hover-color)}.user-btn:active{background:#db7d12;background:var(--edit-link-hover-color);color:#fff}.full-width{width:100%}.full-height{max-height:none}.toph{margin-top:0}#main-nav{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem;border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem;font-style:normal;font-weight:500}.sorting,.sorting-asc,.sorting-desc{vertical-align:text-bottom}.sorting:before{content:" ↕\00a0"}.sorting-asc:before{content:" ↑\00a0"}.sorting-desc:before{content:" ↓\00a0"}.form thead th,.form thead tr{background:inherit;border:0}.form tr>td:nth-child(odd){text-align:right;min-width:25px;max-width:30%}.form tr>td:nth-child(2n){text-align:left}.invisible tbody>tr:nth-child(odd){background:inherit}.borderless,.borderless td,.borderless th,.borderless tr,.invisible td,.invisible th,.invisible tr{box-shadow:none;border:0}.message,.static-message{position:relative;margin:.5em auto;padding:.5em;width:95%}.message .close{width:1em;height:1em;position:absolute;right:.5em;top:.5em;text-align:center;vertical-align:middle;line-height:1em}.message:hover .close:after{content:"☒"}.message:hover{cursor:pointer}.message .icon{left:.5em;top:.5em;margin-right:1em}.message.error,.static-message.error{border:1px solid #924949;background:#f3e6e6}.message.error .icon:after{content:"✘"}.message.success,.static-message.success{border:1px solid #1f8454;background:#70dda9}.message.success .icon:after{content:"✔"}.message.info,.static-message.info{border:1px solid #bfbe3a;background:#ffc}.message.info .icon:after{content:"⚠"}.character,.media,.small-character{position:relative;vertical-align:top;display:inline-block;text-align:center;width:220px;height:312px;margin:.25em .125em;margin:var(--normal-padding);z-index:0;background:rgba(0,0,0,.15)}.details picture.cover,picture.cover{display:inline;display:initial;width:100%}.character>img,.media>img,.small-character>img{width:100%}.media .edit-buttons>button{margin:.5em auto}.media-metadata>div,.medium-metadata>div,.name,.row{text-shadow:2px 2px 2px #000;text-shadow:var(--shadow);color:#fff;color:var(--text-color);padding:.25em .125em;padding:var(--normal-padding);text-align:right;z-index:2}.age-rating,.media-type{text-align:left}.media>.media-metadata{position:absolute;bottom:0;right:0}.media>.medium-metadata{position:absolute;bottom:0;left:0}.media>.name{position:absolute;top:0}.media>.name a{display:inline-block;transition:none}.media .name a:before{content:"";display:block;height:312px;left:0;position:absolute;top:0;width:220px;z-index:-1}.media-list .media:hover .name a:before{background:rgba(0,0,0,.75)}.media>.name span.canonical{font-weight:700}.media>.name small{font-weight:400}.media:hover .name{background:rgba(0,0,0,.75)}.media-list .media>.name a:hover,.media-list .media>.name a:hover small{color:#1271db;color:var(--blue-link)}.media:hover>.edit-buttons[hidden],.media:hover>button[hidden]{transition:.25s ease;display:block}.media:hover{transition:.25s ease}.character>.name a,.character>.name a small,.media>.name a,.media>.name a small,.small-character>.name a,.small-character>.name a small{background:none;color:#fff;text-shadow:2px 2px 2px #000;text-shadow:var(--shadow)}.anime .name,.manga .name{background:#000;background:var(--title-overlay-fallback);background:rgba(0,0,0,.45);background:var(--title-overlay);text-align:center;width:100%;padding:.5em .25em}.anime .age-rating,.anime .airing-status,.anime .completion,.anime .delete,.anime .edit,.anime .media-type,.anime .user-rating{background:none;text-align:center}.anime .table,.manga .table{position:absolute;bottom:0;left:0;width:100%}.anime .row,.manga .row{width:100%;display:inline-block;display:flex;align-content:space-around;justify-content:space-around;text-align:center;padding:0 inherit}.anime .row>span,.manga .row>span{text-align:left;z-index:2}.anime .row>div,.manga .row>div{font-size:.8em;display:inline-block;display:flex-item;align-self:center;text-align:center;vertical-align:middle;z-index:2}.anime .media>button.plus-one{border-color:hsla(0,0%,100%,.65);position:absolute;top:138px;top:calc(50% - 21.2px);left:44px;left:calc(50% - 57.8px);z-index:50}.manga .row{padding:1px}.manga .media{height:310px;margin:.25em}.manga .media>.edit-buttons{position:absolute;top:86px;top:calc(50% - 21.2px);left:43.5px;left:calc(50% - 57.8px);z-index:40}.manga .media>.edit-buttons button{border-color:hsla(0,0%,100%,.65)}.media.search>.name{background-color:#555;background-color:rgba(0,0,0,.35);background-size:cover;background-size:contain;background-repeat:no-repeat}.media.search>.row{z-index:6}.big-check,.mal-check{display:none}.big-check:checked+label{transition:.25s ease;background:rgba(0,0,0,.75)}.big-check:checked+label:after{content:"✓";font-size:15em;font-size:15rem;text-align:center;color:#adff2f;position:absolute;top:147px;left:0;width:100%;z-index:5}#series-list article.media{position:relative}#series-list .name,#series-list .name label{position:absolute;display:block;top:0;left:0;height:100%;width:100%;vertical-align:middle;line-height:1.25em}#series-list .name small{color:#fff}.details{margin:1.5rem auto 0;padding:1rem;font-size:inherit}.fixed{max-width:115em;max-width:115rem;margin:0 auto}.details .cover{display:block}.details .flex>*{margin:1rem}.details .media-details td{padding:0 1.5rem}.details p{text-align:justify}.details .media-details td:nth-child(odd){width:1%;white-space:nowrap;text-align:right}.details .media-details td:nth-child(2n){text-align:left}.details a h1,.details a h2{margin-top:0}.character,.person,.small-character{width:225px;height:350px;vertical-align:middle;white-space:nowrap;position:relative}.person{width:225px;height:338px}.small-person{width:200px;height:300px}.character a{height:350px}.character:hover .name,.small-character:hover .name{background:rgba(0,0,0,.8)}.small-character a{display:inline-block;width:100%;height:100%}.character .name,.small-character .name{position:absolute;bottom:0;left:0;z-index:10}.character img,.character picture,.person img,.person picture,.small-character img,.small-character picture{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;max-height:350px;max-width:225px}.person img,.person picture{max-height:338px}.small-person img,.small-person picture{max-height:300px;max-width:200px}.min-table{min-width:0;margin-left:0}.max-table{min-width:100%;margin:0}aside.info{max-width:33%}.fixed aside{max-width:390px}aside img,aside picture{display:block;margin:0 auto}.small-character{width:160px;height:250px}.small-character img,.small-character picture{max-height:250px;max-width:160px}.user-page .media-wrap{text-align:left}.media a{display:inline-block;width:100%;height:100%}.streaming-logo{width:50px;height:50px;vertical-align:middle}.small-streaming-logo{width:25px;height:25px;vertical-align:middle}.cover-streaming-link{display:none}.media:hover .cover-streaming-link{display:block}.cover-streaming-link .streaming-logo{width:20px;height:20px;-webkit-filter:drop-shadow(0 -1px 4px #fff);filter:drop-shadow(0 -1px 4px #fff)}.history-img{width:110px;height:156px}.settings.form .content article{margin:1em;display:inline-block;width:auto}.responsive-iframe{margin-top:1em;overflow:hidden;padding-bottom:56.25%;position:relative;height:0}.responsive-iframe iframe{left:0;top:0;height:100%;width:100%;position:absolute}.cssload-loader{position:relative;left:calc(50% - 31px);width:62px;height:62px;border-radius:50%;perspective:780px}.cssload-inner{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:50%}.cssload-inner.cssload-one{left:0;top:0;-webkit-animation:cssload-rotate-one 1.15s linear infinite;animation:cssload-rotate-one 1.15s linear infinite;border-bottom:3px solid #000}.cssload-inner.cssload-two{right:0;top:0;-webkit-animation:cssload-rotate-two 1.15s linear infinite;animation:cssload-rotate-two 1.15s linear infinite;border-right:3px solid #000}.cssload-inner.cssload-three{right:0;bottom:0;-webkit-animation:cssload-rotate-three 1.15s linear infinite;animation:cssload-rotate-three 1.15s linear infinite;border-top:3px solid #000}@-webkit-keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}@keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}#loading-shadow{background:rgba(0,0,0,.8);z-index:500}#loading-shadow,#loading-shadow .loading-wrapper{position:fixed;top:0;left:0;width:100%;height:100%}#loading-shadow .loading-wrapper{z-index:501;display:flex;align-items:center;justify-content:center}#loading-shadow .loading-content{position:relative;color:#fff}.loading-content .cssload-inner.cssload-one,.loading-content .cssload-inner.cssload-three,.loading-content .cssload-inner.cssload-two{border-color:#fff}.tabs{display:inline-block;display:flex;flex-wrap:wrap;background:#efefef;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.tabs>label{border:1px solid #e5e5e5;width:100%;padding:20px 30px;background:#e5e5e5;cursor:pointer;font-weight:700;font-size:18px;color:#7f7f7f;transition:background .1s,color .1s}.tabs>label:hover{background:#d8d8d8}.tabs>label:active{background:#ccc}.tabs>[type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.tabs>[type=radio]{position:absolute;opacity:0}.tabs>[type=radio]:checked+label{border-bottom:1px solid #fff;background:#fff;color:#000}.tabs>[type=radio]:checked+label+.content{display:block}.tabs .content,.tabs>[type=radio]:checked+label+.content{border:1px solid #e5e5e5;border-top:0;padding:15px;background:#fff;width:100%;margin:0 auto;overflow:auto}.tabs .content{display:none;max-height:950px}.tabs .content.full-height{max-height:none}@media (min-width:800px){.tabs>label{width:auto}.tabs .content{order:99}}.vertical-tabs{border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto;position:relative;width:100%}.vertical-tabs input[type=radio]{position:absolute;opacity:0}.vertical-tabs .tab{align-items:center;display:inline-block;display:flex;flex-wrap:nowrap}.vertical-tabs .tab label{align-items:center;background:#e5e5e5;border:1px solid #e5e5e5;color:#7f7f7f;cursor:pointer;font-size:18px;font-weight:700;padding:0 20px;width:28%}.vertical-tabs .tab label:hover{background:#d8d8d8}.vertical-tabs .tab label:active{background:#ccc}.vertical-tabs .tab .content{display:none;border:1px solid #e5e5e5;border-left:0;border-right:0;max-height:950px;overflow:auto}.vertical-tabs .tab .content.full-height{max-height:none}.vertical-tabs [type=radio]:checked+label{border:0;background:#fff;color:#000;width:38%}.vertical-tabs [type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.vertical-tabs [type=radio]:checked~.content{display:block}@media screen and (max-width:1100px){.flex{flex-wrap:wrap}.fixed aside.info,.fixed aside.info+article,aside.info,aside.info+article{max-width:none;width:100%}}@media screen and (max-width:800px){*{max-width:none}table{box-shadow:none}.details .flex>*,body{margin:0}table,table.align-center,table .align-right,table td,table th{border:0;margin-left:auto;margin-right:auto;text-align:left;width:100%}table td{display:inline-block}table.media-details,table tbody{width:100%}table.media-details td{display:block;text-align:left!important;width:100%}table thead{display:none}.details .media-details td:nth-child(odd){font-weight:700;width:100%}table.streaming-links tr td:not(:first-child){display:none}}@media screen and (max-width:40em){nav a{line-height:4em;line-height:4rem}img,picture{width:100%}main{padding:0 .5rem .5rem}.media{margin:2px 0}.details{padding:.5rem}.tabs>[type=radio]:checked+label{background:#fff}.vertical-tabs .tab{flex-wrap:wrap}.tabs .content,.tabs>[type=radio]:checked+label+.content,.vertical-tabs .tab .content{display:block;border:0;max-height:none}.tabs>[type=radio]:checked+label,.tabs>label,.tabs>label:active,.tabs>label:hover,.vertical-tabs .tab label,.vertical-tabs .tab label:active,.vertical-tabs .tab label:hover,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:focus+label{background:#fff;border:0;width:100%;cursor:default;color:#000}}a{color:#1978e2;text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}a:hover{color:#9e34fd}body,legend,nav ul li a{background:#333;color:#eee}nav a:hover,nav li.selected a{border-color:#fff}header button{background:transparent}table{box-shadow:none}td,th{border-color:#111}thead td,thead th{background:#333;color:#eee}tbody>tr:nth-child(2n){background:#555;color:#eee}tbody>tr:nth-child(odd){background:#333}footer,hr,legend{border-color:#ddd}small{color:#fff}input,input[type],select,textarea{border-color:#bbb;color:#bbb;background:#333;padding:.8em}button{background:#444;background:linear-gradient(#666,#555,#444,#555,#666);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#ddd;color:#ddd}button:hover{background:#222;background:linear-gradient(#444,#333,#222,#333,#444)}button:active{background:#333;background:linear-gradient(#333,#333)}.media:hover button{background:linear-gradient(#666,#555,#444,#555,#666)}.media:hover button:hover{background:linear-gradient(#444,#555,#666,#555,#444)}.message,.static-message{text-shadow:1px 1px 1px #fff;text-shadow:var(--white-link-shadow)}.message.success,.static-message.success{background:#1f8454;border-color:#70dda9}.message.error,.static-message.error{border-color:#f3e6e6;background:#924949}.message.info,.static-message.info{border-color:#ffc;background:#bfbe3a}.invisible tbody>tr:nth-child(2n),.invisible tbody>tr:nth-child(odd),.invisible td,.invisible th,.invisible tr{background:transparent}#main-nav{border-bottom:.1rem solid #ddd}.tabs,.vertical-tabs{background:#333}.tabs>label,.vertical-tabs .tab label{background:#222;border:0;color:#eee}.vertical-tabs .tab label{width:100%}.tabs>label:hover,.vertical-tabs .tab>label:hover{background:#888}.tabs>label:active,.vertical-tabs .tab>label:active{background:#999}.tabs>[type=radio]:checked+label,.tabs>[type=radio]:checked+label+.content,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:checked~.content{border:0;background:#666;color:#eee}.vertical-tabs{background:#222;border:1px solid #444}.vertical-tabs .tab{background:#666;border-bottom:1px solid #444}.streaming-logo{-webkit-filter:drop-shadow(0 0 2px #fff);filter:drop-shadow(0 0 2px #fff)} \ No newline at end of file +:root{--default-font-list:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--monospace-font-list:"Anonymous Pro","Fira Code",Menlo,Monaco,Consolas,"Courier New",monospace;--serif-font-list:Georgia,Times,"Times New Roman",serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);line-height:1.4;overflow-y:scroll;-moz-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}audio:not([controls]){display:none}details{display:block}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{margin:0 auto;padding:0 1.6rem 1.6rem}main,pre,summary{display:block}pre{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);font-size:1.4em;font-size:1.4rem;margin:1.6rem 0;overflow:auto;padding:1.6rem;word-break:break-all;word-wrap:break-word}progress{display:inline-block}small{color:#777;font-size:75%}big{font-size:125%}template{display:none}textarea{border:.1rem solid #ccc;border-radius:0;display:block;margin-bottom:.8rem;overflow:auto;padding:.8rem;resize:vertical;vertical-align:middle}[hidden]{display:none}[unselectable]{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit;margin:0;padding:0}:after,:before{text-decoration:inherit;vertical-align:inherit}a{-webkit-transition:.25s ease;color:#1271db;text-decoration:none;transition:.25s ease}audio,canvas,iframe,img,svg,video{vertical-align:middle}input,textarea{border:.1rem solid #ccc;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.4em}code,kbd,pre,samp{font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list)}table{border-collapse:collapse;border-spacing:0;margin-bottom:1.6rem}::-moz-selection{background-color:#b3d4fc;text-shadow:none}::selection{background-color:#b3d4fc;text-shadow:none}button::-moz-focus-inner{border:0}body{color:#444;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);font-size:1.6rem;font-style:normal;font-weight:400;padding:0}p{margin:0 0 1.6rem}h1,h2,h3,h4,h5,h6{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem}h1{border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem}h1,h2{font-style:normal;font-weight:500}h2{font-size:3em;font-size:3rem}h3{font-size:2.4em;font-size:2.4rem;font-style:normal;font-weight:500;margin:1.6rem 0 .4rem}h4{font-size:1.8em;font-size:1.8rem}h4,h5{font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}h5{font-size:1.6em;font-size:1.6rem}h6{color:#777;font-size:1.4em;font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}code,h6{font-size:1.4rem}code{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);word-break:break-all;word-wrap:break-word}a:focus,a:hover{text-decoration:none}dl{margin-bottom:1.6rem}dd{margin-left:4rem}ol,ul{margin-bottom:.8rem;padding-left:2rem}blockquote{border-left:.2rem solid #1271db;font-style:italic;margin:1.6rem 0;padding-left:1.6rem}blockquote,figcaption{font-family:Georgia,Times,Times New Roman,serif;font-family:var(--serif-font-list)}html{font-size:62.5%}article,aside,details,footer,header,main,section,summary{display:block;height:auto;margin:0 auto;width:100%}footer{clear:both;display:inline-block;float:left;max-width:100%;padding:1rem 0;text-align:center}footer,hr{border-top:.1rem solid rgba(0,0,0,.2)}hr{display:block;margin-bottom:1.6rem;width:100%}img{height:auto;vertical-align:baseline}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{border:.1rem solid #ccc;border-radius:0;display:inline-block;padding:.8rem;vertical-align:middle}input:not([type]){-webkit-appearance:none;background-clip:padding-box;background-color:#fff;border:.1rem solid #ccc;border-radius:0;color:#444;display:inline-block;padding:.8rem;text-align:left}input[type=color]{padding:.8rem 1.6rem}input:not([type]):focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{border-color:#b3d4fc}input[type=checkbox],input[type=radio]{vertical-align:middle}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:.1rem thin solid #444}input:not([type])[disabled],input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled],textarea[disabled]{background-color:#efefef;color:#777;cursor:not-allowed}input[readonly],textarea[readonly]{background-color:#efefef;border-color:#ccc;color:#777}input:focus:invalid,textarea:focus:invalid{border-color:#e9322d;color:#b94a48}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#ff4136}select[multiple]{height:auto}label{line-height:2}fieldset{border:0;margin:0;padding:.8rem 0}legend{border-bottom:.1rem solid #ccc;color:#444;display:block;margin-bottom:.8rem;padding:.8rem 0;width:100%}button,input[type=submit]{-moz-user-select:none;-ms-user-select:none;-webkit-transition:.25s ease;-webkit-user-drag:none;-webkit-user-select:none;border:.2rem solid #444;border-radius:0;color:#444;cursor:pointer;display:inline-block;margin-bottom:.8rem;margin-right:.4rem;padding:.8rem 1.6rem;text-align:center;text-decoration:none;text-transform:uppercase;transition:.25s ease;user-select:none;vertical-align:baseline}button a,input[type=submit] a{color:#444}button::-moz-focus-inner,input[type=submit]::-moz-focus-inner{padding:0}button:hover,input[type=submit]:hover{background:#444;border-color:#444;color:#fff}button:hover a,input[type=submit]:hover a{color:#fff}button:active,input[type=submit]:active{background:#6a6a6a;border-color:#6a6a6a;color:#fff}button:active a,input[type=submit]:active a{color:#fff}button:disabled,input[type=submit]:disabled{box-shadow:none;cursor:not-allowed;opacity:.4}nav ul{list-style:none;margin:0;padding:0;text-align:center}nav ul li{display:inline}nav a{-webkit-transition:.25s ease;border-bottom:.2rem solid transparent;color:#444;padding:.8rem 1.6rem;text-decoration:none;transition:.25s ease}nav a:hover,nav li.selected a{border-color:rgba(0,0,0,.2)}nav a:active{border-color:rgba(0,0,0,.56)}caption{padding:.8rem 0}thead th{background:#efefef;color:#444}tr{background:#fff;margin-bottom:.8rem}td,th{border:.1rem solid #ccc;padding:.8rem 1.6rem;text-align:center;vertical-align:inherit}tfoot tr{background:none}tfoot td{color:#efefef;font-size:.8rem;font-style:italic;padding:1.6rem .4rem}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0)!important;position:absolute!important}}@media screen and max-width 40rem{article,aside,section{clear:both;display:block;max-width:100%}img{margin-right:1.6rem}}:root{--blue-link:#1271db;--link-shadow:1px 1px 1px #000;--white-link-shadow:1px 1px 1px #fff;--shadow:2px 2px 2px #000;--title-overlay:rgba(0,0,0,0.45);--title-overlay-fallback:#000;--text-color:#fff;--normal-padding:0.25em 0.125em;--link-hover-color:#7d12db;--edit-link-hover-color:#db7d12;--edit-link-color:#12db18;--radius:5px}.media[hidden],[hidden=hidden],template{display:none}body{margin:.5em}button{background:#fff;background:linear-gradient(#ddd,#eee,#fff,#eee,#ddd)}button,button:hover{border-color:#555;color:#555}button:hover{background:#bbb;background:linear-gradient(#cfcfcf,#dfdfdf,#efefef,#dfdfdf,#cfcfcf)}button:active{background:#ddd;background:linear-gradient(#ddd,#ddd)}.media:hover button{background:linear-gradient(#bbb,#ccc,#ddd,#ccc,#bbb)}.media:hover button:hover{background:linear-gradient(#afafaf,#bfbfbf,#cfcfcf,#bfbfbf,#afafaf)}table{box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto}td{padding:1rem}thead td,thead th{padding:.5rem}input[type=number]{min-width:0;width:4.5em}input[type=checkbox],input[type=radio]{min-width:auto;vertical-align:inherit}input,textarea{min-width:30em;min-width:30rem}tbody>tr:nth-child(odd){background:#ddd}a:active,a:hover{color:#7d12db;color:var(--link-hover-color)}iframe{display:block;margin:0 auto;border:0}.bracketed{color:#12db18;color:var(--edit-link-color)}#main-nav a,.bracketed{text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}.bracketed:before{content:"[\00a0"}.bracketed:after{content:"\00a0]"}.bracketed:active,.bracketed:hover{color:#db7d12;color:var(--edit-link-hover-color)}.grow-1{flex-grow:1}.flex-wrap{flex-wrap:wrap}.flex-no-wrap{flex-wrap:nowrap}.flex-align-start{align-content:flex-start}.flex-align-end{align-items:flex-end}.flex-align-space-around{align-content:space-around}.flex-justify-start{justify-content:flex-start}.flex-justify-space-around{justify-content:space-around}.flex-center{justify-content:center}.flex-self-center{align-self:center}.flex-space-evenly{justify-content:space-evenly}.flex{display:inline-block;display:flex}.small-font{font-size:1.6rem}.justify{text-align:justify}.align-center{text-align:center!important}.align-left{text-align:left!important}.align-right{text-align:right!important}.valign-top{vertical-align:top}.no-border{border:none}.media-wrap{text-align:center;margin:0 auto;position:relative}.media-wrap-flex{display:inline-block;display:flex;flex-wrap:wrap;align-content:space-evenly;justify-content:space-between;position:relative}td .media-wrap-flex{justify-content:center}.danger{background-color:#ff4136;border-color:#924949;color:#924949}.danger:active,.danger:hover{background-color:#924949;border-color:#ff4136;color:#ff4136}td.danger,td.danger:active,td.danger:hover{background-color:transparent;color:#924949}.user-btn{background:transparent;border-color:#12db18;border-color:var(--edit-link-color);color:#12db18;color:var(--edit-link-color);text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow);padding:0 .5rem}.user-btn:active,.user-btn:hover{background:transparent;border-color:#db7d12;border-color:var(--edit-link-hover-color);color:#db7d12;color:var(--edit-link-hover-color)}.user-btn:active{background:#db7d12;background:var(--edit-link-hover-color);color:#fff}.full-width{width:100%}.full-height{max-height:none}.toph{margin-top:0}#main-nav{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem;border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem;font-style:normal;font-weight:500}.sorting,.sorting-asc,.sorting-desc{vertical-align:text-bottom}.sorting:before{content:" ↕\00a0"}.sorting-asc:before{content:" ↑\00a0"}.sorting-desc:before{content:" ↓\00a0"}.form thead th,.form thead tr{background:inherit;border:0}.form tr>td:nth-child(odd){text-align:right;min-width:25px;max-width:30%}.form tr>td:nth-child(2n){text-align:left}.invisible tbody>tr:nth-child(odd){background:inherit}.borderless,.borderless td,.borderless th,.borderless tr,.invisible td,.invisible th,.invisible tr{box-shadow:none;border:0}.message,.static-message{position:relative;margin:.5em auto;padding:.5em;width:95%}.message .close{width:1em;height:1em;position:absolute;right:.5em;top:.5em;text-align:center;vertical-align:middle;line-height:1em}.message:hover .close:after{content:"☒"}.message:hover{cursor:pointer}.message .icon{left:.5em;top:.5em;margin-right:1em}.message.error,.static-message.error{border:1px solid #924949;background:#f3e6e6}.message.error .icon:after{content:"✘"}.message.success,.static-message.success{border:1px solid #1f8454;background:#70dda9}.message.success .icon:after{content:"✔"}.message.info,.static-message.info{border:1px solid #bfbe3a;background:#ffc}.message.info .icon:after{content:"⚠"}.character,.media,.small-character{position:relative;vertical-align:top;display:inline-block;text-align:center;width:220px;height:312px;margin:.25em .125em;margin:var(--normal-padding);z-index:0;background:rgba(0,0,0,.15)}.details picture.cover,picture.cover{display:inline;display:initial;width:100%}.character>img,.media>img,.small-character>img{width:100%}.media .edit-buttons>button{margin:.5em auto}.media-metadata>div,.medium-metadata>div,.name,.row{text-shadow:2px 2px 2px #000;text-shadow:var(--shadow);color:#fff;color:var(--text-color);padding:.25em .125em;padding:var(--normal-padding);text-align:right;z-index:2}.age-rating,.media-type{text-align:left}.media>.media-metadata{position:absolute;bottom:0;right:0}.media>.medium-metadata{position:absolute;bottom:0;left:0}.media>.name{position:absolute;top:0}.media>.name a{display:inline-block;transition:none}.media .name a:before{content:"";display:block;height:312px;left:0;position:absolute;top:0;width:220px;z-index:-1}.media-list .media:hover .name a:before{background:rgba(0,0,0,.75)}.media>.name span.canonical{font-weight:700}.media>.name small{font-weight:400}.media:hover .name{background:rgba(0,0,0,.75)}.media-list .media>.name a:hover,.media-list .media>.name a:hover small{color:#1271db;color:var(--blue-link)}.media:hover>.edit-buttons[hidden],.media:hover>button[hidden]{transition:.25s ease;display:block}.media:hover{transition:.25s ease}.character>.name a,.character>.name a small,.media>.name a,.media>.name a small,.small-character>.name a,.small-character>.name a small{background:none;color:#fff;text-shadow:2px 2px 2px #000;text-shadow:var(--shadow)}.anime .name,.manga .name{background:#000;background:var(--title-overlay-fallback);background:rgba(0,0,0,.45);background:var(--title-overlay);text-align:center;width:100%;padding:.5em .25em}.anime .age-rating,.anime .airing-status,.anime .completion,.anime .delete,.anime .edit,.anime .media-type,.anime .user-rating{background:none;text-align:center}.anime .table,.manga .table{position:absolute;bottom:0;left:0;width:100%}.anime .row,.manga .row{width:100%;display:inline-block;display:flex;align-content:space-around;justify-content:space-around;text-align:center;padding:0 inherit}.anime .row>span,.manga .row>span{text-align:left;z-index:2}.anime .row>div,.manga .row>div{font-size:.8em;display:inline-block;display:flex-item;align-self:center;text-align:center;vertical-align:middle;z-index:2}.anime .media>button.plus-one{border-color:hsla(0,0%,100%,.65);position:absolute;top:138px;top:calc(50% - 21.2px);left:44px;left:calc(50% - 57.8px);z-index:50}.manga .row{padding:1px}.manga .media{height:310px;margin:.25em}.manga .media>.edit-buttons{position:absolute;top:86px;top:calc(50% - 21.2px);left:43.5px;left:calc(50% - 57.8px);z-index:40}.manga .media>.edit-buttons button{border-color:hsla(0,0%,100%,.65)}.media.search>.name{background-color:#555;background-color:rgba(0,0,0,.35);background-size:cover;background-size:contain;background-repeat:no-repeat}.media.search>.row{z-index:6}.big-check,.mal-check{display:none}.big-check:checked+label{transition:.25s ease;background:rgba(0,0,0,.75)}.big-check:checked+label:after{content:"✓";font-size:15em;font-size:15rem;text-align:center;color:#adff2f;position:absolute;top:147px;left:0;width:100%;z-index:5}#series-list article.media{position:relative}#series-list .name,#series-list .name label{position:absolute;display:block;top:0;left:0;height:100%;width:100%;vertical-align:middle;line-height:1.25em}#series-list .name small{color:#fff}.details{margin:1.5rem auto 0;padding:1rem;font-size:inherit}.fixed{max-width:115em;max-width:115rem;margin:0 auto}.details .cover{display:block}.details .flex>*{margin:1rem}.details .media-details td{padding:0 1.5rem}.details p{text-align:justify}.details .media-details td:nth-child(odd){width:1%;white-space:nowrap;text-align:right}.details .media-details td:nth-child(2n){text-align:left}.details a h1,.details a h2{margin-top:0}.character,.person,.small-character{width:225px;height:350px;vertical-align:middle;white-space:nowrap;position:relative}.person{width:225px;height:338px}.small-person{width:200px;height:300px}.character a{height:350px}.character:hover .name,.small-character:hover .name{background:rgba(0,0,0,.8)}.small-character a{display:inline-block;width:100%;height:100%}.character .name,.small-character .name{position:absolute;bottom:0;left:0;z-index:10}.character img,.character picture,.person img,.person picture,.small-character img,.small-character picture{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;max-height:350px;max-width:225px}.person img,.person picture{max-height:338px}.small-person img,.small-person picture{max-height:300px;max-width:200px}.min-table{min-width:0;margin-left:0}.max-table{min-width:100%;margin:0}aside.info{max-width:33%}.fixed aside{max-width:390px}aside img,aside picture{display:block;margin:0 auto}.small-character{width:160px;height:250px}.small-character img,.small-character picture{max-height:250px;max-width:160px}.user-page .media-wrap{text-align:left}.media a{display:inline-block;width:100%;height:100%}.streaming-logo{width:50px;height:50px;vertical-align:middle}.small-streaming-logo{width:25px;height:25px;vertical-align:middle}.cover-streaming-link{display:none}.media:hover .cover-streaming-link{display:block}.cover-streaming-link .streaming-logo{width:20px;height:20px;-webkit-filter:drop-shadow(0 -1px 4px #fff);filter:drop-shadow(0 -1px 4px #fff)}.history-img{width:110px;height:156px}.settings.form .content article{margin:1em;display:inline-block;width:auto}.responsive-iframe{margin-top:1em;overflow:hidden;padding-bottom:56.25%;position:relative;height:0}.responsive-iframe iframe{left:0;top:0;height:100%;width:100%;position:absolute}.cssload-loader{position:relative;left:calc(50% - 31px);width:62px;height:62px;border-radius:50%;perspective:780px}.cssload-inner{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:50%}.cssload-inner.cssload-one{left:0;top:0;-webkit-animation:cssload-rotate-one 1.15s linear infinite;animation:cssload-rotate-one 1.15s linear infinite;border-bottom:3px solid #000}.cssload-inner.cssload-two{right:0;top:0;-webkit-animation:cssload-rotate-two 1.15s linear infinite;animation:cssload-rotate-two 1.15s linear infinite;border-right:3px solid #000}.cssload-inner.cssload-three{right:0;bottom:0;-webkit-animation:cssload-rotate-three 1.15s linear infinite;animation:cssload-rotate-three 1.15s linear infinite;border-top:3px solid #000}@-webkit-keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}@keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}#loading-shadow{background:rgba(0,0,0,.8);z-index:500}#loading-shadow,#loading-shadow .loading-wrapper{position:fixed;top:0;left:0;width:100%;height:100%}#loading-shadow .loading-wrapper{z-index:501;display:flex;align-items:center;justify-content:center}#loading-shadow .loading-content{position:relative;color:#fff}.loading-content .cssload-inner.cssload-one,.loading-content .cssload-inner.cssload-three,.loading-content .cssload-inner.cssload-two{border-color:#fff}.tabs{display:inline-block;display:flex;flex-wrap:wrap;background:#efefef;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.tabs>label{border:1px solid #e5e5e5;width:100%;padding:20px 30px;background:#e5e5e5;cursor:pointer;font-weight:700;font-size:18px;color:#7f7f7f;transition:background .1s,color .1s}.tabs>label:hover{background:#d8d8d8}.tabs>label:active{background:#ccc}.tabs>[type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.tabs>[type=radio]{position:absolute;opacity:0}.tabs>[type=radio]:checked+label{border-bottom:1px solid #fff;background:#fff;color:#000}.tabs>[type=radio]:checked+label+.content{display:block}.single-tab,.tabs .content,.tabs>[type=radio]:checked+label+.content{border:1px solid #e5e5e5;border-top:0;padding:15px;background:#fff;width:100%;margin:0 auto;overflow:auto}.single-tab,.tabs .content{display:none;max-height:950px}.single-tab{display:block;border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.single-tab.full-height,.tabs .content.full-height{max-height:none}@media (min-width:800px){.tabs>label{width:auto}.tabs .content{order:99}}.vertical-tabs{border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto;position:relative;width:100%}.vertical-tabs input[type=radio]{position:absolute;opacity:0}.vertical-tabs .tab{align-items:center;display:inline-block;display:flex;flex-wrap:nowrap}.vertical-tabs .tab label{align-items:center;background:#e5e5e5;border:1px solid #e5e5e5;color:#7f7f7f;cursor:pointer;font-size:18px;font-weight:700;padding:0 20px;width:28%}.vertical-tabs .tab label:hover{background:#d8d8d8}.vertical-tabs .tab label:active{background:#ccc}.vertical-tabs .tab .content{display:none;border:1px solid #e5e5e5;border-left:0;border-right:0;max-height:950px;overflow:auto}.vertical-tabs .tab .content.full-height{max-height:none}.vertical-tabs [type=radio]:checked+label{border:0;background:#fff;color:#000;width:38%}.vertical-tabs [type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.vertical-tabs [type=radio]:checked~.content{display:block}@media screen and (max-width:1100px){.flex{flex-wrap:wrap}.fixed aside.info,.fixed aside.info+article,aside.info,aside.info+article{max-width:none;width:100%}}@media screen and (max-width:800px){*{max-width:none}table{box-shadow:none}.details .flex>*,body{margin:0}table,table.align-center,table .align-right,table td,table th{border:0;margin-left:auto;margin-right:auto;text-align:left;width:100%}table td{display:inline-block}table.media-details,table tbody{width:100%}table.media-details td{display:block;text-align:left!important;width:100%}table thead{display:none}.details .media-details td:nth-child(odd){font-weight:700;width:100%}table.streaming-links tr td:not(:first-child){display:none}}@media screen and (max-width:40em){nav a{line-height:4em;line-height:4rem}img,picture{width:100%}main{padding:0 .5rem .5rem}.media{margin:2px 0}.details{padding:.5rem}.tabs>[type=radio]:checked+label{background:#fff}.vertical-tabs .tab{flex-wrap:wrap}.tabs .content,.tabs>[type=radio]:checked+label+.content,.vertical-tabs .tab .content{display:block;border:0;max-height:none}.tabs>[type=radio]:checked+label,.tabs>label,.tabs>label:active,.tabs>label:hover,.vertical-tabs .tab label,.vertical-tabs .tab label:active,.vertical-tabs .tab label:hover,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:focus+label{background:#fff;border:0;width:100%;cursor:default;color:#000}}a{color:#1978e2;text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}a:hover{color:#9e34fd}body,legend,nav ul li a{background:#333;color:#eee}nav a:hover,nav li.selected a{border-color:#fff}header button{background:transparent}table{box-shadow:none}td,th{border-color:#111}thead td,thead th{background:#333;color:#eee}tbody>tr:nth-child(2n){background:#555;color:#eee}tbody>tr:nth-child(odd){background:#333}footer,hr,legend{border-color:#ddd}small{color:#fff}input,input[type],select,textarea{border-color:#bbb;color:#bbb;background:#333;padding:.8em}button{background:#444;background:linear-gradient(#666,#555,#444,#555,#666);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#ddd;color:#ddd}button:hover{background:#222;background:linear-gradient(#444,#333,#222,#333,#444)}button:active{background:#333;background:linear-gradient(#333,#333)}.media:hover button{background:linear-gradient(#666,#555,#444,#555,#666)}.media:hover button:hover{background:linear-gradient(#444,#555,#666,#555,#444)}.message,.static-message{text-shadow:1px 1px 1px #fff;text-shadow:var(--white-link-shadow)}.message.success,.static-message.success{background:#1f8454;border-color:#70dda9}.message.error,.static-message.error{border-color:#f3e6e6;background:#924949}.message.info,.static-message.info{border-color:#ffc;background:#bfbe3a}.invisible tbody>tr:nth-child(2n),.invisible tbody>tr:nth-child(odd),.invisible td,.invisible th,.invisible tr{background:transparent}#main-nav{border-bottom:.1rem solid #ddd}.tabs,.vertical-tabs{background:#333}.tabs>label,.vertical-tabs .tab label{background:#222;border:0;color:#eee}.vertical-tabs .tab label{width:100%}.tabs>label:hover,.vertical-tabs .tab>label:hover{background:#888}.tabs>label:active,.vertical-tabs .tab>label:active{background:#999}.single-tab,.tabs>[type=radio]:checked+label,.tabs>[type=radio]:checked+label+.content,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:checked~.content{border:0;background:#666;color:#eee}.vertical-tabs{background:#222;border:1px solid #444}.vertical-tabs .tab{background:#666;border-bottom:1px solid #444}.streaming-logo{-webkit-filter:drop-shadow(0 0 2px #fff);filter:drop-shadow(0 0 2px #fff)} \ No newline at end of file diff --git a/public/css/light.min.css b/public/css/light.min.css index fe7d8c22..78163a04 100644 --- a/public/css/light.min.css +++ b/public/css/light.min.css @@ -1 +1 @@ -:root{--default-font-list:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--monospace-font-list:"Anonymous Pro","Fira Code",Menlo,Monaco,Consolas,"Courier New",monospace;--serif-font-list:Georgia,Times,"Times New Roman",serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);line-height:1.4;overflow-y:scroll;-moz-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}audio:not([controls]){display:none}details{display:block}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{margin:0 auto;padding:0 1.6rem 1.6rem}main,pre,summary{display:block}pre{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);font-size:1.4em;font-size:1.4rem;margin:1.6rem 0;overflow:auto;padding:1.6rem;word-break:break-all;word-wrap:break-word}progress{display:inline-block}small{color:#777;font-size:75%}big{font-size:125%}template{display:none}textarea{border:.1rem solid #ccc;border-radius:0;display:block;margin-bottom:.8rem;overflow:auto;padding:.8rem;resize:vertical;vertical-align:middle}[hidden]{display:none}[unselectable]{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit;margin:0;padding:0}:after,:before{text-decoration:inherit;vertical-align:inherit}a{-webkit-transition:.25s ease;color:#1271db;text-decoration:none;transition:.25s ease}audio,canvas,iframe,img,svg,video{vertical-align:middle}input,textarea{border:.1rem solid #ccc;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.4em}code,kbd,pre,samp{font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list)}table{border-collapse:collapse;border-spacing:0;margin-bottom:1.6rem}::-moz-selection{background-color:#b3d4fc;text-shadow:none}::selection{background-color:#b3d4fc;text-shadow:none}button::-moz-focus-inner{border:0}body{color:#444;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);font-size:1.6rem;font-style:normal;font-weight:400;padding:0}p{margin:0 0 1.6rem}h1,h2,h3,h4,h5,h6{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem}h1{border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem}h1,h2{font-style:normal;font-weight:500}h2{font-size:3em;font-size:3rem}h3{font-size:2.4em;font-size:2.4rem;font-style:normal;font-weight:500;margin:1.6rem 0 .4rem}h4{font-size:1.8em;font-size:1.8rem}h4,h5{font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}h5{font-size:1.6em;font-size:1.6rem}h6{color:#777;font-size:1.4em;font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}code,h6{font-size:1.4rem}code{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);word-break:break-all;word-wrap:break-word}a:focus,a:hover{text-decoration:none}dl{margin-bottom:1.6rem}dd{margin-left:4rem}ol,ul{margin-bottom:.8rem;padding-left:2rem}blockquote{border-left:.2rem solid #1271db;font-style:italic;margin:1.6rem 0;padding-left:1.6rem}blockquote,figcaption{font-family:Georgia,Times,Times New Roman,serif;font-family:var(--serif-font-list)}html{font-size:62.5%}article,aside,details,footer,header,main,section,summary{display:block;height:auto;margin:0 auto;width:100%}footer{clear:both;display:inline-block;float:left;max-width:100%;padding:1rem 0;text-align:center}footer,hr{border-top:.1rem solid rgba(0,0,0,.2)}hr{display:block;margin-bottom:1.6rem;width:100%}img{height:auto;vertical-align:baseline}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{border:.1rem solid #ccc;border-radius:0;display:inline-block;padding:.8rem;vertical-align:middle}input:not([type]){-webkit-appearance:none;background-clip:padding-box;background-color:#fff;border:.1rem solid #ccc;border-radius:0;color:#444;display:inline-block;padding:.8rem;text-align:left}input[type=color]{padding:.8rem 1.6rem}input:not([type]):focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{border-color:#b3d4fc}input[type=checkbox],input[type=radio]{vertical-align:middle}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:.1rem thin solid #444}input:not([type])[disabled],input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled],textarea[disabled]{background-color:#efefef;color:#777;cursor:not-allowed}input[readonly],textarea[readonly]{background-color:#efefef;border-color:#ccc;color:#777}input:focus:invalid,textarea:focus:invalid{border-color:#e9322d;color:#b94a48}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#ff4136}select[multiple]{height:auto}label{line-height:2}fieldset{border:0;margin:0;padding:.8rem 0}legend{border-bottom:.1rem solid #ccc;color:#444;display:block;margin-bottom:.8rem;padding:.8rem 0;width:100%}button,input[type=submit]{-moz-user-select:none;-ms-user-select:none;-webkit-transition:.25s ease;-webkit-user-drag:none;-webkit-user-select:none;border:.2rem solid #444;border-radius:0;color:#444;cursor:pointer;display:inline-block;margin-bottom:.8rem;margin-right:.4rem;padding:.8rem 1.6rem;text-align:center;text-decoration:none;text-transform:uppercase;transition:.25s ease;user-select:none;vertical-align:baseline}button a,input[type=submit] a{color:#444}button::-moz-focus-inner,input[type=submit]::-moz-focus-inner{padding:0}button:hover,input[type=submit]:hover{background:#444;border-color:#444;color:#fff}button:hover a,input[type=submit]:hover a{color:#fff}button:active,input[type=submit]:active{background:#6a6a6a;border-color:#6a6a6a;color:#fff}button:active a,input[type=submit]:active a{color:#fff}button:disabled,input[type=submit]:disabled{box-shadow:none;cursor:not-allowed;opacity:.4}nav ul{list-style:none;margin:0;padding:0;text-align:center}nav ul li{display:inline}nav a{-webkit-transition:.25s ease;border-bottom:.2rem solid transparent;color:#444;padding:.8rem 1.6rem;text-decoration:none;transition:.25s ease}nav a:hover,nav li.selected a{border-color:rgba(0,0,0,.2)}nav a:active{border-color:rgba(0,0,0,.56)}caption{padding:.8rem 0}thead th{background:#efefef;color:#444}tr{background:#fff;margin-bottom:.8rem}td,th{border:.1rem solid #ccc;padding:.8rem 1.6rem;text-align:center;vertical-align:inherit}tfoot tr{background:none}tfoot td{color:#efefef;font-size:.8rem;font-style:italic;padding:1.6rem .4rem}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0)!important;position:absolute!important}}@media screen and max-width 40rem{article,aside,section{clear:both;display:block;max-width:100%}img{margin-right:1.6rem}}:root{--blue-link:#1271db;--link-shadow:1px 1px 1px #000;--white-link-shadow:1px 1px 1px #fff;--shadow:2px 2px 2px #000;--title-overlay:rgba(0,0,0,0.45);--title-overlay-fallback:#000;--text-color:#fff;--normal-padding:0.25em 0.125em;--link-hover-color:#7d12db;--edit-link-hover-color:#db7d12;--edit-link-color:#12db18;--radius:5px}.media[hidden],[hidden=hidden],template{display:none}body{margin:.5em}button{background:#fff;background:linear-gradient(#ddd,#eee,#fff,#eee,#ddd);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#555;color:#555}button:hover{background:#bbb;background:linear-gradient(#cfcfcf,#dfdfdf,#efefef,#dfdfdf,#cfcfcf)}button:active{background:#ddd;background:linear-gradient(#ddd,#ddd)}.media:hover button{background:linear-gradient(#bbb,#ccc,#ddd,#ccc,#bbb)}.media:hover button:hover{background:linear-gradient(#afafaf,#bfbfbf,#cfcfcf,#bfbfbf,#afafaf)}table{box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto}td{padding:1rem}thead td,thead th{padding:.5rem}input[type=number]{min-width:0;width:4.5em}input[type=checkbox],input[type=radio]{min-width:auto;vertical-align:inherit}input,textarea{min-width:30em;min-width:30rem}tbody>tr:nth-child(odd){background:#ddd}a:active,a:hover{color:#7d12db;color:var(--link-hover-color)}iframe{display:block;margin:0 auto}.bracketed{color:#12db18;color:var(--edit-link-color)}#main-nav a,.bracketed{text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}.bracketed:before{content:"[\00a0"}.bracketed:after{content:"\00a0]"}.bracketed:active,.bracketed:hover{color:#db7d12;color:var(--edit-link-hover-color)}.grow-1{flex-grow:1}.flex-wrap{flex-wrap:wrap}.flex-no-wrap{flex-wrap:nowrap}.flex-align-start{align-content:flex-start}.flex-align-end{align-items:flex-end}.flex-align-space-around{align-content:space-around}.flex-justify-start{justify-content:flex-start}.flex-justify-space-around{justify-content:space-around}.flex-center{justify-content:center}.flex-self-center{align-self:center}.flex-space-evenly{justify-content:space-evenly}.flex{display:inline-block;display:flex}.small-font{font-size:1.6rem}.justify{text-align:justify}.align-center{text-align:center!important}.align-left{text-align:left!important}.align-right{text-align:right!important}.valign-top{vertical-align:top}.no-border{border:none}.media-wrap{text-align:center;margin:0 auto;position:relative}.media-wrap-flex{display:inline-block;display:flex;flex-wrap:wrap;align-content:space-evenly;justify-content:space-between;position:relative}td .media-wrap-flex{justify-content:center}.danger{background-color:#ff4136;border-color:#924949;color:#924949}.danger:active,.danger:hover{background-color:#924949;border-color:#ff4136;color:#ff4136}td.danger,td.danger:active,td.danger:hover{background-color:transparent;color:#924949}.user-btn{background:transparent;border-color:#12db18;border-color:var(--edit-link-color);color:#12db18;color:var(--edit-link-color);text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow);padding:0 .5rem}.user-btn:active,.user-btn:hover{background:transparent;border-color:#db7d12;border-color:var(--edit-link-hover-color);color:#db7d12;color:var(--edit-link-hover-color)}.user-btn:active{background:#db7d12;background:var(--edit-link-hover-color);color:#fff}.full-width{width:100%}.full-height{max-height:none}.toph{margin-top:0}#main-nav{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem;border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem;font-style:normal;font-weight:500}.sorting,.sorting-asc,.sorting-desc{vertical-align:text-bottom}.sorting:before{content:" ↕\00a0"}.sorting-asc:before{content:" ↑\00a0"}.sorting-desc:before{content:" ↓\00a0"}.form thead th,.form thead tr{background:inherit;border:0}.form tr>td:nth-child(odd){text-align:right;min-width:25px;max-width:30%}.form tr>td:nth-child(2n){text-align:left}.invisible tbody>tr:nth-child(odd){background:inherit}.borderless,.borderless td,.borderless th,.borderless tr,.invisible td,.invisible th,.invisible tr{box-shadow:none;border:0}.message,.static-message{position:relative;margin:.5em auto;padding:.5em;width:95%}.message .close{width:1em;height:1em;position:absolute;right:.5em;top:.5em;text-align:center;vertical-align:middle;line-height:1em}.message:hover .close:after{content:"☒"}.message:hover{cursor:pointer}.message .icon{left:.5em;top:.5em;margin-right:1em}.message.error,.static-message.error{border:1px solid #924949;background:#f3e6e6}.message.error .icon:after{content:"✘"}.message.success,.static-message.success{border:1px solid #1f8454;background:#70dda9}.message.success .icon:after{content:"✔"}.message.info,.static-message.info{border:1px solid #bfbe3a;background:#ffc}.message.info .icon:after{content:"⚠"}.character,.media,.small-character{position:relative;vertical-align:top;display:inline-block;text-align:center;width:220px;height:312px;margin:.25em .125em;margin:var(--normal-padding);z-index:0;background:rgba(0,0,0,.15)}.details picture.cover,picture.cover{display:inline;display:initial;width:100%}.character>img,.media>img,.small-character>img{width:100%}.media .edit-buttons>button{margin:.5em auto}.media-metadata>div,.medium-metadata>div,.name,.row{text-shadow:2px 2px 2px #000;text-shadow:var(--shadow);color:#fff;color:var(--text-color);padding:.25em .125em;padding:var(--normal-padding);text-align:right;z-index:2}.age-rating,.media-type{text-align:left}.media>.media-metadata{position:absolute;bottom:0;right:0}.media>.medium-metadata{position:absolute;bottom:0;left:0}.media>.name{position:absolute;top:0}.media>.name a{display:inline-block;transition:none}.media .name a:before{content:"";display:block;height:312px;left:0;position:absolute;top:0;width:220px;z-index:-1}.media-list .media:hover .name a:before{background:rgba(0,0,0,.75)}.media>.name span.canonical{font-weight:700}.media>.name small{font-weight:400}.media:hover .name{background:rgba(0,0,0,.75)}.media-list .media>.name a:hover,.media-list .media>.name a:hover small{color:#1271db;color:var(--blue-link)}.media:hover>.edit-buttons[hidden],.media:hover>button[hidden]{transition:.25s ease;display:block}.media:hover{transition:.25s ease}.character>.name a,.character>.name a small,.media>.name a,.media>.name a small,.small-character>.name a,.small-character>.name a small{background:none;color:#fff;text-shadow:2px 2px 2px #000;text-shadow:var(--shadow)}.anime .name,.manga .name{background:#000;background:var(--title-overlay-fallback);background:rgba(0,0,0,.45);background:var(--title-overlay);text-align:center;width:100%;padding:.5em .25em}.anime .age-rating,.anime .airing-status,.anime .completion,.anime .delete,.anime .edit,.anime .media-type,.anime .user-rating{background:none;text-align:center}.anime .table,.manga .table{position:absolute;bottom:0;left:0;width:100%}.anime .row,.manga .row{width:100%;display:inline-block;display:flex;align-content:space-around;justify-content:space-around;text-align:center;padding:0 inherit}.anime .row>span,.manga .row>span{text-align:left;z-index:2}.anime .row>div,.manga .row>div{font-size:.8em;display:inline-block;display:flex-item;align-self:center;text-align:center;vertical-align:middle;z-index:2}.anime .media>button.plus-one{border-color:hsla(0,0%,100%,.65);position:absolute;top:138px;top:calc(50% - 21.2px);left:44px;left:calc(50% - 57.8px);z-index:50}.manga .row{padding:1px}.manga .media{height:310px;margin:.25em}.manga .media>.edit-buttons{position:absolute;top:86px;top:calc(50% - 21.2px);left:43.5px;left:calc(50% - 57.8px);z-index:40}.manga .media>.edit-buttons button{border-color:hsla(0,0%,100%,.65)}.media.search>.name{background-color:#555;background-color:rgba(0,0,0,.35);background-size:cover;background-size:contain;background-repeat:no-repeat}.media.search>.row{z-index:6}.big-check,.mal-check{display:none}.big-check:checked+label{transition:.25s ease;background:rgba(0,0,0,.75)}.big-check:checked+label:after{content:"✓";font-size:15em;font-size:15rem;text-align:center;color:#adff2f;position:absolute;top:147px;left:0;width:100%;z-index:5}#series-list article.media{position:relative}#series-list .name,#series-list .name label{position:absolute;display:block;top:0;left:0;height:100%;width:100%;vertical-align:middle;line-height:1.25em}#series-list .name small{color:#fff}.details{margin:1.5rem auto 0;padding:1rem;font-size:inherit}.fixed{max-width:115em;max-width:115rem;margin:0 auto}.details .cover{display:block}.details .flex>*{margin:1rem}.details .media-details td{padding:0 1.5rem}.details p{text-align:justify}.details .media-details td:nth-child(odd){width:1%;white-space:nowrap;text-align:right}.details .media-details td:nth-child(2n){text-align:left}.details a h1,.details a h2{margin-top:0}.character,.person,.small-character{width:225px;height:350px;vertical-align:middle;white-space:nowrap;position:relative}.person{width:225px;height:338px}.small-person{width:200px;height:300px}.character a{height:350px}.character:hover .name,.small-character:hover .name{background:rgba(0,0,0,.8)}.small-character a{display:inline-block;width:100%;height:100%}.character .name,.small-character .name{position:absolute;bottom:0;left:0;z-index:10}.character img,.character picture,.person img,.person picture,.small-character img,.small-character picture{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;max-height:350px;max-width:225px}.person img,.person picture{max-height:338px}.small-person img,.small-person picture{max-height:300px;max-width:200px}.min-table{min-width:0;margin-left:0}.max-table{min-width:100%;margin:0}aside.info{max-width:33%}.fixed aside{max-width:390px}aside img,aside picture{display:block;margin:0 auto}.small-character{width:160px;height:250px}.small-character img,.small-character picture{max-height:250px;max-width:160px}.user-page .media-wrap{text-align:left}.media a{display:inline-block;width:100%;height:100%}.streaming-logo{width:50px;height:50px;vertical-align:middle}.small-streaming-logo{width:25px;height:25px;vertical-align:middle}.cover-streaming-link{display:none}.media:hover .cover-streaming-link{display:block}.cover-streaming-link .streaming-logo{width:20px;height:20px;-webkit-filter:drop-shadow(0 -1px 4px #fff);filter:drop-shadow(0 -1px 4px #fff)}.history-img{width:110px;height:156px}.settings.form .content article{margin:1em;display:inline-block;width:auto}.responsive-iframe{margin-top:1em;overflow:hidden;padding-bottom:56.25%;position:relative;height:0}.responsive-iframe iframe{left:0;top:0;height:100%;width:100%;position:absolute}.cssload-loader{position:relative;left:calc(50% - 31px);width:62px;height:62px;border-radius:50%;perspective:780px}.cssload-inner{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:50%}.cssload-inner.cssload-one{left:0;top:0;-webkit-animation:cssload-rotate-one 1.15s linear infinite;animation:cssload-rotate-one 1.15s linear infinite;border-bottom:3px solid #000}.cssload-inner.cssload-two{right:0;top:0;-webkit-animation:cssload-rotate-two 1.15s linear infinite;animation:cssload-rotate-two 1.15s linear infinite;border-right:3px solid #000}.cssload-inner.cssload-three{right:0;bottom:0;-webkit-animation:cssload-rotate-three 1.15s linear infinite;animation:cssload-rotate-three 1.15s linear infinite;border-top:3px solid #000}@-webkit-keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}@keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}#loading-shadow{background:rgba(0,0,0,.8);z-index:500}#loading-shadow,#loading-shadow .loading-wrapper{position:fixed;top:0;left:0;width:100%;height:100%}#loading-shadow .loading-wrapper{z-index:501;display:flex;align-items:center;justify-content:center}#loading-shadow .loading-content{position:relative;color:#fff}.loading-content .cssload-inner.cssload-one,.loading-content .cssload-inner.cssload-three,.loading-content .cssload-inner.cssload-two{border-color:#fff}.tabs{display:inline-block;display:flex;flex-wrap:wrap;background:#efefef;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.tabs>label{border:1px solid #e5e5e5;width:100%;padding:20px 30px;background:#e5e5e5;cursor:pointer;font-weight:700;font-size:18px;color:#7f7f7f;transition:background .1s,color .1s}.tabs>label:hover{background:#d8d8d8}.tabs>label:active{background:#ccc}.tabs>[type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.tabs>[type=radio]{position:absolute;opacity:0}.tabs>[type=radio]:checked+label{border-bottom:1px solid #fff;background:#fff;color:#000}.tabs>[type=radio]:checked+label+.content{display:block}.tabs .content,.tabs>[type=radio]:checked+label+.content{border:1px solid #e5e5e5;border-top:0;padding:15px;background:#fff;width:100%;margin:0 auto;overflow:auto}.tabs .content{display:none;max-height:950px}.tabs .content.full-height{max-height:none}@media (min-width:800px){.tabs>label{width:auto}.tabs .content{order:99}}.vertical-tabs{border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto;position:relative;width:100%}.vertical-tabs input[type=radio]{position:absolute;opacity:0}.vertical-tabs .tab{align-items:center;display:inline-block;display:flex;flex-wrap:nowrap}.vertical-tabs .tab label{align-items:center;background:#e5e5e5;border:1px solid #e5e5e5;color:#7f7f7f;cursor:pointer;font-size:18px;font-weight:700;padding:0 20px;width:28%}.vertical-tabs .tab label:hover{background:#d8d8d8}.vertical-tabs .tab label:active{background:#ccc}.vertical-tabs .tab .content{display:none;border:1px solid #e5e5e5;border-left:0;border-right:0;max-height:950px;overflow:auto}.vertical-tabs .tab .content.full-height{max-height:none}.vertical-tabs [type=radio]:checked+label{border:0;background:#fff;color:#000;width:38%}.vertical-tabs [type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.vertical-tabs [type=radio]:checked~.content{display:block}@media screen and (max-width:1100px){.flex{flex-wrap:wrap}.fixed aside.info,.fixed aside.info+article,aside.info,aside.info+article{max-width:none;width:100%}}@media screen and (max-width:800px){*{max-width:none}table{box-shadow:none}.details .flex>*,body{margin:0}table,table.align-center,table .align-right,table td,table th{border:0;margin-left:auto;margin-right:auto;text-align:left;width:100%}table td{display:inline-block}table.media-details,table tbody{width:100%}table.media-details td{display:block;text-align:left!important;width:100%}table thead{display:none}.details .media-details td:nth-child(odd){font-weight:700;width:100%}table.streaming-links tr td:not(:first-child){display:none}}@media screen and (max-width:40em){nav a{line-height:4em;line-height:4rem}img,picture{width:100%}main{padding:0 .5rem .5rem}.media{margin:2px 0}.details{padding:.5rem}.tabs>[type=radio]:checked+label{background:#fff}.vertical-tabs .tab{flex-wrap:wrap}.tabs .content,.tabs>[type=radio]:checked+label+.content,.vertical-tabs .tab .content{display:block;border:0;max-height:none}.tabs>[type=radio]:checked+label,.tabs>label,.tabs>label:active,.tabs>label:hover,.vertical-tabs .tab label,.vertical-tabs .tab label:active,.vertical-tabs .tab label:hover,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:focus+label{background:#fff;border:0;width:100%;cursor:default;color:#000}} \ No newline at end of file +:root{--default-font-list:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--monospace-font-list:"Anonymous Pro","Fira Code",Menlo,Monaco,Consolas,"Courier New",monospace;--serif-font-list:Georgia,Times,"Times New Roman",serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);line-height:1.4;overflow-y:scroll;-moz-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}audio:not([controls]){display:none}details{display:block}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{margin:0 auto;padding:0 1.6rem 1.6rem}main,pre,summary{display:block}pre{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);font-size:1.4em;font-size:1.4rem;margin:1.6rem 0;overflow:auto;padding:1.6rem;word-break:break-all;word-wrap:break-word}progress{display:inline-block}small{color:#777;font-size:75%}big{font-size:125%}template{display:none}textarea{border:.1rem solid #ccc;border-radius:0;display:block;margin-bottom:.8rem;overflow:auto;padding:.8rem;resize:vertical;vertical-align:middle}[hidden]{display:none}[unselectable]{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit;margin:0;padding:0}:after,:before{text-decoration:inherit;vertical-align:inherit}a{-webkit-transition:.25s ease;color:#1271db;text-decoration:none;transition:.25s ease}audio,canvas,iframe,img,svg,video{vertical-align:middle}input,textarea{border:.1rem solid #ccc;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.4em}code,kbd,pre,samp{font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list)}table{border-collapse:collapse;border-spacing:0;margin-bottom:1.6rem}::-moz-selection{background-color:#b3d4fc;text-shadow:none}::selection{background-color:#b3d4fc;text-shadow:none}button::-moz-focus-inner{border:0}body{color:#444;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);font-size:1.6rem;font-style:normal;font-weight:400;padding:0}p{margin:0 0 1.6rem}h1,h2,h3,h4,h5,h6{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem}h1{border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem}h1,h2{font-style:normal;font-weight:500}h2{font-size:3em;font-size:3rem}h3{font-size:2.4em;font-size:2.4rem;font-style:normal;font-weight:500;margin:1.6rem 0 .4rem}h4{font-size:1.8em;font-size:1.8rem}h4,h5{font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}h5{font-size:1.6em;font-size:1.6rem}h6{color:#777;font-size:1.4em;font-style:normal;font-weight:600;margin:1.6rem 0 .4rem}code,h6{font-size:1.4rem}code{background:#efefef;color:#444;font-family:Anonymous Pro,Fira Code,Menlo,Monaco,Consolas,Courier New,monospace;font-family:var(--monospace-font-list);word-break:break-all;word-wrap:break-word}a:focus,a:hover{text-decoration:none}dl{margin-bottom:1.6rem}dd{margin-left:4rem}ol,ul{margin-bottom:.8rem;padding-left:2rem}blockquote{border-left:.2rem solid #1271db;font-style:italic;margin:1.6rem 0;padding-left:1.6rem}blockquote,figcaption{font-family:Georgia,Times,Times New Roman,serif;font-family:var(--serif-font-list)}html{font-size:62.5%}article,aside,details,footer,header,main,section,summary{display:block;height:auto;margin:0 auto;width:100%}footer{clear:both;display:inline-block;float:left;max-width:100%;padding:1rem 0;text-align:center}footer,hr{border-top:.1rem solid rgba(0,0,0,.2)}hr{display:block;margin-bottom:1.6rem;width:100%}img{height:auto;vertical-align:baseline}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{border:.1rem solid #ccc;border-radius:0;display:inline-block;padding:.8rem;vertical-align:middle}input:not([type]){-webkit-appearance:none;background-clip:padding-box;background-color:#fff;border:.1rem solid #ccc;border-radius:0;color:#444;display:inline-block;padding:.8rem;text-align:left}input[type=color]{padding:.8rem 1.6rem}input:not([type]):focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{border-color:#b3d4fc}input[type=checkbox],input[type=radio]{vertical-align:middle}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:.1rem thin solid #444}input:not([type])[disabled],input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled],textarea[disabled]{background-color:#efefef;color:#777;cursor:not-allowed}input[readonly],textarea[readonly]{background-color:#efefef;border-color:#ccc;color:#777}input:focus:invalid,textarea:focus:invalid{border-color:#e9322d;color:#b94a48}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#ff4136}select[multiple]{height:auto}label{line-height:2}fieldset{border:0;margin:0;padding:.8rem 0}legend{border-bottom:.1rem solid #ccc;color:#444;display:block;margin-bottom:.8rem;padding:.8rem 0;width:100%}button,input[type=submit]{-moz-user-select:none;-ms-user-select:none;-webkit-transition:.25s ease;-webkit-user-drag:none;-webkit-user-select:none;border:.2rem solid #444;border-radius:0;color:#444;cursor:pointer;display:inline-block;margin-bottom:.8rem;margin-right:.4rem;padding:.8rem 1.6rem;text-align:center;text-decoration:none;text-transform:uppercase;transition:.25s ease;user-select:none;vertical-align:baseline}button a,input[type=submit] a{color:#444}button::-moz-focus-inner,input[type=submit]::-moz-focus-inner{padding:0}button:hover,input[type=submit]:hover{background:#444;border-color:#444;color:#fff}button:hover a,input[type=submit]:hover a{color:#fff}button:active,input[type=submit]:active{background:#6a6a6a;border-color:#6a6a6a;color:#fff}button:active a,input[type=submit]:active a{color:#fff}button:disabled,input[type=submit]:disabled{box-shadow:none;cursor:not-allowed;opacity:.4}nav ul{list-style:none;margin:0;padding:0;text-align:center}nav ul li{display:inline}nav a{-webkit-transition:.25s ease;border-bottom:.2rem solid transparent;color:#444;padding:.8rem 1.6rem;text-decoration:none;transition:.25s ease}nav a:hover,nav li.selected a{border-color:rgba(0,0,0,.2)}nav a:active{border-color:rgba(0,0,0,.56)}caption{padding:.8rem 0}thead th{background:#efefef;color:#444}tr{background:#fff;margin-bottom:.8rem}td,th{border:.1rem solid #ccc;padding:.8rem 1.6rem;text-align:center;vertical-align:inherit}tfoot tr{background:none}tfoot td{color:#efefef;font-size:.8rem;font-style:italic;padding:1.6rem .4rem}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0)!important;position:absolute!important}}@media screen and max-width 40rem{article,aside,section{clear:both;display:block;max-width:100%}img{margin-right:1.6rem}}:root{--blue-link:#1271db;--link-shadow:1px 1px 1px #000;--white-link-shadow:1px 1px 1px #fff;--shadow:2px 2px 2px #000;--title-overlay:rgba(0,0,0,0.45);--title-overlay-fallback:#000;--text-color:#fff;--normal-padding:0.25em 0.125em;--link-hover-color:#7d12db;--edit-link-hover-color:#db7d12;--edit-link-color:#12db18;--radius:5px}.media[hidden],[hidden=hidden],template{display:none}body{margin:.5em}button{background:#fff;background:linear-gradient(#ddd,#eee,#fff,#eee,#ddd);border-radius:.5em;margin:0;text-transform:none}button,button:hover{border-color:#555;color:#555}button:hover{background:#bbb;background:linear-gradient(#cfcfcf,#dfdfdf,#efefef,#dfdfdf,#cfcfcf)}button:active{background:#ddd;background:linear-gradient(#ddd,#ddd)}.media:hover button{background:linear-gradient(#bbb,#ccc,#ddd,#ccc,#bbb)}.media:hover button:hover{background:linear-gradient(#afafaf,#bfbfbf,#cfcfcf,#bfbfbf,#afafaf)}table{box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto}td{padding:1rem}thead td,thead th{padding:.5rem}input[type=number]{min-width:0;width:4.5em}input[type=checkbox],input[type=radio]{min-width:auto;vertical-align:inherit}input,textarea{min-width:30em;min-width:30rem}tbody>tr:nth-child(odd){background:#ddd}a:active,a:hover{color:#7d12db;color:var(--link-hover-color)}iframe{display:block;margin:0 auto;border:0}.bracketed{color:#12db18;color:var(--edit-link-color)}#main-nav a,.bracketed{text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow)}.bracketed:before{content:"[\00a0"}.bracketed:after{content:"\00a0]"}.bracketed:active,.bracketed:hover{color:#db7d12;color:var(--edit-link-hover-color)}.grow-1{flex-grow:1}.flex-wrap{flex-wrap:wrap}.flex-no-wrap{flex-wrap:nowrap}.flex-align-start{align-content:flex-start}.flex-align-end{align-items:flex-end}.flex-align-space-around{align-content:space-around}.flex-justify-start{justify-content:flex-start}.flex-justify-space-around{justify-content:space-around}.flex-center{justify-content:center}.flex-self-center{align-self:center}.flex-space-evenly{justify-content:space-evenly}.flex{display:inline-block;display:flex}.small-font{font-size:1.6rem}.justify{text-align:justify}.align-center{text-align:center!important}.align-left{text-align:left!important}.align-right{text-align:right!important}.valign-top{vertical-align:top}.no-border{border:none}.media-wrap{text-align:center;margin:0 auto;position:relative}.media-wrap-flex{display:inline-block;display:flex;flex-wrap:wrap;align-content:space-evenly;justify-content:space-between;position:relative}td .media-wrap-flex{justify-content:center}.danger{background-color:#ff4136;border-color:#924949;color:#924949}.danger:active,.danger:hover{background-color:#924949;border-color:#ff4136;color:#ff4136}td.danger,td.danger:active,td.danger:hover{background-color:transparent;color:#924949}.user-btn{background:transparent;border-color:#12db18;border-color:var(--edit-link-color);color:#12db18;color:var(--edit-link-color);text-shadow:1px 1px 1px #000;text-shadow:var(--link-shadow);padding:0 .5rem}.user-btn:active,.user-btn:hover{background:transparent;border-color:#db7d12;border-color:var(--edit-link-hover-color);color:#db7d12;color:var(--edit-link-hover-color)}.user-btn:active{background:#db7d12;background:var(--edit-link-hover-color);color:#fff}.full-width{width:100%}.full-height{max-height:none}.toph{margin-top:0}#main-nav{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--default-font-list);margin:2rem 0 1.6rem;border-bottom:.1rem solid rgba(0,0,0,.2);font-size:3.6em;font-size:3.6rem;font-style:normal;font-weight:500}.sorting,.sorting-asc,.sorting-desc{vertical-align:text-bottom}.sorting:before{content:" ↕\00a0"}.sorting-asc:before{content:" ↑\00a0"}.sorting-desc:before{content:" ↓\00a0"}.form thead th,.form thead tr{background:inherit;border:0}.form tr>td:nth-child(odd){text-align:right;min-width:25px;max-width:30%}.form tr>td:nth-child(2n){text-align:left}.invisible tbody>tr:nth-child(odd){background:inherit}.borderless,.borderless td,.borderless th,.borderless tr,.invisible td,.invisible th,.invisible tr{box-shadow:none;border:0}.message,.static-message{position:relative;margin:.5em auto;padding:.5em;width:95%}.message .close{width:1em;height:1em;position:absolute;right:.5em;top:.5em;text-align:center;vertical-align:middle;line-height:1em}.message:hover .close:after{content:"☒"}.message:hover{cursor:pointer}.message .icon{left:.5em;top:.5em;margin-right:1em}.message.error,.static-message.error{border:1px solid #924949;background:#f3e6e6}.message.error .icon:after{content:"✘"}.message.success,.static-message.success{border:1px solid #1f8454;background:#70dda9}.message.success .icon:after{content:"✔"}.message.info,.static-message.info{border:1px solid #bfbe3a;background:#ffc}.message.info .icon:after{content:"⚠"}.character,.media,.small-character{position:relative;vertical-align:top;display:inline-block;text-align:center;width:220px;height:312px;margin:.25em .125em;margin:var(--normal-padding);z-index:0;background:rgba(0,0,0,.15)}.details picture.cover,picture.cover{display:inline;display:initial;width:100%}.character>img,.media>img,.small-character>img{width:100%}.media .edit-buttons>button{margin:.5em auto}.media-metadata>div,.medium-metadata>div,.name,.row{text-shadow:2px 2px 2px #000;text-shadow:var(--shadow);color:#fff;color:var(--text-color);padding:.25em .125em;padding:var(--normal-padding);text-align:right;z-index:2}.age-rating,.media-type{text-align:left}.media>.media-metadata{position:absolute;bottom:0;right:0}.media>.medium-metadata{position:absolute;bottom:0;left:0}.media>.name{position:absolute;top:0}.media>.name a{display:inline-block;transition:none}.media .name a:before{content:"";display:block;height:312px;left:0;position:absolute;top:0;width:220px;z-index:-1}.media-list .media:hover .name a:before{background:rgba(0,0,0,.75)}.media>.name span.canonical{font-weight:700}.media>.name small{font-weight:400}.media:hover .name{background:rgba(0,0,0,.75)}.media-list .media>.name a:hover,.media-list .media>.name a:hover small{color:#1271db;color:var(--blue-link)}.media:hover>.edit-buttons[hidden],.media:hover>button[hidden]{transition:.25s ease;display:block}.media:hover{transition:.25s ease}.character>.name a,.character>.name a small,.media>.name a,.media>.name a small,.small-character>.name a,.small-character>.name a small{background:none;color:#fff;text-shadow:2px 2px 2px #000;text-shadow:var(--shadow)}.anime .name,.manga .name{background:#000;background:var(--title-overlay-fallback);background:rgba(0,0,0,.45);background:var(--title-overlay);text-align:center;width:100%;padding:.5em .25em}.anime .age-rating,.anime .airing-status,.anime .completion,.anime .delete,.anime .edit,.anime .media-type,.anime .user-rating{background:none;text-align:center}.anime .table,.manga .table{position:absolute;bottom:0;left:0;width:100%}.anime .row,.manga .row{width:100%;display:inline-block;display:flex;align-content:space-around;justify-content:space-around;text-align:center;padding:0 inherit}.anime .row>span,.manga .row>span{text-align:left;z-index:2}.anime .row>div,.manga .row>div{font-size:.8em;display:inline-block;display:flex-item;align-self:center;text-align:center;vertical-align:middle;z-index:2}.anime .media>button.plus-one{border-color:hsla(0,0%,100%,.65);position:absolute;top:138px;top:calc(50% - 21.2px);left:44px;left:calc(50% - 57.8px);z-index:50}.manga .row{padding:1px}.manga .media{height:310px;margin:.25em}.manga .media>.edit-buttons{position:absolute;top:86px;top:calc(50% - 21.2px);left:43.5px;left:calc(50% - 57.8px);z-index:40}.manga .media>.edit-buttons button{border-color:hsla(0,0%,100%,.65)}.media.search>.name{background-color:#555;background-color:rgba(0,0,0,.35);background-size:cover;background-size:contain;background-repeat:no-repeat}.media.search>.row{z-index:6}.big-check,.mal-check{display:none}.big-check:checked+label{transition:.25s ease;background:rgba(0,0,0,.75)}.big-check:checked+label:after{content:"✓";font-size:15em;font-size:15rem;text-align:center;color:#adff2f;position:absolute;top:147px;left:0;width:100%;z-index:5}#series-list article.media{position:relative}#series-list .name,#series-list .name label{position:absolute;display:block;top:0;left:0;height:100%;width:100%;vertical-align:middle;line-height:1.25em}#series-list .name small{color:#fff}.details{margin:1.5rem auto 0;padding:1rem;font-size:inherit}.fixed{max-width:115em;max-width:115rem;margin:0 auto}.details .cover{display:block}.details .flex>*{margin:1rem}.details .media-details td{padding:0 1.5rem}.details p{text-align:justify}.details .media-details td:nth-child(odd){width:1%;white-space:nowrap;text-align:right}.details .media-details td:nth-child(2n){text-align:left}.details a h1,.details a h2{margin-top:0}.character,.person,.small-character{width:225px;height:350px;vertical-align:middle;white-space:nowrap;position:relative}.person{width:225px;height:338px}.small-person{width:200px;height:300px}.character a{height:350px}.character:hover .name,.small-character:hover .name{background:rgba(0,0,0,.8)}.small-character a{display:inline-block;width:100%;height:100%}.character .name,.small-character .name{position:absolute;bottom:0;left:0;z-index:10}.character img,.character picture,.person img,.person picture,.small-character img,.small-character picture{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;max-height:350px;max-width:225px}.person img,.person picture{max-height:338px}.small-person img,.small-person picture{max-height:300px;max-width:200px}.min-table{min-width:0;margin-left:0}.max-table{min-width:100%;margin:0}aside.info{max-width:33%}.fixed aside{max-width:390px}aside img,aside picture{display:block;margin:0 auto}.small-character{width:160px;height:250px}.small-character img,.small-character picture{max-height:250px;max-width:160px}.user-page .media-wrap{text-align:left}.media a{display:inline-block;width:100%;height:100%}.streaming-logo{width:50px;height:50px;vertical-align:middle}.small-streaming-logo{width:25px;height:25px;vertical-align:middle}.cover-streaming-link{display:none}.media:hover .cover-streaming-link{display:block}.cover-streaming-link .streaming-logo{width:20px;height:20px;-webkit-filter:drop-shadow(0 -1px 4px #fff);filter:drop-shadow(0 -1px 4px #fff)}.history-img{width:110px;height:156px}.settings.form .content article{margin:1em;display:inline-block;width:auto}.responsive-iframe{margin-top:1em;overflow:hidden;padding-bottom:56.25%;position:relative;height:0}.responsive-iframe iframe{left:0;top:0;height:100%;width:100%;position:absolute}.cssload-loader{position:relative;left:calc(50% - 31px);width:62px;height:62px;border-radius:50%;perspective:780px}.cssload-inner{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:50%}.cssload-inner.cssload-one{left:0;top:0;-webkit-animation:cssload-rotate-one 1.15s linear infinite;animation:cssload-rotate-one 1.15s linear infinite;border-bottom:3px solid #000}.cssload-inner.cssload-two{right:0;top:0;-webkit-animation:cssload-rotate-two 1.15s linear infinite;animation:cssload-rotate-two 1.15s linear infinite;border-right:3px solid #000}.cssload-inner.cssload-three{right:0;bottom:0;-webkit-animation:cssload-rotate-three 1.15s linear infinite;animation:cssload-rotate-three 1.15s linear infinite;border-top:3px solid #000}@-webkit-keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@keyframes cssload-rotate-one{0%{transform:rotateX(35deg) rotateY(-45deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(-45deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@keyframes cssload-rotate-two{0%{transform:rotateX(50deg) rotateY(10deg) rotate(0deg)}to{transform:rotateX(50deg) rotateY(10deg) rotate(1turn)}}@-webkit-keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}@keyframes cssload-rotate-three{0%{transform:rotateX(35deg) rotateY(55deg) rotate(0deg)}to{transform:rotateX(35deg) rotateY(55deg) rotate(1turn)}}#loading-shadow{background:rgba(0,0,0,.8);z-index:500}#loading-shadow,#loading-shadow .loading-wrapper{position:fixed;top:0;left:0;width:100%;height:100%}#loading-shadow .loading-wrapper{z-index:501;display:flex;align-items:center;justify-content:center}#loading-shadow .loading-content{position:relative;color:#fff}.loading-content .cssload-inner.cssload-one,.loading-content .cssload-inner.cssload-three,.loading-content .cssload-inner.cssload-two{border-color:#fff}.tabs{display:inline-block;display:flex;flex-wrap:wrap;background:#efefef;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.tabs>label{border:1px solid #e5e5e5;width:100%;padding:20px 30px;background:#e5e5e5;cursor:pointer;font-weight:700;font-size:18px;color:#7f7f7f;transition:background .1s,color .1s}.tabs>label:hover{background:#d8d8d8}.tabs>label:active{background:#ccc}.tabs>[type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.tabs>[type=radio]{position:absolute;opacity:0}.tabs>[type=radio]:checked+label{border-bottom:1px solid #fff;background:#fff;color:#000}.tabs>[type=radio]:checked+label+.content{display:block}.single-tab,.tabs .content,.tabs>[type=radio]:checked+label+.content{border:1px solid #e5e5e5;border-top:0;padding:15px;background:#fff;width:100%;margin:0 auto;overflow:auto}.single-tab,.tabs .content{display:none;max-height:950px}.single-tab{display:block;border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin-top:1.5em}.single-tab.full-height,.tabs .content.full-height{max-height:none}@media (min-width:800px){.tabs>label{width:auto}.tabs .content{order:99}}.vertical-tabs{border:1px solid #e5e5e5;box-shadow:0 48px 80px -32px rgba(0,0,0,.3);margin:0 auto;position:relative;width:100%}.vertical-tabs input[type=radio]{position:absolute;opacity:0}.vertical-tabs .tab{align-items:center;display:inline-block;display:flex;flex-wrap:nowrap}.vertical-tabs .tab label{align-items:center;background:#e5e5e5;border:1px solid #e5e5e5;color:#7f7f7f;cursor:pointer;font-size:18px;font-weight:700;padding:0 20px;width:28%}.vertical-tabs .tab label:hover{background:#d8d8d8}.vertical-tabs .tab label:active{background:#ccc}.vertical-tabs .tab .content{display:none;border:1px solid #e5e5e5;border-left:0;border-right:0;max-height:950px;overflow:auto}.vertical-tabs .tab .content.full-height{max-height:none}.vertical-tabs [type=radio]:checked+label{border:0;background:#fff;color:#000;width:38%}.vertical-tabs [type=radio]:focus+label{box-shadow:inset 0 0 0 3px #2aa1c0;z-index:1}.vertical-tabs [type=radio]:checked~.content{display:block}@media screen and (max-width:1100px){.flex{flex-wrap:wrap}.fixed aside.info,.fixed aside.info+article,aside.info,aside.info+article{max-width:none;width:100%}}@media screen and (max-width:800px){*{max-width:none}table{box-shadow:none}.details .flex>*,body{margin:0}table,table.align-center,table .align-right,table td,table th{border:0;margin-left:auto;margin-right:auto;text-align:left;width:100%}table td{display:inline-block}table.media-details,table tbody{width:100%}table.media-details td{display:block;text-align:left!important;width:100%}table thead{display:none}.details .media-details td:nth-child(odd){font-weight:700;width:100%}table.streaming-links tr td:not(:first-child){display:none}}@media screen and (max-width:40em){nav a{line-height:4em;line-height:4rem}img,picture{width:100%}main{padding:0 .5rem .5rem}.media{margin:2px 0}.details{padding:.5rem}.tabs>[type=radio]:checked+label{background:#fff}.vertical-tabs .tab{flex-wrap:wrap}.tabs .content,.tabs>[type=radio]:checked+label+.content,.vertical-tabs .tab .content{display:block;border:0;max-height:none}.tabs>[type=radio]:checked+label,.tabs>label,.tabs>label:active,.tabs>label:hover,.vertical-tabs .tab label,.vertical-tabs .tab label:active,.vertical-tabs .tab label:hover,.vertical-tabs [type=radio]:checked+label,.vertical-tabs [type=radio]:focus+label{background:#fff;border:0;width:100%;cursor:default;color:#000}} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 45907948..89db3804 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -199,27 +199,14 @@ final class Model { /** * Get information about a person * - * @param string $id + * @param string $slug * @return array * @throws InvalidArgumentException */ - public function getPerson(string $id): array + public function getPerson(string $slug): array { - return $this->getCached("kitsu-person-{$id}", fn () => $this->requestBuilder->getRequest("people/{$id}", [ - 'query' => [ - 'filter' => [ - 'id' => $id, - ], - 'fields' => [ - 'characters' => 'canonicalName,slug,image', - 'characterVoices' => 'mediaCharacter', - 'anime' => 'canonicalTitle,abbreviatedTitles,titles,slug,posterImage', - 'manga' => 'canonicalTitle,abbreviatedTitles,titles,slug,posterImage', - 'mediaCharacters' => 'role,media,character', - 'mediaStaff' => 'role,media,person', - ], - 'include' => 'voices.mediaCharacter.media,voices.mediaCharacter.character,staff.media', - ], + return $this->getCached("kitsu-person-{$slug}", fn () => $this->requestBuilder->runQuery('PersonDetails', [ + 'slug' => $slug ])); } diff --git a/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql index 48e8d484..0e043721 100644 --- a/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql @@ -1,5 +1,5 @@ -query ($id: ID!) { - findPersonById(id: $id) { +query ($slug: String!) { + findPersonBySlug(slug: $slug) { id description birthday @@ -22,6 +22,36 @@ query ($id: ID!) { canonical localized } + mediaStaff { + nodes { + id + role + media { + id + slug + type + posterImage { + original { + height + name + url + width + } + views { + height + name + url + width + } + } + titles { + alternatives + canonical + localized + } + } + } + } voices { nodes { locale @@ -29,6 +59,7 @@ query ($id: ID!) { role character { id + slug image { original { height @@ -43,6 +74,7 @@ query ($id: ID!) { } media { id + slug posterImage { original { height diff --git a/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php index 42f73e5b..151fcc68 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/CharacterTransformer.php @@ -50,7 +50,7 @@ final class CharacterTransformer extends AbstractTransformer { if (isset($data['media']['nodes'])) { - [$media, $castings] = $this->organizeMediaAndVoices($data['media']['nodes']); + [$media, $castings] = $this->organizeMediaAndVoices($data['media']['nodes'] ?? []); } return Character::from([ diff --git a/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php index 6ceb18e4..8b28cbb7 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\JsonAPI; +use Aviat\AnimeClient\Kitsu; use Aviat\AnimeClient\Types\Person; use Aviat\Ion\Transformer\AbstractTransformer; @@ -31,14 +31,17 @@ final class PersonTransformer extends AbstractTransformer { */ public function transform($personData): Person { - $data = JsonAPI::organizeData($personData); - $included = JsonAPI::organizeIncludes($personData['included']); + $data = $personData['data']['findPersonBySlug'] ?? []; + $canonicalName = $data['names']['localized'][$data['names']['canonical']] + ?? array_shift($data['names']['localized']); - $orgData = $this->organizeData($included); + $orgData = $this->organizeData($data); return Person::from([ 'id' => $data['id'], - 'name' => $data['attributes']['name'], + 'name' => $canonicalName, + 'names' => array_diff($data['names']['localized'], [$canonicalName]), + 'description' => $data['description']['en'] ?? '', 'characters' => $orgData['characters'], 'staff' => $orgData['staff'], ]); @@ -47,88 +50,98 @@ final class PersonTransformer extends AbstractTransformer { protected function organizeData(array $data): array { $output = [ - 'characters' => [ - 'main' => [], - 'supporting' => [], - ], + 'characters' => [], 'staff' => [], ]; - if (array_key_exists('characterVoices', $data)) - { - foreach ($data['characterVoices'] as $cv) - { - $mcId = $cv['relationships']['mediaCharacter']['data']['id']; + $characters = []; + $staff = []; - if ( ! array_key_exists($mcId, $data['mediaCharacters'])) + if (count($data['mediaStaff']['nodes']) > 0) + { + $roles = array_unique(array_column($data['mediaStaff']['nodes'], 'role')); + foreach ($roles as $role) + { + $staff[$role] = []; + } + ksort($staff); + + foreach ($data['mediaStaff']['nodes'] as $staffing) + { + $media = $staffing['media']; + $role = $staffing['role']; + $title = $media['titles']['canonical']; + $type = strtolower($media['type']); + + $staff[$role][$type][$media['id']] = [ + 'id' => $media['id'], + 'title' => $title, + 'titles' => array_merge([$title], Kitsu::getFilteredTitles($media['titles'])), + 'image' => [ + 'original' => $media['posterImage']['views'][1]['url'], + ], + 'slug' => $media['slug'], + ]; + + uasort($staff[$role][$type], fn ($a, $b) => $a['title'] <=> $b['title']); + } + + $output['staff'] = $staff; + } + + if (count($data['voices']['nodes']) > 0) + { + foreach ($data['voices']['nodes'] as $voicing) + { + $character = $voicing['mediaCharacter']['character']; + $charId = $character['id']; + $rawMedia = $voicing['mediaCharacter']['media']; + $role = strtolower($voicing['mediaCharacter']['role']); + + $media = [ + 'id' => $rawMedia['id'], + 'slug' => $rawMedia['slug'], + 'titles' => array_merge( + [$rawMedia['titles']['canonical']], + Kitsu::getFilteredTitles($rawMedia['titles']), + ), + ]; + + if ( ! isset($characters[$role][$charId])) { - continue; + if ( ! array_key_exists($role, $characters)) + { + $characters[$role] = []; + } + + $characters[$role][$charId] = [ + 'character' => [ + 'id' => $character['id'], + 'slug' => $character['slug'], + 'image' => [ + 'original' => $character['image']['original']['url'], + ], + 'canonicalName' => $character['names']['canonical'], + ], + 'media' => [ + $media['id'] => $media + ], + ]; + } + else + { + $characters[$role][$charId]['media'][$media['id']] = $media; } - $mc = $data['mediaCharacters'][$mcId]; - - $role = $mc['role']; - - $charId = $mc['relationships']['character']['data']['id']; - $mediaId = $mc['relationships']['media']['data']['id']; - - $existingMedia = array_key_exists($charId, $output['characters'][$role]) - ? $output['characters'][$role][$charId]['media'] - : []; - - $relatedMedia = [ - $mediaId => $data['anime'][$mediaId], - ]; - - $includedMedia = array_replace_recursive($existingMedia, $relatedMedia); - - uasort($includedMedia, static function ($a, $b) { - return $a['canonicalTitle'] <=> $b['canonicalTitle']; - }); - - $character = $data['characters'][$charId]; - - $output['characters'][$role][$charId] = [ - 'character' => $character, - 'media' => $includedMedia, - ]; - } - } - - if (array_key_exists('mediaStaff', $data)) - { - foreach ($data['mediaStaff'] as $rid => $role) - { - $roleName = $role['role']; - $mediaType = $role['relationships']['media']['data']['type']; - $mediaId = $role['relationships']['media']['data']['id']; - $media = $data[$mediaType][$mediaId]; - $output['staff'][$roleName][$mediaType][$mediaId] = $media; - } - } - - uasort($output['characters']['main'], static function ($a, $b) { - return $a['character']['canonicalName'] <=> $b['character']['canonicalName']; - }); - uasort($output['characters']['supporting'], static function ($a, $b) { - return $a['character']['canonicalName'] <=> $b['character']['canonicalName']; - }); - ksort($output['staff']); - foreach ($output['staff'] as $role => &$media) - { - if (array_key_exists('anime', $media)) - { - uasort($media['anime'], static function ($a, $b) { - return $a['canonicalTitle'] <=> $b['canonicalTitle']; - }); + uasort( + $characters[$role][$charId]['media'], + fn ($a, $b) => $a['titles'][0] <=> $b['titles'][0] + ); } - if (array_key_exists('manga', $media)) - { - uasort($media['manga'], static function ($a, $b) { - return $a['canonicalTitle'] <=> $b['canonicalTitle']; - }); - } + krsort($characters); + + $output['characters'] = $characters; } return $output; diff --git a/src/AnimeClient/API/Kitsu/schema.graphql b/src/AnimeClient/API/Kitsu/schema.graphql index 8b4980db..f3e62a46 100644 --- a/src/AnimeClient/API/Kitsu/schema.graphql +++ b/src/AnimeClient/API/Kitsu/schema.graphql @@ -402,10 +402,9 @@ type Anime implements Episodic & Media & WithTimestamps { youtubeTrailerVideoId: String } -type AnimeAmountConsumed implements AmountConsumed & WithTimestamps { +type AnimeAmountConsumed implements AmountConsumed { "Total media completed atleast once." completed: Int! - createdAt: ISO8601DateTime! id: ID! "Total amount of media." media: Int! @@ -417,13 +416,11 @@ type AnimeAmountConsumed implements AmountConsumed & WithTimestamps { time: Int! "Total progress of library including reconsuming." units: Int! - updatedAt: ISO8601DateTime! } -type AnimeCategoryBreakdown implements CategoryBreakdown & WithTimestamps { +type AnimeCategoryBreakdown implements CategoryBreakdown { "A Map of category_id -> count for all categories present on the library entries" categories: Map! - createdAt: ISO8601DateTime! id: ID! "The profile related to the user for this stat." profile: Profile! @@ -431,7 +428,6 @@ type AnimeCategoryBreakdown implements CategoryBreakdown & WithTimestamps { recalculatedAt: ISO8601Date! "The total amount of library entries." total: Int! - updatedAt: ISO8601DateTime! } "The connection type for Anime." @@ -468,13 +464,12 @@ type AnimeEdge { node: Anime } -type AnimeMutation implements WithTimestamps { +type AnimeMutation { "Create an Anime." create( "Create an Anime." input: AnimeCreateInput! ): AnimeCreatePayload - createdAt: ISO8601DateTime! "Delete an Anime." delete( "Delete an Anime." @@ -485,7 +480,6 @@ type AnimeMutation implements WithTimestamps { "Update an Anime." input: AnimeUpdateInput! ): AnimeUpdatePayload - updatedAt: ISO8601DateTime! } "Autogenerated return type of AnimeUpdate" @@ -739,6 +733,20 @@ type EpisodeConnection { totalCount: Int! } +"Autogenerated return type of EpisodeCreate" +type EpisodeCreatePayload { + episode: Episode + "Graphql Errors" + errors: [Generic!] +} + +"Autogenerated return type of EpisodeDelete" +type EpisodeDeletePayload { + episode: GenericDelete + "Graphql Errors" + errors: [Generic!] +} + "An edge in a connection." type EpisodeEdge { "A cursor for use in pagination." @@ -747,6 +755,31 @@ type EpisodeEdge { node: Episode } +type EpisodeMutation { + "Create an Episode." + create( + "Create an Episode" + input: EpisodeCreateInput! + ): EpisodeCreatePayload + "Delete an Episode." + delete( + "Delete an Episode" + input: GenericDeleteInput! + ): EpisodeDeletePayload + "Update an Episode." + update( + "Update an Episode" + input: EpisodeUpdateInput! + ): EpisodeUpdatePayload +} + +"Autogenerated return type of EpisodeUpdate" +type EpisodeUpdatePayload { + episode: Episode + "Graphql Errors" + errors: [Generic!] +} + "Favorite media, characters, and people for a user" type Favorite implements WithTimestamps { createdAt: ISO8601DateTime! @@ -778,30 +811,24 @@ type FavoriteEdge { node: Favorite } -type Generic implements Base & WithTimestamps { +type Generic implements Base { "The error code." code: String - createdAt: ISO8601DateTime! "A description of the error" message: String! "Which input value this error came from" path: [String!] - updatedAt: ISO8601DateTime! } -type GenericDelete implements WithTimestamps { - createdAt: ISO8601DateTime! +type GenericDelete { id: ID! - updatedAt: ISO8601DateTime! } -type Image implements WithTimestamps { +type Image { "A blurhash-encoded version of this image" blurhash: String - createdAt: ISO8601DateTime! "The original image" original: ImageView! - updatedAt: ISO8601DateTime! "The various generated views of this image" views(names: [String!]): [ImageView!]! } @@ -820,7 +847,7 @@ type ImageView implements WithTimestamps { } "The user library filterable by media_type and status" -type Library implements WithTimestamps { +type Library { "All Library Entries for a specific Media" all( "Returns the elements in the list that come after the specified cursor." @@ -846,7 +873,6 @@ type Library implements WithTimestamps { last: Int, mediaType: media_type! ): LibraryEntryConnection! - createdAt: ISO8601DateTime! "Library Entries for a specific Media filtered by the current status" current( "Returns the elements in the list that come after the specified cursor." @@ -895,7 +921,6 @@ type Library implements WithTimestamps { last: Int, mediaType: media_type! ): LibraryEntryConnection! - updatedAt: ISO8601DateTime! } "Information about a specific media entry for a user" @@ -984,13 +1009,12 @@ type LibraryEntryEdge { node: LibraryEntry } -type LibraryEntryMutation implements WithTimestamps { +type LibraryEntryMutation { "Create a library entry" create( "Create a Library Entry" input: LibraryEntryCreateInput! ): LibraryEntryCreatePayload - createdAt: ISO8601DateTime! "Delete a library entry" delete( "Delete Library Entry" @@ -1001,17 +1025,36 @@ type LibraryEntryMutation implements WithTimestamps { "Update Library Entry" input: LibraryEntryUpdateInput! ): LibraryEntryUpdatePayload - "Update a library entry status by id" + "Update library entry progress by id" + updateProgressById( + "Update library entry progress by id" + input: UpdateProgressByIdInput! + ): LibraryEntryUpdateProgressByIdPayload + "Update library entry progress by media" + updateProgressByMedia( + "Update library entry progress by media" + input: UpdateProgressByMediaInput! + ): LibraryEntryUpdateProgressByMediaPayload + "Update library entry rating by id" + updateRatingById( + "Update library entry rating by id" + input: UpdateRatingByIdInput! + ): LibraryEntryUpdateRatingByIdPayload + "Update library entry rating by media" + updateRatingByMedia( + "Update library entry rating by media" + input: UpdateRatingByMediaInput! + ): LibraryEntryUpdateRatingByMediaPayload + "Update library entry status by id" updateStatusById( - "Update a library entry status by id" + "Update library entry status by id" input: UpdateStatusByIdInput! ): LibraryEntryUpdateStatusByIdPayload - "Update a library entry status by media" + "Update library entry status by media" updateStatusByMedia( - "Update a library entry status by media" + "Update library entry status by media" input: UpdateStatusByMediaInput! ): LibraryEntryUpdateStatusByMediaPayload - updatedAt: ISO8601DateTime! } "Autogenerated return type of LibraryEntryUpdate" @@ -1021,6 +1064,34 @@ type LibraryEntryUpdatePayload { libraryEntry: LibraryEntry } +"Autogenerated return type of LibraryEntryUpdateProgressById" +type LibraryEntryUpdateProgressByIdPayload { + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry +} + +"Autogenerated return type of LibraryEntryUpdateProgressByMedia" +type LibraryEntryUpdateProgressByMediaPayload { + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry +} + +"Autogenerated return type of LibraryEntryUpdateRatingById" +type LibraryEntryUpdateRatingByIdPayload { + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry +} + +"Autogenerated return type of LibraryEntryUpdateRatingByMedia" +type LibraryEntryUpdateRatingByMediaPayload { + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry +} + "Autogenerated return type of LibraryEntryUpdateStatusById" type LibraryEntryUpdateStatusByIdPayload { "Graphql Errors" @@ -1210,10 +1281,9 @@ type Manga implements Media & WithTimestamps { volumeCount: Int } -type MangaAmountConsumed implements AmountConsumed & WithTimestamps { +type MangaAmountConsumed implements AmountConsumed { "Total media completed atleast once." completed: Int! - createdAt: ISO8601DateTime! id: ID! "Total amount of media." media: Int! @@ -1223,13 +1293,11 @@ type MangaAmountConsumed implements AmountConsumed & WithTimestamps { recalculatedAt: ISO8601Date! "Total progress of library including reconsuming." units: Int! - updatedAt: ISO8601DateTime! } -type MangaCategoryBreakdown implements CategoryBreakdown & WithTimestamps { +type MangaCategoryBreakdown implements CategoryBreakdown { "A Map of category_id -> count for all categories present on the library entries" categories: Map! - createdAt: ISO8601DateTime! id: ID! "The profile related to the user for this stat." profile: Profile! @@ -1237,7 +1305,6 @@ type MangaCategoryBreakdown implements CategoryBreakdown & WithTimestamps { recalculatedAt: ISO8601Date! "The total amount of library entries." total: Int! - updatedAt: ISO8601DateTime! } "The connection type for Manga." @@ -1470,12 +1537,11 @@ type MediaStaffEdge { node: MediaStaff } -type Mutation implements WithTimestamps { +type Mutation { anime: AnimeMutation - createdAt: ISO8601DateTime! + episode: EpisodeMutation libraryEntry: LibraryEntryMutation pro: ProMutation! - updatedAt: ISO8601DateTime! } "Information about pagination in a connection." @@ -1490,11 +1556,7 @@ type PageInfo { startCursor: String } -""" - -A Voice Actor, Director, Animator, or other person who works in the creation and\ - localization of media -""" +"A Voice Actor, Director, Animator, or other person who works in the creation and localization of media" type Person implements WithTimestamps { "The day when this person was born" birthday: Date @@ -1504,6 +1566,17 @@ type Person implements WithTimestamps { id: ID! "An image of the person" image: Image + "Information about the person working on specific media" + mediaStaff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection "The primary name of this person." name: String! "The name of this person in various languages" @@ -1596,8 +1669,7 @@ type PostEdge { node: Post } -type ProMutation implements WithTimestamps { - createdAt: ISO8601DateTime! +type ProMutation { "Set the user's discord tag" setDiscord( "Your discord tag (Name#1234)" @@ -1610,7 +1682,6 @@ type ProMutation implements WithTimestamps { ): SetMessagePayload "End the user's pro subscription" unsubscribe: UnsubscribePayload - updatedAt: ISO8601DateTime! } "A subscription to Kitsu PRO" @@ -1719,11 +1790,7 @@ type Profile implements WithTimestamps { "Returns the last _n_ elements from the list." last: Int ): MediaReactionConnection! - """ - - A non-unique publicly visible name for the profile. - Minimum of 3 characters and any valid Unicode character - """ + "A non-unique publicly visible name for the profile. Minimum of 3 characters and any valid Unicode character" name: String! "Post pinned to the user profile" pinnedPost: Post @@ -1787,17 +1854,15 @@ type ProfileEdge { } "The different types of user stats that we calculate." -type ProfileStats implements WithTimestamps { +type ProfileStats { "The total amount of anime you have watched over your whole life." animeAmountConsumed: AnimeAmountConsumed! "The breakdown of the different categories related to the anime you have completed" animeCategoryBreakdown: AnimeCategoryBreakdown! - createdAt: ISO8601DateTime! "The total amount of manga you ahve read over your whole life." mangaAmountConsumed: MangaAmountConsumed! "The breakdown of the different categories related to the manga you have completed" mangaCategoryBreakdown: MangaCategoryBreakdown! - updatedAt: ISO8601DateTime! } type Query { @@ -2017,13 +2082,11 @@ type QuoteLineEdge { } "Information about a user session" -type Session implements WithTimestamps { +type Session { "The account associated with this session" account: Account - createdAt: ISO8601DateTime! "The profile associated with this session" profile: Profile - updatedAt: ISO8601DateTime! } "Autogenerated return type of SetDiscord" @@ -2141,17 +2204,15 @@ type StreamingLinkEdge { node: StreamingLink } -type TitlesList implements WithTimestamps { +type TitlesList { "A list of additional, alternative, abbreviated, or unofficial titles" alternatives: [String!] "The official or de facto international title" canonical: String "The locale code that identifies which title is used as the canonical title" canonicalLocale: String - createdAt: ISO8601DateTime! "The list of localized titles keyed by locale" localized(locales: [String!]): Map! - updatedAt: ISO8601DateTime! } "Autogenerated return type of Unsubscribe" @@ -2424,6 +2485,27 @@ input AnimeUpdateInput { youtubeTrailerVideoId: String } +input EpisodeCreateInput { + description: Map + length: Int + mediaId: ID! + mediaType: media_type! + number: Int! + releasedAt: Date + thumbnailImage: Upload + titles: TitlesListInput! +} + +input EpisodeUpdateInput { + description: Map + id: ID! + length: Int + number: Int + releasedAt: Date + thumbnailImage: Upload + titles: TitlesListInput +} + input GenericDeleteInput { id: ID! } @@ -2464,6 +2546,30 @@ input TitlesListInput { localized: Map } +input UpdateProgressByIdInput { + id: ID! + progress: Int! +} + +input UpdateProgressByMediaInput { + mediaId: ID! + mediaType: media_type! + progress: Int! +} + +input UpdateRatingByIdInput { + id: ID! + "A number between 2 - 20" + rating: Int! +} + +input UpdateRatingByMediaInput { + mediaId: ID! + mediaType: media_type! + "A number between 2 - 20" + rating: Int! +} + input UpdateStatusByIdInput { id: ID! status: LibraryEntryStatus! diff --git a/src/AnimeClient/Component/Tabs.php b/src/AnimeClient/Component/Tabs.php index f30276e8..56a1c42e 100644 --- a/src/AnimeClient/Component/Tabs.php +++ b/src/AnimeClient/Component/Tabs.php @@ -38,6 +38,17 @@ final class Tabs { bool $hasSectionWrapper = false ): string { + if (count($tabData) < 2) + { + return $this->render('single-tab.php', [ + 'name' => $name, + 'data' => $tabData, + 'callback' => $cb, + 'className' => $className . ' single-tab', + 'hasSectionWrapper' => $hasSectionWrapper, + ]); + } + return $this->render('tabs.php', [ 'name' => $name, 'data' => $tabData, diff --git a/src/AnimeClient/Controller/People.php b/src/AnimeClient/Controller/People.php index b6c7bb41..6beecec4 100644 --- a/src/AnimeClient/Controller/People.php +++ b/src/AnimeClient/Controller/People.php @@ -50,15 +50,14 @@ final class People extends BaseController { /** * Show information about a person * - * @param string $id - * @param string|null $slug + * @param string $slug * @return void * @throws ContainerException * @throws NotFoundException */ - public function index(string $id, ?string $slug = NULL): void + public function index(string $slug): void { - $rawData = $this->model->getPerson($id, $slug); + $rawData = $this->model->getPerson($slug); $data = (new PersonTransformer())->transform($rawData)->toArray(); if (( ! array_key_exists('data', $rawData)) || empty($rawData['data'])) diff --git a/src/AnimeClient/Types/Person.php b/src/AnimeClient/Types/Person.php index 7341672a..9af0598b 100644 --- a/src/AnimeClient/Types/Person.php +++ b/src/AnimeClient/Types/Person.php @@ -20,28 +20,16 @@ namespace Aviat\AnimeClient\Types; * Type representing a person for display */ final class Person extends AbstractType { - /** - * @var string - */ + public $id; - /** - * @var string - */ public ?string $name; - /** - * @var Characters - */ - public ?Characters $characters; + public array $names = []; + + public ?string $description; + + public array $characters = []; - /** - * @var array - */ public array $staff = []; - - public function setCharacters($characters): void - { - $this->characters = Characters::from($characters); - } } \ No newline at end of file From ed9a3227ac8745f1f5fa52b81570da314764bddb Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 27 Aug 2020 15:39:23 -0400 Subject: [PATCH 58/86] Sort voice acting roles by character name --- .../API/Kitsu/Transformer/PersonTransformer.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php index 8b28cbb7..6e8a92bc 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/PersonTransformer.php @@ -132,11 +132,24 @@ final class PersonTransformer extends AbstractTransformer { { $characters[$role][$charId]['media'][$media['id']] = $media; } + } + foreach ($characters as $role => $_) + { + // Sort the characters by name uasort( - $characters[$role][$charId]['media'], - fn ($a, $b) => $a['titles'][0] <=> $b['titles'][0] + $characters[$role], + fn($a, $b) => $a['character']['canonicalName'] <=> $b['character']['canonicalName'] ); + + // Sort the media for the character + foreach ($characters[$role] as $charId => $__) + { + uasort( + $characters[$role][$charId]['media'], + fn ($a, $b) => $a['titles'][0] <=> $b['titles'][0] + ); + } } krsort($characters); From 78755f401980ecae846ed295935018c52dee2d26 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 28 Aug 2020 14:27:14 -0400 Subject: [PATCH 59/86] Do not check session unless already logged in --- frontEndSrc/js/events.js | 42 --------------------------------- frontEndSrc/js/index.js | 1 + frontEndSrc/js/session-check.js | 41 ++++++++++++++++++++++++++++++++ public/es/anon.js | 42 --------------------------------- public/es/scripts.js | 20 +++++++--------- public/js/anon.min.js | 5 ++-- public/js/anon.min.js.map | 2 +- public/js/scripts.min.js | 31 ++++++++++++------------ public/js/scripts.min.js.map | 2 +- 9 files changed, 71 insertions(+), 115 deletions(-) create mode 100644 frontEndSrc/js/session-check.js diff --git a/frontEndSrc/js/events.js b/frontEndSrc/js/events.js index d24239ec..2a8adfab 100644 --- a/frontEndSrc/js/events.js +++ b/frontEndSrc/js/events.js @@ -108,45 +108,3 @@ function filterMedia (event) { _.show('table.media-wrap tbody tr'); } } - -// ---------------------------------------------------------------------------- -// Other event setup -// ---------------------------------------------------------------------------- -(() => { - // Var is intentional - var hidden = null; - var visibilityChange = null; - - if (typeof document.hidden !== "undefined") { - hidden = "hidden"; - visibilityChange = "visibilitychange"; - } else if (typeof document.msHidden !== "undefined") { - hidden = "msHidden"; - visibilityChange = "msvisibilitychange"; - } else if (typeof document.webkitHidden !== "undefined") { - hidden = "webkitHidden"; - visibilityChange = "webkitvisibilitychange"; - } - - function handleVisibilityChange() { - // Check the user's session to see if they are currently logged-in - // when the page becomes visible - if ( ! document[hidden]) { - _.get('/heartbeat', (beat) => { - const status = JSON.parse(beat) - - // If the session is expired, immediately reload so that - // you can't attempt to do an action that requires authentication - if (status.hasAuth !== true) { - location.reload(); - } - }); - } - } - - if (hidden === null) { - console.info('Page visibility API not supported, JS session check will not work'); - } else { - document.addEventListener(visibilityChange, handleVisibilityChange, false); - } -})(); diff --git a/frontEndSrc/js/index.js b/frontEndSrc/js/index.js index 6cad73e4..9fd34d36 100644 --- a/frontEndSrc/js/index.js +++ b/frontEndSrc/js/index.js @@ -1,4 +1,5 @@ import './anon.js'; +import './session-check.js'; import './anime.js'; import './manga.js'; diff --git a/frontEndSrc/js/session-check.js b/frontEndSrc/js/session-check.js new file mode 100644 index 00000000..6777ed5e --- /dev/null +++ b/frontEndSrc/js/session-check.js @@ -0,0 +1,41 @@ +import _ from './anime-client.js'; + +(() => { + // Var is intentional + var hidden = null; + var visibilityChange = null; + + if (typeof document.hidden !== "undefined") { + hidden = "hidden"; + visibilityChange = "visibilitychange"; + } else if (typeof document.msHidden !== "undefined") { + hidden = "msHidden"; + visibilityChange = "msvisibilitychange"; + } else if (typeof document.webkitHidden !== "undefined") { + hidden = "webkitHidden"; + visibilityChange = "webkitvisibilitychange"; + } + + function handleVisibilityChange() { + // Check the user's session to see if they are currently logged-in + // when the page becomes visible + if ( ! document[hidden]) { + _.get('/heartbeat', (beat) => { + const status = JSON.parse(beat) + + // If the session is expired, immediately reload so that + // you can't attempt to do an action that requires authentication + if (status.hasAuth !== true) { + document.removeEventListener(visibilityChange, handleVisibilityChange, false); + location.reload(); + } + }); + } + } + + if (hidden === null) { + console.info('Page visibility API not supported, JS session check will not work'); + } else { + document.addEventListener(visibilityChange, handleVisibilityChange, false); + } +})(); \ No newline at end of file diff --git a/public/es/anon.js b/public/es/anon.js index 4e6ae6f5..2a208588 100644 --- a/public/es/anon.js +++ b/public/es/anon.js @@ -454,48 +454,6 @@ function filterMedia (event) { } } -// ---------------------------------------------------------------------------- -// Other event setup -// ---------------------------------------------------------------------------- -(() => { - // Var is intentional - var hidden = null; - var visibilityChange = null; - - if (typeof document.hidden !== "undefined") { - hidden = "hidden"; - visibilityChange = "visibilitychange"; - } else if (typeof document.msHidden !== "undefined") { - hidden = "msHidden"; - visibilityChange = "msvisibilitychange"; - } else if (typeof document.webkitHidden !== "undefined") { - hidden = "webkitHidden"; - visibilityChange = "webkitvisibilitychange"; - } - - function handleVisibilityChange() { - // Check the user's session to see if they are currently logged-in - // when the page becomes visible - if ( ! document[hidden]) { - AnimeClient.get('/heartbeat', (beat) => { - const status = JSON.parse(beat); - - // If the session is expired, immediately reload so that - // you can't attempt to do an action that requires authentication - if (status.hasAuth !== true) { - location.reload(); - } - }); - } - } - - if (hidden === null) { - console.info('Page visibility API not supported, JS session check will not work'); - } else { - document.addEventListener(visibilityChange, handleVisibilityChange, false); - } -})(); - if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/sw.js').then(reg => { console.log('Service worker registered', reg.scope); diff --git a/public/es/scripts.js b/public/es/scripts.js index 96ea1f5f..2d2cbd5a 100644 --- a/public/es/scripts.js +++ b/public/es/scripts.js @@ -454,9 +454,14 @@ function filterMedia (event) { } } -// ---------------------------------------------------------------------------- -// Other event setup -// ---------------------------------------------------------------------------- +if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('/sw.js').then(reg => { + console.log('Service worker registered', reg.scope); + }).catch(error => { + console.error('Failed to register service worker', error); + }); +} + (() => { // Var is intentional var hidden = null; @@ -483,6 +488,7 @@ function filterMedia (event) { // If the session is expired, immediately reload so that // you can't attempt to do an action that requires authentication if (status.hasAuth !== true) { + document.removeEventListener(visibilityChange, handleVisibilityChange, false); location.reload(); } }); @@ -496,14 +502,6 @@ function filterMedia (event) { } })(); -if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('/sw.js').then(reg => { - console.log('Service worker registered', reg.scope); - }).catch(error => { - console.error('Failed to register service worker', error); - }); -} - // Click on hidden MAL checkbox so // that MAL id is passed AnimeClient.on('main', 'change', '.big-check', (e) => { diff --git a/public/js/anon.min.js b/public/js/anon.min.js index 2cb4064d..d20e8d77 100644 --- a/public/js/anon.min.js +++ b/public/js/anon.min.js @@ -9,7 +9,6 @@ element){listener.call(element,e);e.stopPropagation()}})})}AnimeClient.on=functi "GET")request.send(null);else request.send(config.data);return request};AnimeClient.get=function(url,data,callback){callback=callback===undefined?null:callback;if(callback===null){callback=data;data={}}return AnimeClient.ajax(url,{data:data,success:callback})};AnimeClient.on("header","click",".message",hide);AnimeClient.on("form.js-delete","submit",confirmDelete);AnimeClient.on(".js-clear-cache","click",clearAPICache);AnimeClient.on(".vertical-tabs input","change",scrollToSection);AnimeClient.on(".media-filter", "input",filterMedia);function hide(event){AnimeClient.hide(event.target)}function confirmDelete(event){var proceed=confirm("Are you ABSOLUTELY SURE you want to delete this item?");if(proceed===false){event.preventDefault();event.stopPropagation()}}function clearAPICache(){AnimeClient.get("/cache_purge",function(){AnimeClient.showMessage("success","Successfully purged api cache")})}function scrollToSection(event){var el=event.currentTarget.parentElement;var rect=el.getBoundingClientRect();var top= rect.top+window.pageYOffset;window.scrollTo({top:top,behavior:"smooth"})}function filterMedia(event){var rawFilter=event.target.value;var filter=new RegExp(rawFilter,"i");if(rawFilter!==""){AnimeClient.$("article.media").forEach(function(article){var titleLink=AnimeClient.$(".name a",article)[0];var title=String(titleLink.textContent).trim();if(!filter.test(title))AnimeClient.hide(article);else AnimeClient.show(article)});AnimeClient.$("table.media-wrap tbody tr").forEach(function(tr){var titleCell= -AnimeClient.$("td.align-left",tr)[0];var titleLink=AnimeClient.$("a",titleCell)[0];var linkTitle=String(titleLink.textContent).trim();var textTitle=String(titleCell.textContent).trim();if(!(filter.test(linkTitle)||filter.test(textTitle)))AnimeClient.hide(tr);else AnimeClient.show(tr)})}else{AnimeClient.show("article.media");AnimeClient.show("table.media-wrap tbody tr")}}(function(){var hidden=null;var visibilityChange=null;if(typeof document.hidden!=="undefined"){hidden="hidden";visibilityChange= -"visibilitychange"}else if(typeof document.msHidden!=="undefined"){hidden="msHidden";visibilityChange="msvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){hidden="webkitHidden";visibilityChange="webkitvisibilitychange"}function handleVisibilityChange(){if(!document[hidden])AnimeClient.get("/heartbeat",function(beat){var status=JSON.parse(beat);if(status.hasAuth!==true)location.reload()})}if(hidden===null)console.info("Page visibility API not supported, JS session check will not work"); -else document.addEventListener(visibilityChange,handleVisibilityChange,false)})();if("serviceWorker"in navigator)navigator.serviceWorker.register("/sw.js").then(function(reg){console.log("Service worker registered",reg.scope)})["catch"](function(error){console.error("Failed to register service worker",error)})})() +AnimeClient.$("td.align-left",tr)[0];var titleLink=AnimeClient.$("a",titleCell)[0];var linkTitle=String(titleLink.textContent).trim();var textTitle=String(titleCell.textContent).trim();if(!(filter.test(linkTitle)||filter.test(textTitle)))AnimeClient.hide(tr);else AnimeClient.show(tr)})}else{AnimeClient.show("article.media");AnimeClient.show("table.media-wrap tbody tr")}}if("serviceWorker"in navigator)navigator.serviceWorker.register("/sw.js").then(function(reg){console.log("Service worker registered", +reg.scope)})["catch"](function(error){console.error("Failed to register service worker",error)})})() //# sourceMappingURL=anon.min.js.map diff --git a/public/js/anon.min.js.map b/public/js/anon.min.js.map index 1f7188a7..96a93182 100644 --- a/public/js/anon.min.js.map +++ b/public/js/anon.min.js.map @@ -1 +1 @@ -{"version":3,"file":"anon.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Other event setup\n// ----------------------------------------------------------------------------\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","reload","console","info","navigator","serviceWorker","register","then","reg","log","catch"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM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C,CAgBlC,GAAIgB,MAAJ,GAAe,IAAf,CACCQ,OAAAC,KAAA,CAAa,mEAAb,CADD;IAGC3I,SAAA8D,iBAAA,CAA0BqE,gBAA1B,CAA4CG,sBAA5C,CAAoE,KAApE,CAnCK,CAAN,CAAD,EChHA,IAAI,eAAJ,EAAuBM,UAAvB,CACCA,SAAAC,cAAAC,SAAA,CAAiC,QAAjC,CAAAC,KAAA,CAAgD,QAAA,CAAAC,GAAA,CAAO,CACtDN,OAAAO,IAAA,CAAY,2BAAZ,CAAyCD,GAAA1F,MAAzC,CADsD,CAAvD,CAAA4F,CAEG,OAFHA,CAAA,CAES,QAAA,CAAA3D,KAAA,CAAS,CACjBmD,OAAAnD,MAAA,CAAc,mCAAd,CAAmDA,KAAnD,CADiB,CAFlB;"} \ No newline at end of file +{"version":3,"file":"anon.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,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C,6BAAoB,IAAKC,WAAW,EACpC,mDACA,mDACA,IAAK,EAAGJ,MAAAC,KAAA,CAAYI,SAAZ,CAAH,EAA6BL,MAAAC,KAAA,CAAYK,SAAZ,CAA7B,CAAL,CACCf,WAAAA,KAAAA,CAAOY,EAAPZ,CADD,KAGCA,YAAAA,KAAAA,CAAOY,EAAPZ,CAR6C,CAA/CA,CAbqB,CAAtB,IAwBO,CACNA,WAAAA,KAAAA,CAAO,eAAPA,CACAA,YAAAA,KAAAA,CAAO,2BAAPA,CAFM,CA9BqB,CCzE7B,GAAI,eAAJ,EAAuBgB,UAAvB,CACCA,SAAAC,cAAAC,SAAA,CAAiC,QAAjC,CAAAC,KAAA,CAAgD,QAAA,CAAAC,GAAA,CAAO,CACtDC,OAAAC,IAAA,CAAY,2BAAZ;AAAyCF,GAAAhF,MAAzC,CADsD,CAAvD,CAAAmF,CAEG,OAFHA,CAAA,CAES,QAAA,CAAAlD,KAAA,CAAS,CACjBgD,OAAAhD,MAAA,CAAc,mCAAd,CAAmDA,KAAnD,CADiB,CAFlB;"} \ No newline at end of file diff --git a/public/js/scripts.min.js b/public/js/scripts.min.js index f2316f8e..d0f36ccc 100644 --- a/public/js/scripts.min.js +++ b/public/js/scripts.min.js @@ -9,19 +9,20 @@ element){listener.call(element,e);e.stopPropagation()}})})}AnimeClient.on=functi "GET")request.send(null);else request.send(config.data);return request};AnimeClient.get=function(url,data,callback){callback=callback===undefined?null:callback;if(callback===null){callback=data;data={}}return AnimeClient.ajax(url,{data:data,success:callback})};AnimeClient.on("header","click",".message",hide);AnimeClient.on("form.js-delete","submit",confirmDelete);AnimeClient.on(".js-clear-cache","click",clearAPICache);AnimeClient.on(".vertical-tabs input","change",scrollToSection);AnimeClient.on(".media-filter", "input",filterMedia);function hide(event){AnimeClient.hide(event.target)}function confirmDelete(event){var proceed=confirm("Are you ABSOLUTELY SURE you want to delete this item?");if(proceed===false){event.preventDefault();event.stopPropagation()}}function clearAPICache(){AnimeClient.get("/cache_purge",function(){AnimeClient.showMessage("success","Successfully purged api cache")})}function scrollToSection(event){var el=event.currentTarget.parentElement;var rect=el.getBoundingClientRect();var top= rect.top+window.pageYOffset;window.scrollTo({top:top,behavior:"smooth"})}function filterMedia(event){var rawFilter=event.target.value;var filter=new RegExp(rawFilter,"i");if(rawFilter!==""){AnimeClient.$("article.media").forEach(function(article){var titleLink=AnimeClient.$(".name a",article)[0];var title=String(titleLink.textContent).trim();if(!filter.test(title))AnimeClient.hide(article);else AnimeClient.show(article)});AnimeClient.$("table.media-wrap tbody tr").forEach(function(tr){var titleCell= -AnimeClient.$("td.align-left",tr)[0];var titleLink=AnimeClient.$("a",titleCell)[0];var linkTitle=String(titleLink.textContent).trim();var textTitle=String(titleCell.textContent).trim();if(!(filter.test(linkTitle)||filter.test(textTitle)))AnimeClient.hide(tr);else AnimeClient.show(tr)})}else{AnimeClient.show("article.media");AnimeClient.show("table.media-wrap tbody tr")}}(function(){var hidden=null;var visibilityChange=null;if(typeof document.hidden!=="undefined"){hidden="hidden";visibilityChange= -"visibilitychange"}else if(typeof document.msHidden!=="undefined"){hidden="msHidden";visibilityChange="msvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){hidden="webkitHidden";visibilityChange="webkitvisibilitychange"}function handleVisibilityChange(){if(!document[hidden])AnimeClient.get("/heartbeat",function(beat){var status=JSON.parse(beat);if(status.hasAuth!==true)location.reload()})}if(hidden===null)console.info("Page visibility API not supported, JS session check will not work"); -else document.addEventListener(visibilityChange,handleVisibilityChange,false)})();if("serviceWorker"in navigator)navigator.serviceWorker.register("/sw.js").then(function(reg){console.log("Service worker registered",reg.scope)})["catch"](function(error){console.error("Failed to register service worker",error)});AnimeClient.on("main","change",".big-check",function(e){var id=e.target.id;document.getElementById("mal_"+id).checked=true});function renderAnimeSearchResults(data){var results=[];data.forEach(function(x){var item= -x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')}); -return results.join("")}function renderMangaSearchResults(data){var results=[];data.forEach(function(x){var item=x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search")){var prevRequest= -null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search(query)}))}AnimeClient.on("body.anime.list","click",".plus-one",function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent, -10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&&watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow"); -AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})}); -var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value); -if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName= -AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="current";if(!isNaN(completed)&&completed+1===total)data.data.status="completed";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(data.data.status=== -"completed")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed;AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() +AnimeClient.$("td.align-left",tr)[0];var titleLink=AnimeClient.$("a",titleCell)[0];var linkTitle=String(titleLink.textContent).trim();var textTitle=String(titleCell.textContent).trim();if(!(filter.test(linkTitle)||filter.test(textTitle)))AnimeClient.hide(tr);else AnimeClient.show(tr)})}else{AnimeClient.show("article.media");AnimeClient.show("table.media-wrap tbody tr")}}if("serviceWorker"in navigator)navigator.serviceWorker.register("/sw.js").then(function(reg){console.log("Service worker registered", +reg.scope)})["catch"](function(error){console.error("Failed to register service worker",error)});(function(){var hidden=null;var visibilityChange=null;if(typeof document.hidden!=="undefined"){hidden="hidden";visibilityChange="visibilitychange"}else if(typeof document.msHidden!=="undefined"){hidden="msHidden";visibilityChange="msvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){hidden="webkitHidden";visibilityChange="webkitvisibilitychange"}function handleVisibilityChange(){if(!document[hidden])AnimeClient.get("/heartbeat", +function(beat){var status=JSON.parse(beat);if(status.hasAuth!==true){document.removeEventListener(visibilityChange,handleVisibilityChange,false);location.reload()}})}if(hidden===null)console.info("Page visibility API not supported, JS session check will not work");else document.addEventListener(visibilityChange,handleVisibilityChange,false)})();AnimeClient.on("main","change",".big-check",function(e){var id=e.target.id;document.getElementById("mal_"+id).checked=true});function renderAnimeSearchResults(data){var results= +[];data.forEach(function(x){var item=x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')});return results.join("")}function renderMangaSearchResults(data){var results=[];data.forEach(function(x){var item=x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults, +status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search")){var prevRequest=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search(query)}))}AnimeClient.on("body.anime.list","click",".plus-one", +function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&& +watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success", +"Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader"); +AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target, +"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="current"; +if(!isNaN(completed)&&completed+1===total)data.data.status="completed";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(data.data.status==="completed")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed;AnimeClient.showMessage("success","Successfully updated "+ +mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() //# sourceMappingURL=scripts.min.js.map diff --git a/public/js/scripts.min.js.map b/public/js/scripts.min.js.map index ca06159e..64720c50 100644 --- a/public/js/scripts.min.js.map +++ b/public/js/scripts.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Other event setup\n// ----------------------------------------------------------------------------\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (data.data.status === 'completed') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","reload","console","info","navigator","serviceWorker","register","then","reg","log","catch","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","manga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.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (data.data.status === 'completed') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,IAAV,CAAAA,OACX,IAAI,MAAOZ,SAAX,GAAwB,QAAxB,CACC,MAAOA,SAGRY,QAAA,CAAWA,OAAD,GAA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KAAAA,KAAAkG,SAAA,CAAqB,EAAEQ,SAEvBhE,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,KAAAA,CAAOA,WAAAA,IAAAA,CAAM,kBAANA,CAAPA,CAAkC,CACjC1C,KAAAA,IADiC,CAEjCY,SAAU,MAFuB,CAGjCrD,KAAM,MAH2B,CAIjCuD,SAAU,kBAJuB,CAKjCD,QAASA,QAAA,EAAM,CACd,GAAIb,IAAAA,KAAA8B,OAAJ,GAAyB,WAAzB,CACCY,WAAAA,KAAAA,CAAOiD,SAAPjD,CAGDA,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,EAAAA,CAAI,GAAJA,CAAQnF,IAARmF,CAAI,QAAJA,CAAsBiD,SAAtBjD,CAAAA,CAAkC,CAAlCA,CAAAA,YAAAA,CAAoDgE,SACpDhE,YAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA;AAAiDkE,SAAjDlE,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA,YAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CkE,SAA3ClE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file From 44e10390679325ed69ae254a41e7e9dba5d7e0c5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 9 Sep 2020 10:23:17 -0400 Subject: [PATCH 60/86] Add limit to all relationships --- .../API/Kitsu/Queries/AnimeDetails.graphql | 10 +++++----- .../Kitsu/Queries/AnimeDetailsById.graphql | 20 +++++++++++++++---- .../Kitsu/Queries/CharacterDetails.graphql | 4 ++-- .../API/Kitsu/Queries/GetLibrary.graphql | 15 +++++++++----- .../API/Kitsu/Queries/GetLibraryCount.graphql | 2 +- .../API/Kitsu/Queries/GetLibraryItem.graphql | 6 +++--- .../API/Kitsu/Queries/GetUserHistory.graphql | 2 +- .../API/Kitsu/Queries/MangaDetails.graphql | 8 ++++---- .../Kitsu/Queries/MangaDetailsById.graphql | 8 ++++---- .../API/Kitsu/Queries/PersonDetails.graphql | 4 ++-- .../API/Kitsu/Queries/UserDetails.graphql | 4 ++-- 11 files changed, 50 insertions(+), 33 deletions(-) diff --git a/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql index ce72f4d3..793028d7 100644 --- a/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/AnimeDetails.graphql @@ -17,12 +17,12 @@ query ($slug: String!) { width } } - categories { + categories(first: 100) { nodes { title } } - characters { + characters(first: 100) { nodes { character { id @@ -59,13 +59,13 @@ query ($slug: String!) { season sfw slug - mappings { + mappings(first: 10) { nodes { externalId externalSite } } - staff { + staff(first: 100) { nodes { person { id @@ -101,7 +101,7 @@ query ($slug: String!) { } } status - streamingLinks { + streamingLinks(first: 10) { nodes { dubs subs diff --git a/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql b/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql index 658a8cdc..a3b2bc0d 100644 --- a/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/AnimeDetailsById.graphql @@ -17,12 +17,12 @@ query ($id: ID!) { width } } - categories { + categories(first: 100) { nodes { title } } - characters { + characters(first: 100) { nodes { character { id @@ -59,13 +59,13 @@ query ($id: ID!) { season sfw slug - mappings { + mappings(first: 10) { nodes { externalId externalSite } } - staff { + staff(first: 100) { nodes { person { id @@ -101,6 +101,18 @@ query ($id: ID!) { } } status + streamingLinks(first: 10) { + nodes { + dubs + subs + regions + streamer { + id + siteName + } + url + } + } subtype titles { alternatives diff --git a/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql index 25e89db3..872e04ef 100644 --- a/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/CharacterDetails.graphql @@ -13,7 +13,7 @@ query ($slug: String!) { canonicalLocale localized }, - media { + media(first: 100) { nodes { media { id @@ -40,7 +40,7 @@ query ($slug: String!) { } type } - voices { + voices(first: 100) { nodes { id licensor { diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql index 094b821e..6f47ed52 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql @@ -1,7 +1,12 @@ -query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { +query ( + $slug: String!, + $type: media_type!, + $status: [LibraryEntryStatus!], + $after: String +) { findProfileBySlug(slug: $slug) { library { - all(mediaType: $type, status: $status) { + all(first: 100, after: $after, mediaType: $type, status: $status) { pageInfo { endCursor hasNextPage @@ -24,12 +29,12 @@ query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { id ageRating ageRatingGuide - categories { + categories(first: 100) { nodes { title } } - mappings { + mappings(first: 10) { nodes { externalId externalSite @@ -60,7 +65,7 @@ query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { } ...on Anime { episodeCount - streamingLinks { + streamingLinks(first: 10) { nodes { dubs subs diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql index e3c6ceaa..b4de69b9 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql @@ -1,7 +1,7 @@ query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { findProfileBySlug(slug: $slug) { library { - all(mediaType: $type, status: $status) { + all(first: 1, mediaType: $type, status: $status) { totalCount } } diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql index ad9f61cc..e970eeb5 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibraryItem.graphql @@ -14,12 +14,12 @@ query($id: ID!) { id slug ageRating - categories { + categories(first: 100) { nodes { title } } - mappings { + mappings(first: 10) { nodes { externalId externalSite @@ -48,7 +48,7 @@ query($id: ID!) { ...on Anime { episodeCount episodeLength - streamingLinks { + streamingLinks(first: 10) { nodes { dubs subs diff --git a/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql b/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql index 66530029..06066e03 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetUserHistory.graphql @@ -1,6 +1,6 @@ query ($slug: String!) { findProfileBySlug(slug: $slug) { - libraryEvents { + libraryEvents(first: 100) { nodes { id changedData diff --git a/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql index 973d103e..9393aeff 100644 --- a/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/MangaDetails.graphql @@ -17,14 +17,14 @@ query ($slug: String!) { width } } - categories { + categories(first: 100) { nodes { title } } chapterCount volumeCount - characters { + characters(first: 100) { nodes { character { id @@ -54,7 +54,7 @@ query ($slug: String!) { description startDate endDate - mappings { + mappings(first: 10) { nodes { externalId externalSite @@ -76,7 +76,7 @@ query ($slug: String!) { } sfw slug - staff { + staff(first: 100) { nodes { person { id diff --git a/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql b/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql index ebdea83d..09a3aab6 100644 --- a/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/MangaDetailsById.graphql @@ -17,14 +17,14 @@ query ($id: ID!) { width } } - categories { + categories(first: 100) { nodes { title } } chapterCount volumeCount - characters { + characters(first: 100) { nodes { character { id @@ -54,7 +54,7 @@ query ($id: ID!) { description startDate endDate - mappings { + mappings(first: 10) { nodes { externalId externalSite @@ -76,7 +76,7 @@ query ($id: ID!) { } sfw slug - staff { + staff(first: 100) { nodes { person { id diff --git a/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql index 0e043721..2a768757 100644 --- a/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/PersonDetails.graphql @@ -22,7 +22,7 @@ query ($slug: String!) { canonical localized } - mediaStaff { + mediaStaff(first: 100) { nodes { id role @@ -52,7 +52,7 @@ query ($slug: String!) { } } } - voices { + voices(first: 100) { nodes { locale mediaCharacter { diff --git a/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql b/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql index dd58d89f..9e551e91 100644 --- a/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/UserDetails.graphql @@ -24,13 +24,13 @@ query ($slug: String!) { proMessage proTier slug - siteLinks { + siteLinks(first: 20) { nodes { id url } } - favorites { + favorites(first: 100) { nodes { id item { From 3b754ce6343ef1c26d5158839ffcee7e0639bb1d Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 9 Sep 2020 10:24:12 -0400 Subject: [PATCH 61/86] Update GraphQL schema for Kitsu --- src/AnimeClient/API/Kitsu/schema.graphql | 4050 +++++++++++----------- 1 file changed, 2025 insertions(+), 2025 deletions(-) diff --git a/src/AnimeClient/API/Kitsu/schema.graphql b/src/AnimeClient/API/Kitsu/schema.graphql index f3e62a46..8a5ededa 100644 --- a/src/AnimeClient/API/Kitsu/schema.graphql +++ b/src/AnimeClient/API/Kitsu/schema.graphql @@ -1,216 +1,216 @@ # This file was generated based on ".graphqlconfig". Do not edit manually. schema { - query: Query - mutation: Mutation + query: Query + mutation: Mutation } "Generic Amount Consumed based on Media" interface AmountConsumed { - "Total media completed atleast once." - completed: Int! - id: ID! - "Total amount of media." - media: Int! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "Total progress of library including reconsuming." - units: Int! + "Total media completed atleast once." + completed: Int! + id: ID! + "Total amount of media." + media: Int! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "Total progress of library including reconsuming." + units: Int! } "Generic error fields used by all errors." interface Base { - "The error code." - code: String - "A description of the error" - message: String! - "Which input value this error came from" - path: [String!] + "The error code." + code: String + "A description of the error" + message: String! + "Which input value this error came from" + path: [String!] } "Generic Category Breakdown based on Media" interface CategoryBreakdown { - "A Map of category_id -> count for all categories present on the library entries" - categories: Map! - id: ID! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "The total amount of library entries." - total: Int! + "A Map of category_id -> count for all categories present on the library entries" + categories: Map! + id: ID! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "The total amount of library entries." + total: Int! } "An episodic media in the Kitsu database" interface Episodic { - "The number of episodes in this series" - episodeCount: Int - "The general length (in seconds) of each episode" - episodeLength: Int - "Episodes for this media" - episodes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - number: [Int!] - ): EpisodeConnection! - "The total length (in seconds) of the entire series" - totalLength: Int + "The number of episodes in this series" + episodeCount: Int + "The general length (in seconds) of each episode" + episodeLength: Int + "Episodes for this media" + episodes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + number: [Int!] + ): EpisodeConnection! + "The total length (in seconds) of the entire series" + totalLength: Int } "A media in the Kitsu database" interface Media { - "The recommended minimum age group for this media" - ageRating: AgeRating - "An explanation of why this received the age rating it did" - ageRatingGuide: String - "The average rating of this media amongst all Kitsu users" - averageRating: Float - "A large banner image for this media" - bannerImage: Image! - "A list of categories for this media" - categories( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection! - "The characters who starred in this media" - characters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection! - "A brief (mostly spoiler free) summary or description of the media." - description(locales: [String!]): Map! - "the day that this media made its final release" - endDate: Date - "The number of users with this in their favorites" - favoritesCount: Int - id: ID! - "A list of mappings for this media" - mappings( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MappingConnection! - "The time of the next release of this media" - nextRelease: ISO8601DateTime - "The poster image of this media" - posterImage: Image! - "The companies which helped to produce this media" - productions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaProductionConnection! - "A list of quotes from this media" - quotes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteConnection! - "A list of reactions for this media" - reactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "The season this was released in" - season: ReleaseSeason - "Whether the media is Safe-for-Work" - sfw: Boolean! - "The URL-friendly identifier of this media" - slug: String! - "The staff members who worked on this media" - staff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection! - "The day that this media first released" - startDate: Date - "The current releasing status of this media" - status: ReleaseStatus! - "Description of when this media is expected to release" - tba: String - "The titles for this media in various locales" - titles: TitlesList! - "Anime or Manga." - type: String! - "The number of users with this in their library" - userCount: Int + "The recommended minimum age group for this media" + ageRating: AgeRating + "An explanation of why this received the age rating it did" + ageRatingGuide: String + "The average rating of this media amongst all Kitsu users" + averageRating: Float + "A large banner image for this media" + bannerImage: Image! + "A list of categories for this media" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection! + "The characters who starred in this media" + characters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection! + "A brief (mostly spoiler free) summary or description of the media." + description(locales: [String!]): Map! + "the day that this media made its final release" + endDate: Date + "The number of users with this in their favorites" + favoritesCount: Int + id: ID! + "A list of mappings for this media" + mappings( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MappingConnection! + "The time of the next release of this media" + nextRelease: ISO8601DateTime + "The poster image of this media" + posterImage: Image! + "The companies which helped to produce this media" + productions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaProductionConnection! + "A list of quotes from this media" + quotes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteConnection! + "A list of reactions for this media" + reactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "The season this was released in" + season: ReleaseSeason + "Whether the media is Safe-for-Work" + sfw: Boolean! + "The URL-friendly identifier of this media" + slug: String! + "The staff members who worked on this media" + staff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection! + "The day that this media first released" + startDate: Date + "The current releasing status of this media" + status: ReleaseStatus! + "Description of when this media is expected to release" + tba: String + "The titles for this media in various locales" + titles: TitlesList! + "Anime or Manga." + type: String! + "The number of users with this in their library" + userCount: Int } "Media that is streamable." interface Streamable { - "Spoken language is replaced by language of choice." - dubs: [String!]! - "Which regions this video is available in." - regions: [String!]! - "The site that is streaming this media." - streamer: Streamer! - "Languages this is translated to. Usually placed at bottom of media." - subs: [String!]! + "Spoken language is replaced by language of choice." + dubs: [String!]! + "Which regions this video is available in." + regions: [String!]! + "The site that is streaming this media." + streamer: Streamer! + "Languages this is translated to. Usually placed at bottom of media." + subs: [String!]! } "Media units such as episodes or chapters" interface Unit { - "A brief summary or description of the unit" - description(locales: [String!]): Map! - id: ID! - "The sequence number of this unit" - number: Int! - "A thumbnail image for the unit" - thumbnail: Image - "The titles for this unit in various locales" - titles: TitlesList! + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The sequence number of this unit" + number: Int! + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! } interface WithTimestamps { - createdAt: ISO8601DateTime! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + updatedAt: ISO8601DateTime! } "Objects which are Favoritable" @@ -221,2364 +221,2364 @@ union MappingItem = Anime | Category | Character | Episode | Manga | Person | Pr "A user account on Kitsu" type Account implements WithTimestamps { - "The country this user resides in" - country: String - createdAt: ISO8601DateTime! - "The email addresses associated with this account" - email: [String!]! - "Facebook account linked to the account" - facebookId: String - id: ID! - "Primary language for the account" - language: String - "Longest period an account has had a PRO subscription for in seconds" - maxProStreak: Int - "The PRO subscription for this account" - proSubscription: ProSubscription - "The profile for this account" - profile: Profile! - "Media rating system used for the account" - ratingSystem: RatingSystem! - "Whether Not Safe For Work content is accessible" - sfwFilter: Boolean - "Time zone of the account" - timeZone: String - "Preferred language for media titles" - titleLanguagePreference: TitleLanguagePreference - "Twitter account linked to the account" - twitterId: String - updatedAt: ISO8601DateTime! + "The country this user resides in" + country: String + createdAt: ISO8601DateTime! + "The email addresses associated with this account" + email: [String!]! + "Facebook account linked to the account" + facebookId: String + id: ID! + "Primary language for the account" + language: String + "Longest period an account has had a PRO subscription for in seconds" + maxProStreak: Int + "The PRO subscription for this account" + proSubscription: ProSubscription + "The profile for this account" + profile: Profile! + "Media rating system used for the account" + ratingSystem: RatingSystem! + "Whether Not Safe For Work content is accessible" + sfwFilter: Boolean + "Time zone of the account" + timeZone: String + "Preferred language for media titles" + titleLanguagePreference: TitleLanguagePreference + "Twitter account linked to the account" + twitterId: String + updatedAt: ISO8601DateTime! } type Anime implements Episodic & Media & WithTimestamps { - "The recommended minimum age group for this media" - ageRating: AgeRating - "An explanation of why this received the age rating it did" - ageRatingGuide: String - "The average rating of this media amongst all Kitsu users" - averageRating: Float - "A large banner image for this media" - bannerImage: Image! - "A list of categories for this media" - categories( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection! - "The characters who starred in this media" - characters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection! - createdAt: ISO8601DateTime! - "A brief (mostly spoiler free) summary or description of the media." - description(locales: [String!]): Map! - "the day that this media made its final release" - endDate: Date - "The number of episodes in this series" - episodeCount: Int - "The general length (in seconds) of each episode" - episodeLength: Int - "Episodes for this media" - episodes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - number: [Int!] - ): EpisodeConnection! - "The number of users with this in their favorites" - favoritesCount: Int - id: ID! - "A list of mappings for this media" - mappings( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MappingConnection! - "The time of the next release of this media" - nextRelease: ISO8601DateTime - "The poster image of this media" - posterImage: Image! - "The companies which helped to produce this media" - productions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaProductionConnection! - "A list of quotes from this media" - quotes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteConnection! - "A list of reactions for this media" - reactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "The season this was released in" - season: ReleaseSeason - "Whether the media is Safe-for-Work" - sfw: Boolean! - "The URL-friendly identifier of this media" - slug: String! - "The staff members who worked on this media" - staff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection! - "The day that this media first released" - startDate: Date - "The current releasing status of this media" - status: ReleaseStatus! - "The stream links." - streamingLinks( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): StreamingLinkConnection! - "A secondary type for categorizing Anime." - subtype: AnimeSubtype! - "Description of when this media is expected to release" - tba: String - "The titles for this media in various locales" - titles: TitlesList! - "The total length (in seconds) of the entire series" - totalLength: Int - "Anime or Manga." - type: String! - updatedAt: ISO8601DateTime! - "The number of users with this in their library" - userCount: Int - "Video id for a trailer on YouTube" - youtubeTrailerVideoId: String + "The recommended minimum age group for this media" + ageRating: AgeRating + "An explanation of why this received the age rating it did" + ageRatingGuide: String + "The average rating of this media amongst all Kitsu users" + averageRating: Float + "A large banner image for this media" + bannerImage: Image! + "A list of categories for this media" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection! + "The characters who starred in this media" + characters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection! + createdAt: ISO8601DateTime! + "A brief (mostly spoiler free) summary or description of the media." + description(locales: [String!]): Map! + "the day that this media made its final release" + endDate: Date + "The number of episodes in this series" + episodeCount: Int + "The general length (in seconds) of each episode" + episodeLength: Int + "Episodes for this media" + episodes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + number: [Int!] + ): EpisodeConnection! + "The number of users with this in their favorites" + favoritesCount: Int + id: ID! + "A list of mappings for this media" + mappings( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MappingConnection! + "The time of the next release of this media" + nextRelease: ISO8601DateTime + "The poster image of this media" + posterImage: Image! + "The companies which helped to produce this media" + productions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaProductionConnection! + "A list of quotes from this media" + quotes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteConnection! + "A list of reactions for this media" + reactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "The season this was released in" + season: ReleaseSeason + "Whether the media is Safe-for-Work" + sfw: Boolean! + "The URL-friendly identifier of this media" + slug: String! + "The staff members who worked on this media" + staff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection! + "The day that this media first released" + startDate: Date + "The current releasing status of this media" + status: ReleaseStatus! + "The stream links." + streamingLinks( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): StreamingLinkConnection! + "A secondary type for categorizing Anime." + subtype: AnimeSubtype! + "Description of when this media is expected to release" + tba: String + "The titles for this media in various locales" + titles: TitlesList! + "The total length (in seconds) of the entire series" + totalLength: Int + "Anime or Manga." + type: String! + updatedAt: ISO8601DateTime! + "The number of users with this in their library" + userCount: Int + "Video id for a trailer on YouTube" + youtubeTrailerVideoId: String } type AnimeAmountConsumed implements AmountConsumed { - "Total media completed atleast once." - completed: Int! - id: ID! - "Total amount of media." - media: Int! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "Total time spent in minutes." - time: Int! - "Total progress of library including reconsuming." - units: Int! + "Total media completed atleast once." + completed: Int! + id: ID! + "Total amount of media." + media: Int! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "Total time spent in minutes." + time: Int! + "Total progress of library including reconsuming." + units: Int! } type AnimeCategoryBreakdown implements CategoryBreakdown { - "A Map of category_id -> count for all categories present on the library entries" - categories: Map! - id: ID! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "The total amount of library entries." - total: Int! + "A Map of category_id -> count for all categories present on the library entries" + categories: Map! + id: ID! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "The total amount of library entries." + total: Int! } "The connection type for Anime." type AnimeConnection { - "A list of edges." - edges: [AnimeEdge] - "A list of nodes." - nodes: [Anime] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [AnimeEdge] + "A list of nodes." + nodes: [Anime] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "Autogenerated return type of AnimeCreate" type AnimeCreatePayload { - anime: Anime - "Graphql Errors" - errors: [Generic!] + anime: Anime + "Graphql Errors" + errors: [Generic!] } "Autogenerated return type of AnimeDelete" type AnimeDeletePayload { - anime: GenericDelete - "Graphql Errors" - errors: [Generic!] + anime: GenericDelete + "Graphql Errors" + errors: [Generic!] } "An edge in a connection." type AnimeEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Anime + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Anime } type AnimeMutation { - "Create an Anime." - create( - "Create an Anime." - input: AnimeCreateInput! - ): AnimeCreatePayload - "Delete an Anime." - delete( - "Delete an Anime." - input: GenericDeleteInput! - ): AnimeDeletePayload - "Update an Anime." - update( - "Update an Anime." - input: AnimeUpdateInput! - ): AnimeUpdatePayload + "Create an Anime." + create( + "Create an Anime." + input: AnimeCreateInput! + ): AnimeCreatePayload + "Delete an Anime." + delete( + "Delete an Anime." + input: GenericDeleteInput! + ): AnimeDeletePayload + "Update an Anime." + update( + "Update an Anime." + input: AnimeUpdateInput! + ): AnimeUpdatePayload } "Autogenerated return type of AnimeUpdate" type AnimeUpdatePayload { - anime: Anime - "Graphql Errors" - errors: [Generic!] + anime: Anime + "Graphql Errors" + errors: [Generic!] } "Information about a specific Category" type Category implements WithTimestamps { - "The child categories." - children( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection - createdAt: ISO8601DateTime! - "A brief summary or description of the catgory." - description(locales: [String!]): Map! - id: ID! - "Whether the category is Not-Safe-for-Work." - isNsfw: Boolean! - "The parent category. Each category can have one parent." - parent: Category - "The URL-friendly identifier of this Category." - slug: String! - "The name of the category." - title(locales: [String!]): Map! - updatedAt: ISO8601DateTime! + "The child categories." + children( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection + createdAt: ISO8601DateTime! + "A brief summary or description of the catgory." + description(locales: [String!]): Map! + id: ID! + "Whether the category is Not-Safe-for-Work." + isNsfw: Boolean! + "The parent category. Each category can have one parent." + parent: Category + "The URL-friendly identifier of this Category." + slug: String! + "The name of the category." + title(locales: [String!]): Map! + updatedAt: ISO8601DateTime! } "The connection type for Category." type CategoryConnection { - "A list of edges." - edges: [CategoryEdge] - "A list of nodes." - nodes: [Category] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [CategoryEdge] + "A list of nodes." + nodes: [Category] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type CategoryEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Category + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Category } "A single chapter of a manga" type Chapter implements Unit & WithTimestamps { - createdAt: ISO8601DateTime! - "A brief summary or description of the unit" - description(locales: [String!]): Map! - id: ID! - "The manga this chapter is in." - manga: Manga! - "The sequence number of this unit" - number: Int! - "When this chapter was released" - releasedAt: ISO8601Date - "A thumbnail image for the unit" - thumbnail: Image - "The titles for this unit in various locales" - titles: TitlesList! - updatedAt: ISO8601DateTime! - "The volume this chapter is in." - volume: Volume + createdAt: ISO8601DateTime! + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The manga this chapter is in." + manga: Manga! + "The sequence number of this unit" + number: Int! + "When this chapter was released" + releasedAt: ISO8601Date + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! + updatedAt: ISO8601DateTime! + "The volume this chapter is in." + volume: Volume } "The connection type for Chapter." type ChapterConnection { - "A list of edges." - edges: [ChapterEdge] - "A list of nodes." - nodes: [Chapter] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [ChapterEdge] + "A list of nodes." + nodes: [Chapter] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type ChapterEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Chapter + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Chapter } "Information about a Character in the Kitsu database" type Character implements WithTimestamps { - createdAt: ISO8601DateTime! - "A brief summary or description of the character." - description(locales: [String!]): Map! - id: ID! - "An image of the character" - image: Image - "Media this character appears in." - media( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection - "The name for this character in various locales" - names: TitlesList - "The original media this character showed up in" - primaryMedia: Media - "The URL-friendly identifier of this character" - slug: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + "A brief summary or description of the character." + description(locales: [String!]): Map! + id: ID! + "An image of the character" + image: Image + "Media this character appears in." + media( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection + "The name for this character in various locales" + names: TitlesList + "The original media this character showed up in" + primaryMedia: Media + "The URL-friendly identifier of this character" + slug: String! + updatedAt: ISO8601DateTime! } "Information about a VA (Person) voicing a Character in a Media" type CharacterVoice implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The company who hired this voice actor to play this role" - licensor: Producer - "The BCP47 locale tag for the voice acting role" - locale: String! - "The MediaCharacter node" - mediaCharacter: MediaCharacter! - "The person who voice acted this role" - person: Person! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The company who hired this voice actor to play this role" + licensor: Producer + "The BCP47 locale tag for the voice acting role" + locale: String! + "The MediaCharacter node" + mediaCharacter: MediaCharacter! + "The person who voice acted this role" + person: Person! + updatedAt: ISO8601DateTime! } "The connection type for CharacterVoice." type CharacterVoiceConnection { - "A list of edges." - edges: [CharacterVoiceEdge] - "A list of nodes." - nodes: [CharacterVoice] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [CharacterVoiceEdge] + "A list of nodes." + nodes: [CharacterVoice] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type CharacterVoiceEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: CharacterVoice + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: CharacterVoice } "A comment on a post" type Comment implements WithTimestamps { - "The user who created this comment for the parent post." - author: Profile! - "Unmodified content." - content: String! - "Html formatted content." - contentFormatted: String! - createdAt: ISO8601DateTime! - id: ID! - "Users who liked this comment." - likes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "The parent comment if this comment was a reply to another." - parent: Comment - "The post that this comment is attached to." - post: Post! - "All replies to a specific comment." - replies( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CommentConnection! - updatedAt: ISO8601DateTime! + "The user who created this comment for the parent post." + author: Profile! + "Unmodified content." + content: String! + "Html formatted content." + contentFormatted: String! + createdAt: ISO8601DateTime! + id: ID! + "Users who liked this comment." + likes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "The parent comment if this comment was a reply to another." + parent: Comment + "The post that this comment is attached to." + post: Post! + "All replies to a specific comment." + replies( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CommentConnection! + updatedAt: ISO8601DateTime! } "The connection type for Comment." type CommentConnection { - "A list of edges." - edges: [CommentEdge] - "A list of nodes." - nodes: [Comment] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [CommentEdge] + "A list of nodes." + nodes: [Comment] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type CommentEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Comment + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Comment } "An Episode of a Media" type Episode implements Unit & WithTimestamps { - "The anime this episode is in" - anime: Anime! - createdAt: ISO8601DateTime! - "A brief summary or description of the unit" - description(locales: [String!]): Map! - id: ID! - "The length of the episode in seconds" - length: Int - "The sequence number of this unit" - number: Int! - "When this episode aired" - releasedAt: ISO8601DateTime - "A thumbnail image for the unit" - thumbnail: Image - "The titles for this unit in various locales" - titles: TitlesList! - updatedAt: ISO8601DateTime! + "The anime this episode is in" + anime: Anime! + createdAt: ISO8601DateTime! + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The length of the episode in seconds" + length: Int + "The sequence number of this unit" + number: Int! + "When this episode aired" + releasedAt: ISO8601DateTime + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! + updatedAt: ISO8601DateTime! } "The connection type for Episode." type EpisodeConnection { - "A list of edges." - edges: [EpisodeEdge] - "A list of nodes." - nodes: [Episode] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [EpisodeEdge] + "A list of nodes." + nodes: [Episode] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "Autogenerated return type of EpisodeCreate" type EpisodeCreatePayload { - episode: Episode - "Graphql Errors" - errors: [Generic!] + episode: Episode + "Graphql Errors" + errors: [Generic!] } "Autogenerated return type of EpisodeDelete" type EpisodeDeletePayload { - episode: GenericDelete - "Graphql Errors" - errors: [Generic!] + episode: GenericDelete + "Graphql Errors" + errors: [Generic!] } "An edge in a connection." type EpisodeEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Episode + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Episode } type EpisodeMutation { - "Create an Episode." - create( - "Create an Episode" - input: EpisodeCreateInput! - ): EpisodeCreatePayload - "Delete an Episode." - delete( - "Delete an Episode" - input: GenericDeleteInput! - ): EpisodeDeletePayload - "Update an Episode." - update( - "Update an Episode" - input: EpisodeUpdateInput! - ): EpisodeUpdatePayload + "Create an Episode." + create( + "Create an Episode" + input: EpisodeCreateInput! + ): EpisodeCreatePayload + "Delete an Episode." + delete( + "Delete an Episode" + input: GenericDeleteInput! + ): EpisodeDeletePayload + "Update an Episode." + update( + "Update an Episode" + input: EpisodeUpdateInput! + ): EpisodeUpdatePayload } "Autogenerated return type of EpisodeUpdate" type EpisodeUpdatePayload { - episode: Episode - "Graphql Errors" - errors: [Generic!] + episode: Episode + "Graphql Errors" + errors: [Generic!] } "Favorite media, characters, and people for a user" type Favorite implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The kitsu object that is mapped" - item: FavoriteItem! - updatedAt: ISO8601DateTime! - "The user who favorited this item" - user: Profile! + createdAt: ISO8601DateTime! + id: ID! + "The kitsu object that is mapped" + item: FavoriteItem! + updatedAt: ISO8601DateTime! + "The user who favorited this item" + user: Profile! } "The connection type for Favorite." type FavoriteConnection { - "A list of edges." - edges: [FavoriteEdge] - "A list of nodes." - nodes: [Favorite] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [FavoriteEdge] + "A list of nodes." + nodes: [Favorite] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type FavoriteEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Favorite + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Favorite } type Generic implements Base { - "The error code." - code: String - "A description of the error" - message: String! - "Which input value this error came from" - path: [String!] + "The error code." + code: String + "A description of the error" + message: String! + "Which input value this error came from" + path: [String!] } type GenericDelete { - id: ID! + id: ID! } type Image { - "A blurhash-encoded version of this image" - blurhash: String - "The original image" - original: ImageView! - "The various generated views of this image" - views(names: [String!]): [ImageView!]! + "A blurhash-encoded version of this image" + blurhash: String + "The original image" + original: ImageView! + "The various generated views of this image" + views(names: [String!]): [ImageView!]! } type ImageView implements WithTimestamps { - createdAt: ISO8601DateTime! - "The height of the image" - height: Int - "The name of this view of the image" - name: String! - updatedAt: ISO8601DateTime! - "The URL of this view of the image" - url: String! - "The width of the image" - width: Int + createdAt: ISO8601DateTime! + "The height of the image" + height: Int + "The name of this view of the image" + name: String! + updatedAt: ISO8601DateTime! + "The URL of this view of the image" + url: String! + "The width of the image" + width: Int } "The user library filterable by media_type and status" type Library { - "All Library Entries for a specific Media" - all( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type!, - status: [LibraryEntryStatus!] - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the completed status" - completed( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the current status" - current( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the dropped status" - dropped( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the on_hold status" - onHold( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the planned status" - planned( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! + "All Library Entries for a specific Media" + all( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type!, + status: [LibraryEntryStatus!] + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the completed status" + completed( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the current status" + current( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the dropped status" + dropped( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the on_hold status" + onHold( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the planned status" + planned( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type! + ): LibraryEntryConnection! } "Information about a specific media entry for a user" type LibraryEntry implements WithTimestamps { - createdAt: ISO8601DateTime! - "History of user actions for this library entry." - events( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaTypes: [media_type!] = [ANIME] - ): LibraryEventConnection - "When the user finished this media." - finishedAt: ISO8601DateTime - id: ID! - "The last unit consumed" - lastUnit: Unit - "The media related to this library entry." - media: Media! - "The next unit to be consumed" - nextUnit: Unit - "Notes left by the profile related to this library entry." - notes: String - "If the media related to the library entry is Not-Safe-for-Work." - nsfw: Boolean! - "If this library entry is publicly visibile from their profile, or hidden." - private: Boolean! - "The number of episodes/chapters this user has watched/read" - progress: Int! - "When the user last watched an episode or read a chapter of this media." - progressedAt: ISO8601DateTime - "How much you enjoyed this media (lower meaning not liking)." - rating: Int - "The reaction based on the media of this library entry." - reaction: MediaReaction - "Amount of times this media has been rewatched." - reconsumeCount: Int! - "If the profile is currently rewatching this media." - reconsuming: Boolean! - "When the user started this media." - startedAt: ISO8601DateTime - status: LibraryEntryStatus! - updatedAt: ISO8601DateTime! - "The user who created this library entry." - user: Profile! - "Volumes that the profile owns (physically or digital)." - volumesOwned: Int! + createdAt: ISO8601DateTime! + "History of user actions for this library entry." + events( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaTypes: [media_type!] = [ANIME] + ): LibraryEventConnection + "When the user finished this media." + finishedAt: ISO8601DateTime + id: ID! + "The last unit consumed" + lastUnit: Unit + "The media related to this library entry." + media: Media! + "The next unit to be consumed" + nextUnit: Unit + "Notes left by the profile related to this library entry." + notes: String + "If the media related to the library entry is Not-Safe-for-Work." + nsfw: Boolean! + "If this library entry is publicly visibile from their profile, or hidden." + private: Boolean! + "The number of episodes/chapters this user has watched/read" + progress: Int! + "When the user last watched an episode or read a chapter of this media." + progressedAt: ISO8601DateTime + "How much you enjoyed this media (lower meaning not liking)." + rating: Int + "The reaction based on the media of this library entry." + reaction: MediaReaction + "Amount of times this media has been rewatched." + reconsumeCount: Int! + "If the profile is currently rewatching this media." + reconsuming: Boolean! + "When the user started this media." + startedAt: ISO8601DateTime + status: LibraryEntryStatus! + updatedAt: ISO8601DateTime! + "The user who created this library entry." + user: Profile! + "Volumes that the profile owns (physically or digital)." + volumesOwned: Int! } "The connection type for LibraryEntry." type LibraryEntryConnection { - "A list of edges." - edges: [LibraryEntryEdge] - "A list of nodes." - nodes: [LibraryEntry] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [LibraryEntryEdge] + "A list of nodes." + nodes: [LibraryEntry] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "Autogenerated return type of LibraryEntryCreate" type LibraryEntryCreatePayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryDelete" type LibraryEntryDeletePayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: GenericDelete + "Graphql Errors" + errors: [Generic!] + libraryEntry: GenericDelete } "An edge in a connection." type LibraryEntryEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: LibraryEntry + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: LibraryEntry } type LibraryEntryMutation { - "Create a library entry" - create( - "Create a Library Entry" - input: LibraryEntryCreateInput! - ): LibraryEntryCreatePayload - "Delete a library entry" - delete( - "Delete Library Entry" - input: GenericDeleteInput! - ): LibraryEntryDeletePayload - "Update a library entry" - update( - "Update Library Entry" - input: LibraryEntryUpdateInput! - ): LibraryEntryUpdatePayload - "Update library entry progress by id" - updateProgressById( - "Update library entry progress by id" - input: UpdateProgressByIdInput! - ): LibraryEntryUpdateProgressByIdPayload - "Update library entry progress by media" - updateProgressByMedia( - "Update library entry progress by media" - input: UpdateProgressByMediaInput! - ): LibraryEntryUpdateProgressByMediaPayload - "Update library entry rating by id" - updateRatingById( - "Update library entry rating by id" - input: UpdateRatingByIdInput! - ): LibraryEntryUpdateRatingByIdPayload - "Update library entry rating by media" - updateRatingByMedia( - "Update library entry rating by media" - input: UpdateRatingByMediaInput! - ): LibraryEntryUpdateRatingByMediaPayload - "Update library entry status by id" - updateStatusById( - "Update library entry status by id" - input: UpdateStatusByIdInput! - ): LibraryEntryUpdateStatusByIdPayload - "Update library entry status by media" - updateStatusByMedia( - "Update library entry status by media" - input: UpdateStatusByMediaInput! - ): LibraryEntryUpdateStatusByMediaPayload + "Create a library entry" + create( + "Create a Library Entry" + input: LibraryEntryCreateInput! + ): LibraryEntryCreatePayload + "Delete a library entry" + delete( + "Delete Library Entry" + input: GenericDeleteInput! + ): LibraryEntryDeletePayload + "Update a library entry" + update( + "Update Library Entry" + input: LibraryEntryUpdateInput! + ): LibraryEntryUpdatePayload + "Update library entry progress by id" + updateProgressById( + "Update library entry progress by id" + input: UpdateProgressByIdInput! + ): LibraryEntryUpdateProgressByIdPayload + "Update library entry progress by media" + updateProgressByMedia( + "Update library entry progress by media" + input: UpdateProgressByMediaInput! + ): LibraryEntryUpdateProgressByMediaPayload + "Update library entry rating by id" + updateRatingById( + "Update library entry rating by id" + input: UpdateRatingByIdInput! + ): LibraryEntryUpdateRatingByIdPayload + "Update library entry rating by media" + updateRatingByMedia( + "Update library entry rating by media" + input: UpdateRatingByMediaInput! + ): LibraryEntryUpdateRatingByMediaPayload + "Update library entry status by id" + updateStatusById( + "Update library entry status by id" + input: UpdateStatusByIdInput! + ): LibraryEntryUpdateStatusByIdPayload + "Update library entry status by media" + updateStatusByMedia( + "Update library entry status by media" + input: UpdateStatusByMediaInput! + ): LibraryEntryUpdateStatusByMediaPayload } "Autogenerated return type of LibraryEntryUpdate" type LibraryEntryUpdatePayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateProgressById" type LibraryEntryUpdateProgressByIdPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateProgressByMedia" type LibraryEntryUpdateProgressByMediaPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateRatingById" type LibraryEntryUpdateRatingByIdPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateRatingByMedia" type LibraryEntryUpdateRatingByMediaPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateStatusById" type LibraryEntryUpdateStatusByIdPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateStatusByMedia" type LibraryEntryUpdateStatusByMediaPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "History of user actions for a library entry." type LibraryEvent implements WithTimestamps { - "The data that was changed for this library event." - changedData: Map! - createdAt: ISO8601DateTime! - id: ID! - "The type of library event." - kind: LibraryEventKind! - "The library entry related to this library event." - libraryEntry: LibraryEntry! - "The media related to this library event." - media: Media! - updatedAt: ISO8601DateTime! - "The user who created this library event" - user: Profile! + "The data that was changed for this library event." + changedData: Map! + createdAt: ISO8601DateTime! + id: ID! + "The type of library event." + kind: LibraryEventKind! + "The library entry related to this library event." + libraryEntry: LibraryEntry! + "The media related to this library event." + media: Media! + updatedAt: ISO8601DateTime! + "The user who created this library event" + user: Profile! } "The connection type for LibraryEvent." type LibraryEventConnection { - "A list of edges." - edges: [LibraryEventEdge] - "A list of nodes." - nodes: [LibraryEvent] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [LibraryEventEdge] + "A list of nodes." + nodes: [LibraryEvent] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type LibraryEventEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: LibraryEvent + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: LibraryEvent } type Manga implements Media & WithTimestamps { - "The recommended minimum age group for this media" - ageRating: AgeRating - "An explanation of why this received the age rating it did" - ageRatingGuide: String - "The average rating of this media amongst all Kitsu users" - averageRating: Float - "A large banner image for this media" - bannerImage: Image! - "A list of categories for this media" - categories( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection! - "The number of chapters in this manga." - chapterCount: Int - "The estimated number of chapters in this manga." - chapterCountGuess: Int - "The chapters in the manga." - chapters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ChapterConnection - "The characters who starred in this media" - characters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection! - createdAt: ISO8601DateTime! - "A brief (mostly spoiler free) summary or description of the media." - description(locales: [String!]): Map! - "the day that this media made its final release" - endDate: Date - "The number of users with this in their favorites" - favoritesCount: Int - id: ID! - "A list of mappings for this media" - mappings( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MappingConnection! - "The time of the next release of this media" - nextRelease: ISO8601DateTime - "The poster image of this media" - posterImage: Image! - "The companies which helped to produce this media" - productions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaProductionConnection! - "A list of quotes from this media" - quotes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteConnection! - "A list of reactions for this media" - reactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "The season this was released in" - season: ReleaseSeason - "Whether the media is Safe-for-Work" - sfw: Boolean! - "The URL-friendly identifier of this media" - slug: String! - "The staff members who worked on this media" - staff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection! - "The day that this media first released" - startDate: Date - "The current releasing status of this media" - status: ReleaseStatus! - "A secondary type for categorizing Manga." - subtype: MangaSubtype! - "Description of when this media is expected to release" - tba: String - "The titles for this media in various locales" - titles: TitlesList! - "Anime or Manga." - type: String! - updatedAt: ISO8601DateTime! - "The number of users with this in their library" - userCount: Int - "The number of volumes in this manga." - volumeCount: Int + "The recommended minimum age group for this media" + ageRating: AgeRating + "An explanation of why this received the age rating it did" + ageRatingGuide: String + "The average rating of this media amongst all Kitsu users" + averageRating: Float + "A large banner image for this media" + bannerImage: Image! + "A list of categories for this media" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection! + "The number of chapters in this manga." + chapterCount: Int + "The estimated number of chapters in this manga." + chapterCountGuess: Int + "The chapters in the manga." + chapters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ChapterConnection + "The characters who starred in this media" + characters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection! + createdAt: ISO8601DateTime! + "A brief (mostly spoiler free) summary or description of the media." + description(locales: [String!]): Map! + "the day that this media made its final release" + endDate: Date + "The number of users with this in their favorites" + favoritesCount: Int + id: ID! + "A list of mappings for this media" + mappings( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MappingConnection! + "The time of the next release of this media" + nextRelease: ISO8601DateTime + "The poster image of this media" + posterImage: Image! + "The companies which helped to produce this media" + productions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaProductionConnection! + "A list of quotes from this media" + quotes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteConnection! + "A list of reactions for this media" + reactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "The season this was released in" + season: ReleaseSeason + "Whether the media is Safe-for-Work" + sfw: Boolean! + "The URL-friendly identifier of this media" + slug: String! + "The staff members who worked on this media" + staff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection! + "The day that this media first released" + startDate: Date + "The current releasing status of this media" + status: ReleaseStatus! + "A secondary type for categorizing Manga." + subtype: MangaSubtype! + "Description of when this media is expected to release" + tba: String + "The titles for this media in various locales" + titles: TitlesList! + "Anime or Manga." + type: String! + updatedAt: ISO8601DateTime! + "The number of users with this in their library" + userCount: Int + "The number of volumes in this manga." + volumeCount: Int } type MangaAmountConsumed implements AmountConsumed { - "Total media completed atleast once." - completed: Int! - id: ID! - "Total amount of media." - media: Int! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "Total progress of library including reconsuming." - units: Int! + "Total media completed atleast once." + completed: Int! + id: ID! + "Total amount of media." + media: Int! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "Total progress of library including reconsuming." + units: Int! } type MangaCategoryBreakdown implements CategoryBreakdown { - "A Map of category_id -> count for all categories present on the library entries" - categories: Map! - id: ID! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "The total amount of library entries." - total: Int! + "A Map of category_id -> count for all categories present on the library entries" + categories: Map! + id: ID! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "The total amount of library entries." + total: Int! } "The connection type for Manga." type MangaConnection { - "A list of edges." - edges: [MangaEdge] - "A list of nodes." - nodes: [Manga] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MangaEdge] + "A list of nodes." + nodes: [Manga] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MangaEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Manga + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Manga } "Media Mappings from External Sites (MAL, Anilist, etc..) to Kitsu." type Mapping implements WithTimestamps { - createdAt: ISO8601DateTime! - "The ID of the media from the external site." - externalId: ID! - "The name of the site which kitsu media is being linked from." - externalSite: MappingExternalSite! - id: ID! - "The kitsu object that is mapped." - item: MappingItem! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + "The ID of the media from the external site." + externalId: ID! + "The name of the site which kitsu media is being linked from." + externalSite: MappingExternalSite! + id: ID! + "The kitsu object that is mapped." + item: MappingItem! + updatedAt: ISO8601DateTime! } "The connection type for Mapping." type MappingConnection { - "A list of edges." - edges: [MappingEdge] - "A list of nodes." - nodes: [Mapping] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MappingEdge] + "A list of nodes." + nodes: [Mapping] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MappingEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Mapping + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Mapping } "Information about a Character starring in a Media" type MediaCharacter implements WithTimestamps { - "The character" - character: Character! - createdAt: ISO8601DateTime! - id: ID! - "The media" - media: Media! - "The role this character had in the media" - role: CharacterRole! - updatedAt: ISO8601DateTime! - "The voices of this character" - voices( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - locale: [String!] - ): CharacterVoiceConnection + "The character" + character: Character! + createdAt: ISO8601DateTime! + id: ID! + "The media" + media: Media! + "The role this character had in the media" + role: CharacterRole! + updatedAt: ISO8601DateTime! + "The voices of this character" + voices( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + locale: [String!] + ): CharacterVoiceConnection } "The connection type for MediaCharacter." type MediaCharacterConnection { - "A list of edges." - edges: [MediaCharacterEdge] - "A list of nodes." - nodes: [MediaCharacter] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaCharacterEdge] + "A list of nodes." + nodes: [MediaCharacter] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaCharacterEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaCharacter + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaCharacter } "The connection type for Media." type MediaConnection { - "A list of edges." - edges: [MediaEdge] - "A list of nodes." - nodes: [Media] - "Information to aid in pagination." - pageInfo: PageInfo! + "A list of edges." + edges: [MediaEdge] + "A list of nodes." + nodes: [Media] + "Information to aid in pagination." + pageInfo: PageInfo! } "An edge in a connection." type MediaEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Media + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Media } "The role a company played in the creation or localization of a media" type MediaProduction implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The media" - media: Media! - "The producer" - person: Producer! - "The role this company played" - role: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The media" + media: Media! + "The producer" + person: Producer! + "The role this company played" + role: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaProduction." type MediaProductionConnection { - "A list of edges." - edges: [MediaProductionEdge] - "A list of nodes." - nodes: [MediaProduction] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaProductionEdge] + "A list of nodes." + nodes: [MediaProduction] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaProductionEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaProduction + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaProduction } "A simple review that is 140 characters long expressing how you felt about a media" type MediaReaction implements WithTimestamps { - "The author who wrote this reaction." - author: Profile! - createdAt: ISO8601DateTime! - id: ID! - "The library entry related to this reaction." - libraryEntry: LibraryEntry! - "Users who liked this reaction." - likes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "The media related to this reaction." - media: Media! - "When this media reaction was written based on media progress." - progress: Int! - "The reaction text related to a media." - reaction: String! - updatedAt: ISO8601DateTime! + "The author who wrote this reaction." + author: Profile! + createdAt: ISO8601DateTime! + id: ID! + "The library entry related to this reaction." + libraryEntry: LibraryEntry! + "Users who liked this reaction." + likes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "The media related to this reaction." + media: Media! + "When this media reaction was written based on media progress." + progress: Int! + "The reaction text related to a media." + reaction: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaReaction." type MediaReactionConnection { - "A list of edges." - edges: [MediaReactionEdge] - "A list of nodes." - nodes: [MediaReaction] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaReactionEdge] + "A list of nodes." + nodes: [MediaReaction] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaReactionEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaReaction + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaReaction } "Information about a person working on an anime" type MediaStaff implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The media" - media: Media! - "The person" - person: Person! - "The role this person had in the creation of this media" - role: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The media" + media: Media! + "The person" + person: Person! + "The role this person had in the creation of this media" + role: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaStaff." type MediaStaffConnection { - "A list of edges." - edges: [MediaStaffEdge] - "A list of nodes." - nodes: [MediaStaff] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaStaffEdge] + "A list of nodes." + nodes: [MediaStaff] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaStaffEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaStaff + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaStaff } type Mutation { - anime: AnimeMutation - episode: EpisodeMutation - libraryEntry: LibraryEntryMutation - pro: ProMutation! + anime: AnimeMutation + episode: EpisodeMutation + libraryEntry: LibraryEntryMutation + pro: ProMutation! } "Information about pagination in a connection." type PageInfo { - "When paginating forwards, the cursor to continue." - endCursor: String - "When paginating forwards, are there more items?" - hasNextPage: Boolean! - "When paginating backwards, are there more items?" - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String + "When paginating forwards, are there more items?" + hasNextPage: Boolean! + "When paginating backwards, are there more items?" + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String } "A Voice Actor, Director, Animator, or other person who works in the creation and localization of media" type Person implements WithTimestamps { - "The day when this person was born" - birthday: Date - createdAt: ISO8601DateTime! - "A brief biography or description of the person." - description(locales: [String!]): Map! - id: ID! - "An image of the person" - image: Image - "Information about the person working on specific media" - mediaStaff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection - "The primary name of this person." - name: String! - "The name of this person in various languages" - names: TitlesList! - "The URL-friendly identifier of this person." - slug: String! - updatedAt: ISO8601DateTime! - "The voice-acting roles this person has had." - voices( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CharacterVoiceConnection + "The day when this person was born" + birthday: Date + createdAt: ISO8601DateTime! + "A brief biography or description of the person." + description(locales: [String!]): Map! + id: ID! + "An image of the person" + image: Image + "Information about the person working on specific media" + mediaStaff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection + "The primary name of this person." + name: String! + "The name of this person in various languages" + names: TitlesList! + "The URL-friendly identifier of this person." + slug: String! + updatedAt: ISO8601DateTime! + "The voice-acting roles this person has had." + voices( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CharacterVoiceConnection } "A post that is visible to your followers and globally in the news-feed." type Post implements WithTimestamps { - "The user who created this post." - author: Profile! - "All comments related to this post." - comments( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CommentConnection! - "Unmodified content." - content: String! - "Html formatted content." - contentFormatted: String! - createdAt: ISO8601DateTime! - "Users that are watching this post" - follows( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - id: ID! - "If a post is Not-Safe-for-Work." - isNsfw: Boolean! - "If this post spoils the tagged media." - isSpoiler: Boolean! - "Users that have liked this post." - likes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "The media tagged in this post." - media: Media - updatedAt: ISO8601DateTime! + "The user who created this post." + author: Profile! + "All comments related to this post." + comments( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CommentConnection! + "Unmodified content." + content: String! + "Html formatted content." + contentFormatted: String! + createdAt: ISO8601DateTime! + "Users that are watching this post" + follows( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + id: ID! + "If a post is Not-Safe-for-Work." + isNsfw: Boolean! + "If this post spoils the tagged media." + isSpoiler: Boolean! + "Users that have liked this post." + likes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "The media tagged in this post." + media: Media + updatedAt: ISO8601DateTime! } "The connection type for Post." type PostConnection { - "A list of edges." - edges: [PostEdge] - "A list of nodes." - nodes: [Post] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [PostEdge] + "A list of nodes." + nodes: [Post] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type PostEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Post + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Post } type ProMutation { - "Set the user's discord tag" - setDiscord( - "Your discord tag (Name#1234)" - discord: String! - ): SetDiscordPayload - "Set the user's Hall-of-Fame message" - setMessage( - "The message to set for your Hall of Fame entry" - message: String! - ): SetMessagePayload - "End the user's pro subscription" - unsubscribe: UnsubscribePayload + "Set the user's discord tag" + setDiscord( + "Your discord tag (Name#1234)" + discord: String! + ): SetDiscordPayload + "Set the user's Hall-of-Fame message" + setMessage( + "The message to set for your Hall of Fame entry" + message: String! + ): SetMessagePayload + "End the user's pro subscription" + unsubscribe: UnsubscribePayload } "A subscription to Kitsu PRO" type ProSubscription implements WithTimestamps { - "The account which is subscribed to Pro benefits" - account: Account! - "The billing service used for this subscription" - billingService: RecurringBillingService! - createdAt: ISO8601DateTime! - "The tier of Pro the account is subscribed to" - tier: ProTier! - updatedAt: ISO8601DateTime! + "The account which is subscribed to Pro benefits" + account: Account! + "The billing service used for this subscription" + billingService: RecurringBillingService! + createdAt: ISO8601DateTime! + "The tier of Pro the account is subscribed to" + tier: ProTier! + updatedAt: ISO8601DateTime! } "A company involved in the creation or localization of media" type Producer implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The name of this production company" - name: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The name of this production company" + name: String! + updatedAt: ISO8601DateTime! } "A user profile on Kitsu" type Profile implements WithTimestamps { - "A short biographical blurb about this profile" - about: String - "An avatar image to easily identify this profile" - avatarImage: Image - "A banner to display at the top of the profile" - bannerImage: Image - "When the user was born" - birthday: ISO8601Date - "All comments to any post this user has made." - comments( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CommentConnection! - createdAt: ISO8601DateTime! - "Favorite media, characters, and people" - favorites( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): FavoriteConnection! - "People that follow the user" - followers( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "People the user is following" - following( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "What the user identifies as" - gender: String - id: ID! - "The user library of their media" - library: Library! - "A list of library events for this user" - libraryEvents( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - kind: [LibraryEventKind!], - "Returns the last _n_ elements from the list." - last: Int - ): LibraryEventConnection! - "The user's general location" - location: String - "Media reactions written by this user." - mediaReactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "A non-unique publicly visible name for the profile. Minimum of 3 characters and any valid Unicode character" - name: String! - "Post pinned to the user profile" - pinnedPost: Post - "All posts this profile has made." - posts( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): PostConnection! - "The message this user has submitted to the Hall of Fame" - proMessage: String - "The PRO level the user currently has" - proTier: ProTier - "Links to the user on other (social media) sites." - siteLinks( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): SiteLinkConnection - "The URL-friendly identifier for this profile" - slug: String - "The different stats we calculate for this user." - stats: ProfileStats! - updatedAt: ISO8601DateTime! - "A fully qualified URL to the profile" - url: String - "The character this profile has declared as their waifu or husbando" - waifu: Character - "The properly-gendered term for the user's waifu. This should normally only be 'Waifu' or 'Husbando' but some people are jerks, including the person who wrote this..." - waifuOrHusbando: String + "A short biographical blurb about this profile" + about: String + "An avatar image to easily identify this profile" + avatarImage: Image + "A banner to display at the top of the profile" + bannerImage: Image + "When the user was born" + birthday: ISO8601Date + "All comments to any post this user has made." + comments( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CommentConnection! + createdAt: ISO8601DateTime! + "Favorite media, characters, and people" + favorites( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): FavoriteConnection! + "People that follow the user" + followers( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "People the user is following" + following( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "What the user identifies as" + gender: String + id: ID! + "The user library of their media" + library: Library! + "A list of library events for this user" + libraryEvents( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + kind: [LibraryEventKind!], + "Returns the last _n_ elements from the list." + last: Int + ): LibraryEventConnection! + "The user's general location" + location: String + "Media reactions written by this user." + mediaReactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "A non-unique publicly visible name for the profile. Minimum of 3 characters and any valid Unicode character" + name: String! + "Post pinned to the user profile" + pinnedPost: Post + "All posts this profile has made." + posts( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): PostConnection! + "The message this user has submitted to the Hall of Fame" + proMessage: String + "The PRO level the user currently has" + proTier: ProTier + "Links to the user on other (social media) sites." + siteLinks( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): SiteLinkConnection + "The URL-friendly identifier for this profile" + slug: String + "The different stats we calculate for this user." + stats: ProfileStats! + updatedAt: ISO8601DateTime! + "A fully qualified URL to the profile" + url: String + "The character this profile has declared as their waifu or husbando" + waifu: Character + "The properly-gendered term for the user's waifu. This should normally only be 'Waifu' or 'Husbando' but some people are jerks, including the person who wrote this..." + waifuOrHusbando: String } "The connection type for Profile." type ProfileConnection { - "A list of edges." - edges: [ProfileEdge] - "A list of nodes." - nodes: [Profile] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [ProfileEdge] + "A list of nodes." + nodes: [Profile] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type ProfileEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Profile + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Profile } "The different types of user stats that we calculate." type ProfileStats { - "The total amount of anime you have watched over your whole life." - animeAmountConsumed: AnimeAmountConsumed! - "The breakdown of the different categories related to the anime you have completed" - animeCategoryBreakdown: AnimeCategoryBreakdown! - "The total amount of manga you ahve read over your whole life." - mangaAmountConsumed: MangaAmountConsumed! - "The breakdown of the different categories related to the manga you have completed" - mangaCategoryBreakdown: MangaCategoryBreakdown! + "The total amount of anime you have watched over your whole life." + animeAmountConsumed: AnimeAmountConsumed! + "The breakdown of the different categories related to the anime you have completed" + animeCategoryBreakdown: AnimeCategoryBreakdown! + "The total amount of manga you ahve read over your whole life." + mangaAmountConsumed: MangaAmountConsumed! + "The breakdown of the different categories related to the manga you have completed" + mangaCategoryBreakdown: MangaCategoryBreakdown! } type Query { - "All Anime in the Kitsu database" - anime( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): AnimeConnection! - "All Anime with specific Status" - animeByStatus( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - status: ReleaseStatus! - ): AnimeConnection - "Kitsu account details. You must supply an Authorization token in header." - currentAccount: Account - "Find a single Anime by ID" - findAnimeById(id: ID!): Anime - "Find a single Anime by Slug" - findAnimeBySlug(slug: String!): Anime - "Find a single Category by ID" - findCategoryById(id: ID!): Category - "Find a single Category by Slug" - findCategoryBySlug(slug: String!): Category - "Find a single Character by ID" - findCharacterById(id: ID!): Character - "Find a single Character by Slug" - findCharacterBySlug(slug: String!): Character - "Find a single Library Entry by ID" - findLibraryEntryById(id: ID!): LibraryEntry - "Find a single Library Event by ID" - findLibraryEventById(id: ID!): LibraryEvent - "Find a single Manga by ID" - findMangaById(id: ID!): Manga - "Find a single Manga by Slug" - findMangaBySlug(slug: String!): Manga - "Find a single Person by ID" - findPersonById(id: ID!): Person - "Find a single Person by Slug" - findPersonBySlug(slug: String!): Person - "Find a single User by ID" - findProfileById(id: ID!): Profile - "Find a single User by Slug" - findProfileBySlug(slug: String!): Profile - "List trending media on Kitsu" - globalTrending( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - medium: String! - ): MediaConnection! - "List of Library Entries by MediaType and MediaId" - libraryEntriesByMedia( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaId: ID!, - mediaType: media_type! - ): LibraryEntryConnection - "List of Library Entries by MediaType" - libraryEntriesByMediaType( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection - "List trending media within your network" - localTrending( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - medium: String! - ): MediaConnection! - "Find a specific Mapping Item by External ID and External Site." - lookupMapping(externalId: ID!, externalSite: MappingExternalSite!): MappingItem - "All Manga in the Kitsu database" - manga( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MangaConnection! - "All Manga with specific Status" - mangaByStatus( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - status: ReleaseStatus! - ): MangaConnection - "Patrons sorted by a Proprietary Magic Algorithm" - patrons( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "Get your current session info" - session: Session! + "All Anime in the Kitsu database" + anime( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): AnimeConnection! + "All Anime with specific Status" + animeByStatus( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + status: ReleaseStatus! + ): AnimeConnection + "Kitsu account details. You must supply an Authorization token in header." + currentAccount: Account + "Find a single Anime by ID" + findAnimeById(id: ID!): Anime + "Find a single Anime by Slug" + findAnimeBySlug(slug: String!): Anime + "Find a single Category by ID" + findCategoryById(id: ID!): Category + "Find a single Category by Slug" + findCategoryBySlug(slug: String!): Category + "Find a single Character by ID" + findCharacterById(id: ID!): Character + "Find a single Character by Slug" + findCharacterBySlug(slug: String!): Character + "Find a single Library Entry by ID" + findLibraryEntryById(id: ID!): LibraryEntry + "Find a single Library Event by ID" + findLibraryEventById(id: ID!): LibraryEvent + "Find a single Manga by ID" + findMangaById(id: ID!): Manga + "Find a single Manga by Slug" + findMangaBySlug(slug: String!): Manga + "Find a single Person by ID" + findPersonById(id: ID!): Person + "Find a single Person by Slug" + findPersonBySlug(slug: String!): Person + "Find a single User by ID" + findProfileById(id: ID!): Profile + "Find a single User by Slug" + findProfileBySlug(slug: String!): Profile + "List trending media on Kitsu" + globalTrending( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + medium: String! + ): MediaConnection! + "List of Library Entries by MediaType and MediaId" + libraryEntriesByMedia( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaId: ID!, + mediaType: media_type! + ): LibraryEntryConnection + "List of Library Entries by MediaType" + libraryEntriesByMediaType( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: media_type! + ): LibraryEntryConnection + "List trending media within your network" + localTrending( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + medium: String! + ): MediaConnection! + "Find a specific Mapping Item by External ID and External Site." + lookupMapping(externalId: ID!, externalSite: MappingExternalSite!): MappingItem + "All Manga in the Kitsu database" + manga( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MangaConnection! + "All Manga with specific Status" + mangaByStatus( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + status: ReleaseStatus! + ): MangaConnection + "Patrons sorted by a Proprietary Magic Algorithm" + patrons( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "Get your current session info" + session: Session! } "A quote from a media" type Quote implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The lines of the quote" - lines( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteLineConnection! - "The media this quote is excerpted from" - media: Media! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The lines of the quote" + lines( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteLineConnection! + "The media this quote is excerpted from" + media: Media! + updatedAt: ISO8601DateTime! } "The connection type for Quote." type QuoteConnection { - "A list of edges." - edges: [QuoteEdge] - "A list of nodes." - nodes: [Quote] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [QuoteEdge] + "A list of nodes." + nodes: [Quote] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type QuoteEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Quote + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Quote } "A line in a quote" type QuoteLine implements WithTimestamps { - "The character who said this line" - character: Character! - "The line that was spoken" - content: String! - createdAt: ISO8601DateTime! - id: ID! - "The quote this line is in" - quote: Quote! - updatedAt: ISO8601DateTime! + "The character who said this line" + character: Character! + "The line that was spoken" + content: String! + createdAt: ISO8601DateTime! + id: ID! + "The quote this line is in" + quote: Quote! + updatedAt: ISO8601DateTime! } "The connection type for QuoteLine." type QuoteLineConnection { - "A list of edges." - edges: [QuoteLineEdge] - "A list of nodes." - nodes: [QuoteLine] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [QuoteLineEdge] + "A list of nodes." + nodes: [QuoteLine] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type QuoteLineEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: QuoteLine + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: QuoteLine } "Information about a user session" type Session { - "The account associated with this session" - account: Account - "The profile associated with this session" - profile: Profile + "The account associated with this session" + account: Account + "The profile associated with this session" + profile: Profile } "Autogenerated return type of SetDiscord" type SetDiscordPayload { - discord: String! - "Graphql Errors" - errors: [Generic!] + discord: String! + "Graphql Errors" + errors: [Generic!] } "Autogenerated return type of SetMessage" type SetMessagePayload { - "Graphql Errors" - errors: [Generic!] - message: String! + "Graphql Errors" + errors: [Generic!] + message: String! } "A link to a user's profile on an external site." type SiteLink implements WithTimestamps { - "The user profile the site is linked to." - author: Profile! - createdAt: ISO8601DateTime! - id: ID! - updatedAt: ISO8601DateTime! - "A fully qualified URL of the user profile on an external site." - url: String! + "The user profile the site is linked to." + author: Profile! + createdAt: ISO8601DateTime! + id: ID! + updatedAt: ISO8601DateTime! + "A fully qualified URL of the user profile on an external site." + url: String! } "The connection type for SiteLink." type SiteLinkConnection { - "A list of edges." - edges: [SiteLinkEdge] - "A list of nodes." - nodes: [SiteLink] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [SiteLinkEdge] + "A list of nodes." + nodes: [SiteLink] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type SiteLinkEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: SiteLink + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: SiteLink } "The streaming company." type Streamer implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The name of the site that is streaming this media." - siteName: String! - "Additional media this site is streaming." - streamingLinks( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): StreamingLinkConnection! - updatedAt: ISO8601DateTime! - "Videos of the media being streamed." - videos( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): VideoConnection! + createdAt: ISO8601DateTime! + id: ID! + "The name of the site that is streaming this media." + siteName: String! + "Additional media this site is streaming." + streamingLinks( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): StreamingLinkConnection! + updatedAt: ISO8601DateTime! + "Videos of the media being streamed." + videos( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): VideoConnection! } "The stream link." type StreamingLink implements Streamable & WithTimestamps { - createdAt: ISO8601DateTime! - "Spoken language is replaced by language of choice." - dubs: [String!]! - id: ID! - "The media being streamed" - media: Media! - "Which regions this video is available in." - regions: [String!]! - "The site that is streaming this media." - streamer: Streamer! - "Languages this is translated to. Usually placed at bottom of media." - subs: [String!]! - updatedAt: ISO8601DateTime! - "Fully qualified URL for the streaming link." - url: String! + createdAt: ISO8601DateTime! + "Spoken language is replaced by language of choice." + dubs: [String!]! + id: ID! + "The media being streamed" + media: Media! + "Which regions this video is available in." + regions: [String!]! + "The site that is streaming this media." + streamer: Streamer! + "Languages this is translated to. Usually placed at bottom of media." + subs: [String!]! + updatedAt: ISO8601DateTime! + "Fully qualified URL for the streaming link." + url: String! } "The connection type for StreamingLink." type StreamingLinkConnection { - "A list of edges." - edges: [StreamingLinkEdge] - "A list of nodes." - nodes: [StreamingLink] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [StreamingLinkEdge] + "A list of nodes." + nodes: [StreamingLink] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type StreamingLinkEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: StreamingLink + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: StreamingLink } type TitlesList { - "A list of additional, alternative, abbreviated, or unofficial titles" - alternatives: [String!] - "The official or de facto international title" - canonical: String - "The locale code that identifies which title is used as the canonical title" - canonicalLocale: String - "The list of localized titles keyed by locale" - localized(locales: [String!]): Map! + "A list of additional, alternative, abbreviated, or unofficial titles" + alternatives: [String!] + "The official or de facto international title" + canonical: String + "The locale code that identifies which title is used as the canonical title" + canonicalLocale: String + "The list of localized titles keyed by locale" + localized(locales: [String!]): Map! } "Autogenerated return type of Unsubscribe" type UnsubscribePayload { - "Graphql Errors" - errors: [Generic!] - expiresAt: ISO8601DateTime + "Graphql Errors" + errors: [Generic!] + expiresAt: ISO8601DateTime } "The media video." type Video implements Streamable & WithTimestamps { - createdAt: ISO8601DateTime! - "Spoken language is replaced by language of choice." - dubs: [String!]! - "The episode of this video" - episode: Episode! - id: ID! - "Which regions this video is available in." - regions: [String!]! - "The site that is streaming this media." - streamer: Streamer! - "Languages this is translated to. Usually placed at bottom of media." - subs: [String!]! - updatedAt: ISO8601DateTime! - "The url of the video." - url: String! + createdAt: ISO8601DateTime! + "Spoken language is replaced by language of choice." + dubs: [String!]! + "The episode of this video" + episode: Episode! + id: ID! + "Which regions this video is available in." + regions: [String!]! + "The site that is streaming this media." + streamer: Streamer! + "Languages this is translated to. Usually placed at bottom of media." + subs: [String!]! + updatedAt: ISO8601DateTime! + "The url of the video." + url: String! } "The connection type for Video." type VideoConnection { - "A list of edges." - edges: [VideoEdge] - "A list of nodes." - nodes: [Video] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [VideoEdge] + "A list of nodes." + nodes: [Video] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type VideoEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Video + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Video } "A manga volume which can contain multiple chapters." type Volume implements WithTimestamps { - "The chapters in this volume." - chapters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ChapterConnection - createdAt: ISO8601DateTime! - id: ID! - "The isbn number of this volume." - isbn: [String!]! - "The manga this volume is in." - manga: Manga! - "The volume number." - number: Int! - "The date when this chapter was released." - published: ISO8601Date - "The titles for this chapter in various locales" - titles: TitlesList! - updatedAt: ISO8601DateTime! + "The chapters in this volume." + chapters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ChapterConnection + createdAt: ISO8601DateTime! + id: ID! + "The isbn number of this volume." + isbn: [String!]! + "The manga this volume is in." + manga: Manga! + "The volume number." + number: Int! + "The date when this chapter was released." + published: ISO8601Date + "The titles for this chapter in various locales" + titles: TitlesList! + updatedAt: ISO8601DateTime! } enum AgeRating { - "Acceptable for all ages" - G - "Parental guidance suggested; should be safe for preteens and older" - PG - "Possible lewd or intense themes; should be safe for teens and older" - R - "Contains adult content or themes; should only be viewed by adults" - R18 + "Acceptable for all ages" + G + "Parental guidance suggested; should be safe for preteens and older" + PG + "Possible lewd or intense themes; should be safe for teens and older" + R + "Contains adult content or themes; should only be viewed by adults" + R18 } enum AnimeSubtype { - MOVIE - MUSIC - "Original Net Animation (Web Anime)." - ONA - "Original Video Animation. Anime directly released to video market." - OVA - "Spinoffs or Extras of the original." - SPECIAL - TV + MOVIE + MUSIC + "Original Net Animation (Web Anime)." + ONA + "Original Video Animation. Anime directly released to video market." + OVA + "Spinoffs or Extras of the original." + SPECIAL + TV } enum CharacterRole { - "A background character who generally only appears in a few episodes" - BACKGROUND - "A character from a different franchise making a (usually brief) appearance" - CAMEO - "A character who appears throughout a series and is a focal point of the media" - MAIN - "A character who appears in multiple episodes but is not a main character" - RECURRING + "A background character who generally only appears in a few episodes" + BACKGROUND + "A character from a different franchise making a (usually brief) appearance" + CAMEO + "A character who appears throughout a series and is a focal point of the media" + MAIN + "A character who appears in multiple episodes but is not a main character" + RECURRING } enum LibraryEntryStatus { - "The user completed this media." - COMPLETED - "The user is currently reading or watching this media." - CURRENT - "The user started but chose not to finish this media." - DROPPED - "The user started but paused reading or watching this media." - ON_HOLD - "The user plans to read or watch this media in future." - PLANNED + "The user completed this media." + COMPLETED + "The user is currently reading or watching this media." + CURRENT + "The user started but chose not to finish this media." + DROPPED + "The user started but paused reading or watching this media." + ON_HOLD + "The user plans to read or watch this media in future." + PLANNED } enum LibraryEventKind { - "Notes were added/updated." - ANNOTATED - "Progress or Time Spent was added/updated." - PROGRESSED - "Rating was added/updated." - RATED - "Reaction was added/updated." - REACTED - "Status or Reconsuming was added/updated." - UPDATED + "Notes were added/updated." + ANNOTATED + "Progress or Time Spent was added/updated." + PROGRESSED + "Rating was added/updated." + RATED + "Reaction was added/updated." + REACTED + "Status or Reconsuming was added/updated." + UPDATED } enum MangaSubtype { - "Self published work." - DOUJIN - MANGA - "Chinese comics produced in China and in the Greater China region." - MANHUA - "A style of South Korean comic books and graphic novels" - MANHWA - NOVEL - "Original English Language." - OEL - ONESHOT + "Self published work." + DOUJIN + MANGA + "Chinese comics produced in China and in the Greater China region." + MANHUA + "A style of South Korean comic books and graphic novels" + MANHWA + NOVEL + "Original English Language." + OEL + ONESHOT } enum MappingExternalSite { - ANIDB - ANILIST_ANIME - ANILIST_MANGA - ANIMENEWSNETWORK - AOZORA - HULU - IMDB_EPISODES - MANGAUPDATES - MYANIMELIST_ANIME - MYANIMELIST_CHARACTERS - MYANIMELIST_MANGA - MYANIMELIST_PEOPLE - MYANIMELIST_PRODUCERS - MYDRAMALIST - THETVDB - THETVDB_SEASON - THETVDB_SERIES - TRAKT + ANIDB + ANILIST_ANIME + ANILIST_MANGA + ANIMENEWSNETWORK + AOZORA + HULU + IMDB_EPISODES + MANGAUPDATES + MYANIMELIST_ANIME + MYANIMELIST_CHARACTERS + MYANIMELIST_MANGA + MYANIMELIST_PEOPLE + MYANIMELIST_PRODUCERS + MYDRAMALIST + THETVDB + THETVDB_SEASON + THETVDB_SERIES + TRAKT } enum ProTier { - "Aozora Pro (only hides ads)" - AO_PRO @deprecated(reason : "No longer for sale") - "Aozora Pro+ (only hides ads)" - AO_PRO_PLUS @deprecated(reason : "No longer for sale") - "Top tier of Kitsu Pro" - PATRON - "Basic tier of Kitsu Pro" - PRO + "Aozora Pro (only hides ads)" + AO_PRO @deprecated(reason : "No longer for sale") + "Aozora Pro+ (only hides ads)" + AO_PRO_PLUS @deprecated(reason : "No longer for sale") + "Top tier of Kitsu Pro" + PATRON + "Basic tier of Kitsu Pro" + PRO } enum RatingSystem { - "1-20 in increments of 1 displayed as 1-10 in 0.5 increments" - ADVANCED - "1-20 in increments of 2 displayed as 5 stars in 0.5 star increments" - REGULAR - "1-20 displayed as 4 smileys - Awful (1), Meh (8), Good (14) and Great (20)" - SIMPLE + "1-20 in increments of 1 displayed as 1-10 in 0.5 increments" + ADVANCED + "1-20 in increments of 2 displayed as 5 stars in 0.5 star increments" + REGULAR + "1-20 displayed as 4 smileys - Awful (1), Meh (8), Good (14) and Great (20)" + SIMPLE } enum RecurringBillingService { - "Billed through Apple In-App Subscription" - APPLE - "Billed through Google Play Subscription" - GOOGLE_PLAY - "Bill a PayPal account" - PAYPAL - "Bill a credit card via Stripe" - STRIPE + "Billed through Apple In-App Subscription" + APPLE + "Billed through Google Play Subscription" + GOOGLE_PLAY + "Bill a PayPal account" + PAYPAL + "Bill a credit card via Stripe" + STRIPE } enum ReleaseSeason { - "Released during the Fall season" - FALL - "Released during the Spring season" - SPRING - "Released during the Summer season" - SUMMER - "Released during the Winter season" - WINTER + "Released during the Fall season" + FALL + "Released during the Spring season" + SPRING + "Released during the Summer season" + SUMMER + "Released during the Winter season" + WINTER } enum ReleaseStatus { - "This media is currently releasing" - CURRENT - "This media is no longer releasing" - FINISHED - "The release date has not been announced yet" - TBA - "This media is not released yet" - UNRELEASED - "This media is releasing soon" - UPCOMING + "This media is currently releasing" + CURRENT + "This media is no longer releasing" + FINISHED + "The release date has not been announced yet" + TBA + "This media is not released yet" + UNRELEASED + "This media is releasing soon" + UPCOMING } enum TitleLanguagePreference { - "Prefer the most commonly-used title for media" - CANONICAL - "Prefer the localized title for media" - LOCALIZED - "Prefer the romanized title for media" - ROMANIZED + "Prefer the most commonly-used title for media" + CANONICAL + "Prefer the localized title for media" + LOCALIZED + "Prefer the romanized title for media" + ROMANIZED } "これはアニメやマンガです" enum media_type { - ANIME - MANGA + ANIME + MANGA } input AnimeCreateInput { - ageRating: AgeRating - ageRatingGuide: String - bannerImage: Upload - description: Map! - endDate: Date - episodeCount: Int - episodeLength: Int - posterImage: Upload - startDate: Date - tba: String - titles: TitlesListInput! - youtubeTrailerVideoId: String + ageRating: AgeRating + ageRatingGuide: String + bannerImage: Upload + description: Map! + endDate: Date + episodeCount: Int + episodeLength: Int + posterImage: Upload + startDate: Date + tba: String + titles: TitlesListInput! + youtubeTrailerVideoId: String } input AnimeUpdateInput { - ageRating: AgeRating - ageRatingGuide: String - bannerImage: Upload - description: Map - endDate: Date - episodeCount: Int - episodeLength: Int - id: ID! - posterImage: Upload - startDate: Date - tba: String - titles: TitlesListInput - youtubeTrailerVideoId: String + ageRating: AgeRating + ageRatingGuide: String + bannerImage: Upload + description: Map + endDate: Date + episodeCount: Int + episodeLength: Int + id: ID! + posterImage: Upload + startDate: Date + tba: String + titles: TitlesListInput + youtubeTrailerVideoId: String } input EpisodeCreateInput { - description: Map - length: Int - mediaId: ID! - mediaType: media_type! - number: Int! - releasedAt: Date - thumbnailImage: Upload - titles: TitlesListInput! + description: Map + length: Int + mediaId: ID! + mediaType: media_type! + number: Int! + releasedAt: Date + thumbnailImage: Upload + titles: TitlesListInput! } input EpisodeUpdateInput { - description: Map - id: ID! - length: Int - number: Int - releasedAt: Date - thumbnailImage: Upload - titles: TitlesListInput + description: Map + id: ID! + length: Int + number: Int + releasedAt: Date + thumbnailImage: Upload + titles: TitlesListInput } input GenericDeleteInput { - id: ID! + id: ID! } input LibraryEntryCreateInput { - finishedAt: ISO8601DateTime - mediaId: ID! - mediaType: media_type! - notes: String - private: Boolean = false - progress: Int = 0 - rating: Int - reconsumeCount: Int = 0 - reconsuming: Boolean = false - startedAt: ISO8601DateTime - status: LibraryEntryStatus! - userId: ID! - volumesOwned: Int = 0 + finishedAt: ISO8601DateTime + mediaId: ID! + mediaType: media_type! + notes: String + private: Boolean = false + progress: Int = 0 + rating: Int + reconsumeCount: Int = 0 + reconsuming: Boolean = false + startedAt: ISO8601DateTime + status: LibraryEntryStatus! + userId: ID! + volumesOwned: Int = 0 } input LibraryEntryUpdateInput { - finishedAt: ISO8601DateTime - id: ID! - notes: String - private: Boolean - progress: Int - rating: Int - reconsumeCount: Int - reconsuming: Boolean - startedAt: ISO8601DateTime - status: LibraryEntryStatus - volumesOwned: Int + finishedAt: ISO8601DateTime + id: ID! + notes: String + private: Boolean + progress: Int + rating: Int + reconsumeCount: Int + reconsuming: Boolean + startedAt: ISO8601DateTime + status: LibraryEntryStatus + volumesOwned: Int } input TitlesListInput { - alternatives: [String!] - canonicalLocale: String - localized: Map + alternatives: [String!] + canonicalLocale: String + localized: Map } input UpdateProgressByIdInput { - id: ID! - progress: Int! + id: ID! + progress: Int! } input UpdateProgressByMediaInput { - mediaId: ID! - mediaType: media_type! - progress: Int! + mediaId: ID! + mediaType: media_type! + progress: Int! } input UpdateRatingByIdInput { - id: ID! - "A number between 2 - 20" - rating: Int! + id: ID! + "A number between 2 - 20" + rating: Int! } input UpdateRatingByMediaInput { - mediaId: ID! - mediaType: media_type! - "A number between 2 - 20" - rating: Int! + mediaId: ID! + mediaType: media_type! + "A number between 2 - 20" + rating: Int! } input UpdateStatusByIdInput { - id: ID! - status: LibraryEntryStatus! + id: ID! + status: LibraryEntryStatus! } input UpdateStatusByMediaInput { - mediaId: ID! - mediaType: media_type! - status: LibraryEntryStatus! + mediaId: ID! + mediaType: media_type! + status: LibraryEntryStatus! } From 66fca53dfcfa88654838f9114bd3398b70f10dea Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 9 Sep 2020 10:24:55 -0400 Subject: [PATCH 62/86] Only show total length of a series if the number is positive --- app/views/anime/details.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/anime/details.php b/app/views/anime/details.php index 161c02ee..f7d4b313 100644 --- a/app/views/anime/details.php +++ b/app/views/anime/details.php @@ -36,7 +36,7 @@ use function Aviat\AnimeClient\getLocalImg; - + 0): ?> Total Length From aca0f66db251e773db2081e076b93dbbebf36792 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 9 Sep 2020 13:25:27 -0400 Subject: [PATCH 63/86] Update streaming logs, remove genres from anime list view --- app/views/anime/list.php | 5 ----- public/images/streaming-logos/amazon.svg | 2 +- public/images/streaming-logos/vrv.svg | 1 + src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql | 5 ----- src/AnimeClient/Kitsu.php | 5 +++++ 5 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 public/images/streaming-logos/vrv.svg diff --git a/app/views/anime/list.php b/app/views/anime/list.php index ae4a5613..17373e3b 100644 --- a/app/views/anime/list.php +++ b/app/views/anime/list.php @@ -31,7 +31,6 @@ Rated Attributes Notes - Genres @@ -103,10 +102,6 @@

html($item['notes']) ?>

- - genres) ?> - genres) ?> - diff --git a/public/images/streaming-logos/amazon.svg b/public/images/streaming-logos/amazon.svg index 5e409515..776690f6 100644 --- a/public/images/streaming-logos/amazon.svg +++ b/public/images/streaming-logos/amazon.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/public/images/streaming-logos/vrv.svg b/public/images/streaming-logos/vrv.svg new file mode 100644 index 00000000..67686771 --- /dev/null +++ b/public/images/streaming-logos/vrv.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql index 6f47ed52..32141f5f 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql @@ -29,11 +29,6 @@ query ( id ageRating ageRatingGuide - categories(first: 100) { - nodes { - title - } - } mappings(first: 10) { nodes { externalId diff --git a/src/AnimeClient/Kitsu.php b/src/AnimeClient/Kitsu.php index c2f7d261..663a7be0 100644 --- a/src/AnimeClient/Kitsu.php +++ b/src/AnimeClient/Kitsu.php @@ -413,6 +413,11 @@ final class Kitsu { 'link' => TRUE, 'image' => 'streaming-logos/viewster.svg' ], + 'vrv.co' => [ + 'name' => 'VRV', + 'link' => TRUE, + 'image' => 'streaming-logos/vrv.svg', + ] ]; if (array_key_exists($hostname, $serviceMap)) From 249333b9fa95dd3ea104f870a470a22001b73223 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 9 Sep 2020 13:26:31 -0400 Subject: [PATCH 64/86] Remove genres from manga list view --- app/views/manga/list.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/views/manga/list.php b/app/views/manga/list.php index 02aa879d..ffcb53f7 100644 --- a/app/views/manga/list.php +++ b/app/views/manga/list.php @@ -25,7 +25,6 @@ # of Volumes Attributes Type - Genres @@ -70,9 +69,6 @@ - - - From fd2f3121bf0d13e8450ddd9b2bde0bf574317d39 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 10 Sep 2020 15:35:43 -0400 Subject: [PATCH 65/86] Fix possible issue with hiding completed anime/manga --- frontEndSrc/js/anime.js | 6 +++--- frontEndSrc/js/manga.js | 6 +++--- public/es/scripts.js | 12 ++++++------ public/images/streaming-logos/animelab.svg | 1 + public/js/scripts.min.js | 14 +++++++------- public/js/scripts.min.js.map | 2 +- 6 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 public/images/streaming-logos/animelab.svg diff --git a/frontEndSrc/js/anime.js b/frontEndSrc/js/anime.js index 85aad368..55672e5f 100644 --- a/frontEndSrc/js/anime.js +++ b/frontEndSrc/js/anime.js @@ -53,12 +53,12 @@ _.on('body.anime.list', 'click', '.plus-one', (e) => { // If the episode count is 0, and incremented, // change status to currently watching if (isNaN(watchedCount) || watchedCount === 0) { - data.data.status = 'current'; + data.data.status = 'CURRENT'; } // If you increment at the last episode, mark as completed if ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) { - data.data.status = 'completed'; + data.data.status = 'COMPLETED'; } _.show('#loading-shadow'); @@ -78,7 +78,7 @@ _.on('body.anime.list', 'click', '.plus-one', (e) => { return; } - if (resData.data.status === 'COMPLETED') { + if (String(resData.data.status).toUpperCase() === 'COMPLETED') { _.hide(parentSel); } diff --git a/frontEndSrc/js/manga.js b/frontEndSrc/js/manga.js index 54cbf51d..f46460fe 100644 --- a/frontEndSrc/js/manga.js +++ b/frontEndSrc/js/manga.js @@ -54,12 +54,12 @@ _.on('.manga.list', 'click', '.edit-buttons button', (e) => { // If the episode count is 0, and incremented, // change status to currently reading if (isNaN(completed) || completed === 0) { - data.data.status = 'current'; + data.data.status = 'CURRENT'; } // If you increment at the last chapter, mark as completed if ((!isNaN(completed)) && (completed + 1) === total) { - data.data.status = 'completed'; + data.data.status = 'COMPLETED'; } // Update the total count @@ -73,7 +73,7 @@ _.on('.manga.list', 'click', '.edit-buttons button', (e) => { type: 'POST', mimeType: 'application/json', success: () => { - if (data.data.status === 'completed') { + if (String(data.data.status).toUpperCase() === 'COMPLETED') { _.hide(parentSel); } diff --git a/public/es/scripts.js b/public/es/scripts.js index 2d2cbd5a..9e574ff0 100644 --- a/public/es/scripts.js +++ b/public/es/scripts.js @@ -637,12 +637,12 @@ AnimeClient.on('body.anime.list', 'click', '.plus-one', (e) => { // If the episode count is 0, and incremented, // change status to currently watching if (isNaN(watchedCount) || watchedCount === 0) { - data.data.status = 'current'; + data.data.status = 'CURRENT'; } // If you increment at the last episode, mark as completed if ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) { - data.data.status = 'completed'; + data.data.status = 'COMPLETED'; } AnimeClient.show('#loading-shadow'); @@ -662,7 +662,7 @@ AnimeClient.on('body.anime.list', 'click', '.plus-one', (e) => { return; } - if (resData.data.status === 'COMPLETED') { + if (String(resData.data.status).toUpperCase() === 'COMPLETED') { AnimeClient.hide(parentSel); } @@ -733,12 +733,12 @@ AnimeClient.on('.manga.list', 'click', '.edit-buttons button', (e) => { // If the episode count is 0, and incremented, // change status to currently reading if (isNaN(completed) || completed === 0) { - data.data.status = 'current'; + data.data.status = 'CURRENT'; } // If you increment at the last chapter, mark as completed if ((!isNaN(completed)) && (completed + 1) === total) { - data.data.status = 'completed'; + data.data.status = 'COMPLETED'; } // Update the total count @@ -752,7 +752,7 @@ AnimeClient.on('.manga.list', 'click', '.edit-buttons button', (e) => { type: 'POST', mimeType: 'application/json', success: () => { - if (data.data.status === 'completed') { + if (String(data.data.status).toUpperCase() === 'COMPLETED') { AnimeClient.hide(parentSel); } diff --git a/public/images/streaming-logos/animelab.svg b/public/images/streaming-logos/animelab.svg new file mode 100644 index 00000000..95af606f --- /dev/null +++ b/public/images/streaming-logos/animelab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/js/scripts.min.js b/public/js/scripts.min.js index d0f36ccc..073c592c 100644 --- a/public/js/scripts.min.js +++ b/public/js/scripts.min.js @@ -18,11 +18,11 @@ item.slug+'">Info Page\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults, status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search")){var prevRequest=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search(query)}))}AnimeClient.on("body.anime.list","click",".plus-one", -function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&& -watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success", -"Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader"); -AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target, -"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="current"; -if(!isNaN(completed)&&completed+1===total)data.data.status="completed";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(data.data.status==="completed")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed;AnimeClient.showMessage("success","Successfully updated "+ -mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() +function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="CURRENT";if(!isNaN(watchedCount)&& +watchedCount+1===totalCount)data.data.status="COMPLETED";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(String(resData.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow"); +AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults); +AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target; +var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)|| +completed===0)data.data.status="CURRENT";if(!isNaN(completed)&&completed+1===total)data.data.status="COMPLETED";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(String(data.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed; +AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() //# sourceMappingURL=scripts.min.js.map diff --git a/public/js/scripts.min.js.map b/public/js/scripts.min.js.map index 64720c50..6e417ecd 100644 --- a/public/js/scripts.min.js.map +++ b/public/js/scripts.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (data.data.status === 'completed') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,IAAV,CAAAA,OACX,IAAI,MAAOZ,SAAX,GAAwB,QAAxB,CACC,MAAOA,SAGRY,QAAA,CAAWA,OAAD,GAAa,IAAb,EAAqBA,OAAAC,SAArB,GAA0C,CAA1C,CACPD,OADO,CAEPR,QAEH,KAAIU,SAAW,EACf,IAAId,QAAAe,MAAA,CAAe,YAAf,CAAJ,CACCD,QAAAE,KAAA,CAAcZ,QAAAa,eAAA,CAAwBjB,QAAAkB,MAAA,CAAe,GAAf,CAAA,CAAoB,CAApB,CAAxB,CAAd,CADD;IAGCJ,SAAA,CAAW,EAAAK,MAAAC,MAAA,CAAeR,OAAAV,iBAAA,CAAyBF,QAAzB,CAAf,CAGZ,OAAOc,SAhBoB,EAwB5B,WAAAO,QAAW,CAACrB,QAAD,CAAW,CACrB,MAAOsB,YAAAX,EAAA,CAAcX,QAAd,CAAAQ,OAAP,CAAwC,CADnB,EAQtB,YAAAe,QA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AA,CAAkC,CAAlCA,CAAAA,YAAAA,CAAoDgE,SACpDhE,YAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA;AAAiDkE,SAAjDlE,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA,YAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CkE,SAA3ClE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file +{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (String(resData.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (String(data.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,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,SAA3ClE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file From 7584d0a9352b78634280d8622295786be631bcf3 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 10 Sep 2020 15:36:34 -0400 Subject: [PATCH 66/86] Map more external sites --- src/AnimeClient/Kitsu.php | 79 +++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/src/AnimeClient/Kitsu.php b/src/AnimeClient/Kitsu.php index 663a7be0..34922c87 100644 --- a/src/AnimeClient/Kitsu.php +++ b/src/AnimeClient/Kitsu.php @@ -94,33 +94,59 @@ final class Kitsu { public static function mappingsToUrls(array $mappings, string $kitsuLink = ''): array { $output = []; + + $urlMap = [ + 'ANIDB' => [ + 'key' => 'AniDB', + 'url' => 'https://anidb.net/anime/{}', + ], + 'ANILIST_ANIME' => [ + 'key' => 'Anilist', + 'url' => 'https://anilist.co/anime/{}/', + ], + 'ANILIST_MANGA' => [ + 'key' => 'Anilist', + 'url' => 'https://anilist.co/anime/{}/', + ], + 'ANIMENEWSNETWORK' => [ + 'key' => 'AnimeNewsNetwork', + 'url' => 'https://www.animenewsnetwork.com/encyclopedia/anime.php?id={}', + ], + 'MANGAUPDATES' => [ + 'key' => 'MangaUpdates', + 'url' => 'https://www.mangaupdates.com/series.html?id={}', + ], + 'MYANIMELIST_ANIME' => [ + 'key' => 'MyAnimeList', + 'url' => 'https://myanimelist.net/anime/{}', + ], + 'MYANIMELIST_CHARACTERS' => [ + 'key' => 'MyAnimeList', + 'url' => 'https://myanimelist.net/character/{}', + ], + 'MYANIMELIST_MANGA' => [ + 'key' => 'MyAnimeList', + 'url' => 'https://myanimelist.net/manga/{}', + ], + 'MYANIMELIST_PEOPLE' => [ + 'key' => 'MyAnimeList', + 'url' => 'https://myanimelist.net/people/{}', + ], + ]; + foreach ($mappings as $mapping) { - switch ($mapping['externalSite']) + if ( ! array_key_exists($mapping['externalSite'], $urlMap)) { - case 'ANIDB': - $output['AniDB'] = "https://anidb.net/anime/{$mapping['externalId']}"; - break; - - case 'ANILIST_ANIME': - $output['Anilist'] = "https://anilist.co/anime/{$mapping['externalId']}/"; - break; - - case 'ANILIST_MANGA': - $output['Anilist'] = "https://anilist.co/manga/{$mapping['externalId']}/"; - break; - - case 'MYANIMELIST_ANIME': - $output['MyAnimeList'] = "https://myanimelist.net/anime/{$mapping['externalId']}"; - break; - - case 'MYANIMELIST_MANGA': - $output['MyAnimeList'] = "https://myanimelist.net/manga/{$mapping['externalId']}"; - break; - - default: - // Do Nothing + continue; } + + $uMap = $urlMap[$mapping['externalSite']]; + $key = $uMap['key']; + $url = str_replace('{}', $mapping['externalId'], $uMap['url']); + + + $output[$key] = $url; } if ($kitsuLink !== '') @@ -365,7 +391,7 @@ final class Kitsu { /** * Get the name and logo for the streaming service of the current link * - * @param string $hostname + * @param string|null $hostname * @return array */ protected static function getServiceMetaData(string $hostname = NULL): array @@ -373,6 +399,11 @@ final class Kitsu { $hostname = str_replace('www.', '', $hostname); $serviceMap = [ + 'animelab.com' => [ + 'name' => 'Animelab', + 'link' => TRUE, + 'image' => 'streaming-logos/animelab.svg', + ], 'amazon.com' => [ 'name' => 'Amazon Prime', 'link' => TRUE, From 913f9082efcdc7fbb6e24a5c3ca3bd0ee09355a8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 15 Sep 2020 08:08:39 -0400 Subject: [PATCH 67/86] Update GraphQL queries to match API changes --- .../Kitsu/Mutations/CreateLibraryItem.graphql | 4 +- .../Kitsu/Mutations/UpdateLibraryItem.graphql | 2 +- .../API/Kitsu/Queries/GetLibrary.graphql | 4 +- .../API/Kitsu/Queries/GetLibraryCount.graphql | 2 +- src/AnimeClient/API/Kitsu/schema.graphql | 4117 +++++++++-------- 5 files changed, 2070 insertions(+), 2059 deletions(-) diff --git a/src/AnimeClient/API/Kitsu/Mutations/CreateLibraryItem.graphql b/src/AnimeClient/API/Kitsu/Mutations/CreateLibraryItem.graphql index 0aae7798..f8854259 100644 --- a/src/AnimeClient/API/Kitsu/Mutations/CreateLibraryItem.graphql +++ b/src/AnimeClient/API/Kitsu/Mutations/CreateLibraryItem.graphql @@ -4,8 +4,8 @@ mutation ( $userId: ID! $id: ID!, - $type: media_type!, - $status: LibraryEntryStatus!, + $type: MediaTypeEnum!, + $status: LibraryEntryStatusEnum!, ) { libraryEntry { create(input: { diff --git a/src/AnimeClient/API/Kitsu/Mutations/UpdateLibraryItem.graphql b/src/AnimeClient/API/Kitsu/Mutations/UpdateLibraryItem.graphql index 61f02f9c..286168be 100644 --- a/src/AnimeClient/API/Kitsu/Mutations/UpdateLibraryItem.graphql +++ b/src/AnimeClient/API/Kitsu/Mutations/UpdateLibraryItem.graphql @@ -6,7 +6,7 @@ mutation( $ratingTwenty: Int, $reconsumeCount: Int!, $reconsuming: Boolean, - $status: LibraryEntryStatus!, + $status: LibraryEntryStatusEnum!, ) { libraryEntry{ update(input: { diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql index 32141f5f..cf87b320 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql @@ -1,7 +1,7 @@ query ( $slug: String!, - $type: media_type!, - $status: [LibraryEntryStatus!], + $type: MediaTypeEnum!, + $status: [LibraryEntryStatusEnum!], $after: String ) { findProfileBySlug(slug: $slug) { diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql index b4de69b9..28dc53f9 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibraryCount.graphql @@ -1,4 +1,4 @@ -query ($slug: String!, $type: media_type!, $status: [LibraryEntryStatus!]) { +query ($slug: String!, $type: MediaTypeEnum!, $status: [LibraryEntryStatusEnum!]) { findProfileBySlug(slug: $slug) { library { all(first: 1, mediaType: $type, status: $status) { diff --git a/src/AnimeClient/API/Kitsu/schema.graphql b/src/AnimeClient/API/Kitsu/schema.graphql index 8a5ededa..da9bab43 100644 --- a/src/AnimeClient/API/Kitsu/schema.graphql +++ b/src/AnimeClient/API/Kitsu/schema.graphql @@ -1,2584 +1,2595 @@ # This file was generated based on ".graphqlconfig". Do not edit manually. schema { - query: Query - mutation: Mutation + query: Query + mutation: Mutation } "Generic Amount Consumed based on Media" interface AmountConsumed { - "Total media completed atleast once." - completed: Int! - id: ID! - "Total amount of media." - media: Int! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "Total progress of library including reconsuming." - units: Int! + "Total media completed atleast once." + completed: Int! + id: ID! + "Total amount of media." + media: Int! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "Total progress of library including reconsuming." + units: Int! } "Generic error fields used by all errors." interface Base { - "The error code." - code: String - "A description of the error" - message: String! - "Which input value this error came from" - path: [String!] + "The error code." + code: String + "A description of the error" + message: String! + "Which input value this error came from" + path: [String!] } "Generic Category Breakdown based on Media" interface CategoryBreakdown { - "A Map of category_id -> count for all categories present on the library entries" - categories: Map! - id: ID! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "The total amount of library entries." - total: Int! + "A Map of category_id -> count for all categories present on the library entries" + categories: Map! + id: ID! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "The total amount of library entries." + total: Int! } "An episodic media in the Kitsu database" interface Episodic { - "The number of episodes in this series" - episodeCount: Int - "The general length (in seconds) of each episode" - episodeLength: Int - "Episodes for this media" - episodes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - number: [Int!] - ): EpisodeConnection! - "The total length (in seconds) of the entire series" - totalLength: Int + "The number of episodes in this series" + episodeCount: Int + "The general length (in seconds) of each episode" + episodeLength: Int + "Episodes for this media" + episodes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + number: [Int!] + ): EpisodeConnection! + "The total length (in seconds) of the entire series" + totalLength: Int } "A media in the Kitsu database" interface Media { - "The recommended minimum age group for this media" - ageRating: AgeRating - "An explanation of why this received the age rating it did" - ageRatingGuide: String - "The average rating of this media amongst all Kitsu users" - averageRating: Float - "A large banner image for this media" - bannerImage: Image! - "A list of categories for this media" - categories( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection! - "The characters who starred in this media" - characters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection! - "A brief (mostly spoiler free) summary or description of the media." - description(locales: [String!]): Map! - "the day that this media made its final release" - endDate: Date - "The number of users with this in their favorites" - favoritesCount: Int - id: ID! - "A list of mappings for this media" - mappings( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MappingConnection! - "The time of the next release of this media" - nextRelease: ISO8601DateTime - "The poster image of this media" - posterImage: Image! - "The companies which helped to produce this media" - productions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaProductionConnection! - "A list of quotes from this media" - quotes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteConnection! - "A list of reactions for this media" - reactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "The season this was released in" - season: ReleaseSeason - "Whether the media is Safe-for-Work" - sfw: Boolean! - "The URL-friendly identifier of this media" - slug: String! - "The staff members who worked on this media" - staff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection! - "The day that this media first released" - startDate: Date - "The current releasing status of this media" - status: ReleaseStatus! - "Description of when this media is expected to release" - tba: String - "The titles for this media in various locales" - titles: TitlesList! - "Anime or Manga." - type: String! - "The number of users with this in their library" - userCount: Int + "The recommended minimum age group for this media" + ageRating: AgeRatingEnum + "An explanation of why this received the age rating it did" + ageRatingGuide: String + "The average rating of this media amongst all Kitsu users" + averageRating: Float + "A large banner image for this media" + bannerImage: Image! + "A list of categories for this media" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection! + "The characters who starred in this media" + characters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection! + "A brief (mostly spoiler free) summary or description of the media." + description(locales: [String!]): Map! + "the day that this media made its final release" + endDate: Date + "The number of users with this in their favorites" + favoritesCount: Int + id: ID! + "A list of mappings for this media" + mappings( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MappingConnection! + "The time of the next release of this media" + nextRelease: ISO8601DateTime + "The poster image of this media" + posterImage: Image! + "The companies which helped to produce this media" + productions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaProductionConnection! + "A list of quotes from this media" + quotes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteConnection! + "A list of reactions for this media" + reactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "The season this was released in" + season: ReleaseSeasonEnum + "Whether the media is Safe-for-Work" + sfw: Boolean! + "The URL-friendly identifier of this media" + slug: String! + "The staff members who worked on this media" + staff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection! + "The day that this media first released" + startDate: Date + "The current releasing status of this media" + status: ReleaseStatusEnum! + "Description of when this media is expected to release" + tba: String + "The titles for this media in various locales" + titles: TitlesList! + "Anime or Manga." + type: String! + "The number of users with this in their library" + userCount: Int } "Media that is streamable." interface Streamable { - "Spoken language is replaced by language of choice." - dubs: [String!]! - "Which regions this video is available in." - regions: [String!]! - "The site that is streaming this media." - streamer: Streamer! - "Languages this is translated to. Usually placed at bottom of media." - subs: [String!]! + "Spoken language is replaced by language of choice." + dubs: [String!]! + "Which regions this video is available in." + regions: [String!]! + "The site that is streaming this media." + streamer: Streamer! + "Languages this is translated to. Usually placed at bottom of media." + subs: [String!]! } "Media units such as episodes or chapters" interface Unit { - "A brief summary or description of the unit" - description(locales: [String!]): Map! - id: ID! - "The sequence number of this unit" - number: Int! - "A thumbnail image for the unit" - thumbnail: Image - "The titles for this unit in various locales" - titles: TitlesList! + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The sequence number of this unit" + number: Int! + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! } interface WithTimestamps { - createdAt: ISO8601DateTime! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + updatedAt: ISO8601DateTime! } "Objects which are Favoritable" -union FavoriteItem = Anime | Character | Manga | Person +union FavoriteItemUnion = Anime | Character | Manga | Person "Objects which are Mappable" -union MappingItem = Anime | Category | Character | Episode | Manga | Person | Producer +union MappingItemUnion = Anime | Category | Character | Episode | Manga | Person | Producer "A user account on Kitsu" type Account implements WithTimestamps { - "The country this user resides in" - country: String - createdAt: ISO8601DateTime! - "The email addresses associated with this account" - email: [String!]! - "Facebook account linked to the account" - facebookId: String - id: ID! - "Primary language for the account" - language: String - "Longest period an account has had a PRO subscription for in seconds" - maxProStreak: Int - "The PRO subscription for this account" - proSubscription: ProSubscription - "The profile for this account" - profile: Profile! - "Media rating system used for the account" - ratingSystem: RatingSystem! - "Whether Not Safe For Work content is accessible" - sfwFilter: Boolean - "Time zone of the account" - timeZone: String - "Preferred language for media titles" - titleLanguagePreference: TitleLanguagePreference - "Twitter account linked to the account" - twitterId: String - updatedAt: ISO8601DateTime! + "The country this user resides in" + country: String + createdAt: ISO8601DateTime! + "The email addresses associated with this account" + email: [String!]! + "Facebook account linked to the account" + facebookId: String + id: ID! + "Primary language for the account" + language: String + "Longest period an account has had a PRO subscription for in seconds" + maxProStreak: Int + "The PRO subscription for this account" + proSubscription: ProSubscription + "The profile for this account" + profile: Profile! + "Media rating system used for the account" + ratingSystem: RatingSystemEnum! + "Whether Not Safe For Work content is accessible" + sfwFilter: Boolean + "Time zone of the account" + timeZone: String + "Preferred language for media titles" + titleLanguagePreference: TitleLanguagePreferenceEnum + "Twitter account linked to the account" + twitterId: String + updatedAt: ISO8601DateTime! } type Anime implements Episodic & Media & WithTimestamps { - "The recommended minimum age group for this media" - ageRating: AgeRating - "An explanation of why this received the age rating it did" - ageRatingGuide: String - "The average rating of this media amongst all Kitsu users" - averageRating: Float - "A large banner image for this media" - bannerImage: Image! - "A list of categories for this media" - categories( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection! - "The characters who starred in this media" - characters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection! - createdAt: ISO8601DateTime! - "A brief (mostly spoiler free) summary or description of the media." - description(locales: [String!]): Map! - "the day that this media made its final release" - endDate: Date - "The number of episodes in this series" - episodeCount: Int - "The general length (in seconds) of each episode" - episodeLength: Int - "Episodes for this media" - episodes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - number: [Int!] - ): EpisodeConnection! - "The number of users with this in their favorites" - favoritesCount: Int - id: ID! - "A list of mappings for this media" - mappings( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MappingConnection! - "The time of the next release of this media" - nextRelease: ISO8601DateTime - "The poster image of this media" - posterImage: Image! - "The companies which helped to produce this media" - productions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaProductionConnection! - "A list of quotes from this media" - quotes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteConnection! - "A list of reactions for this media" - reactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "The season this was released in" - season: ReleaseSeason - "Whether the media is Safe-for-Work" - sfw: Boolean! - "The URL-friendly identifier of this media" - slug: String! - "The staff members who worked on this media" - staff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection! - "The day that this media first released" - startDate: Date - "The current releasing status of this media" - status: ReleaseStatus! - "The stream links." - streamingLinks( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): StreamingLinkConnection! - "A secondary type for categorizing Anime." - subtype: AnimeSubtype! - "Description of when this media is expected to release" - tba: String - "The titles for this media in various locales" - titles: TitlesList! - "The total length (in seconds) of the entire series" - totalLength: Int - "Anime or Manga." - type: String! - updatedAt: ISO8601DateTime! - "The number of users with this in their library" - userCount: Int - "Video id for a trailer on YouTube" - youtubeTrailerVideoId: String + "The recommended minimum age group for this media" + ageRating: AgeRatingEnum + "An explanation of why this received the age rating it did" + ageRatingGuide: String + "The average rating of this media amongst all Kitsu users" + averageRating: Float + "A large banner image for this media" + bannerImage: Image! + "A list of categories for this media" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection! + "The characters who starred in this media" + characters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection! + createdAt: ISO8601DateTime! + "A brief (mostly spoiler free) summary or description of the media." + description(locales: [String!]): Map! + "the day that this media made its final release" + endDate: Date + "The number of episodes in this series" + episodeCount: Int + "The general length (in seconds) of each episode" + episodeLength: Int + "Episodes for this media" + episodes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + number: [Int!] + ): EpisodeConnection! + "The number of users with this in their favorites" + favoritesCount: Int + id: ID! + "A list of mappings for this media" + mappings( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MappingConnection! + "The time of the next release of this media" + nextRelease: ISO8601DateTime + "The poster image of this media" + posterImage: Image! + "The companies which helped to produce this media" + productions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaProductionConnection! + "A list of quotes from this media" + quotes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteConnection! + "A list of reactions for this media" + reactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "The season this was released in" + season: ReleaseSeasonEnum + "Whether the media is Safe-for-Work" + sfw: Boolean! + "The URL-friendly identifier of this media" + slug: String! + "The staff members who worked on this media" + staff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection! + "The day that this media first released" + startDate: Date + "The current releasing status of this media" + status: ReleaseStatusEnum! + "The stream links." + streamingLinks( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): StreamingLinkConnection! + "A secondary type for categorizing Anime." + subtype: AnimeSubtypeEnum! + "Description of when this media is expected to release" + tba: String + "The titles for this media in various locales" + titles: TitlesList! + "The total length (in seconds) of the entire series" + totalLength: Int + "Anime or Manga." + type: String! + updatedAt: ISO8601DateTime! + "The number of users with this in their library" + userCount: Int + "Video id for a trailer on YouTube" + youtubeTrailerVideoId: String } type AnimeAmountConsumed implements AmountConsumed { - "Total media completed atleast once." - completed: Int! - id: ID! - "Total amount of media." - media: Int! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "Total time spent in minutes." - time: Int! - "Total progress of library including reconsuming." - units: Int! + "Total media completed atleast once." + completed: Int! + id: ID! + "Total amount of media." + media: Int! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "Total time spent in minutes." + time: Int! + "Total progress of library including reconsuming." + units: Int! } type AnimeCategoryBreakdown implements CategoryBreakdown { - "A Map of category_id -> count for all categories present on the library entries" - categories: Map! - id: ID! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "The total amount of library entries." - total: Int! + "A Map of category_id -> count for all categories present on the library entries" + categories: Map! + id: ID! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "The total amount of library entries." + total: Int! } "The connection type for Anime." type AnimeConnection { - "A list of edges." - edges: [AnimeEdge] - "A list of nodes." - nodes: [Anime] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [AnimeEdge] + "A list of nodes." + nodes: [Anime] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "Autogenerated return type of AnimeCreate" type AnimeCreatePayload { - anime: Anime - "Graphql Errors" - errors: [Generic!] + anime: Anime + "Graphql Errors" + errors: [Generic!] } "Autogenerated return type of AnimeDelete" type AnimeDeletePayload { - anime: GenericDelete - "Graphql Errors" - errors: [Generic!] + anime: GenericDelete + "Graphql Errors" + errors: [Generic!] } "An edge in a connection." type AnimeEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Anime + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Anime } type AnimeMutation { - "Create an Anime." - create( - "Create an Anime." - input: AnimeCreateInput! - ): AnimeCreatePayload - "Delete an Anime." - delete( - "Delete an Anime." - input: GenericDeleteInput! - ): AnimeDeletePayload - "Update an Anime." - update( - "Update an Anime." - input: AnimeUpdateInput! - ): AnimeUpdatePayload + "Create an Anime." + create( + "Create an Anime." + input: AnimeCreateInput! + ): AnimeCreatePayload + "Delete an Anime." + delete( + "Delete an Anime." + input: GenericDeleteInput! + ): AnimeDeletePayload + "Update an Anime." + update( + "Update an Anime." + input: AnimeUpdateInput! + ): AnimeUpdatePayload } "Autogenerated return type of AnimeUpdate" type AnimeUpdatePayload { - anime: Anime - "Graphql Errors" - errors: [Generic!] + anime: Anime + "Graphql Errors" + errors: [Generic!] } "Information about a specific Category" type Category implements WithTimestamps { - "The child categories." - children( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection - createdAt: ISO8601DateTime! - "A brief summary or description of the catgory." - description(locales: [String!]): Map! - id: ID! - "Whether the category is Not-Safe-for-Work." - isNsfw: Boolean! - "The parent category. Each category can have one parent." - parent: Category - "The URL-friendly identifier of this Category." - slug: String! - "The name of the category." - title(locales: [String!]): Map! - updatedAt: ISO8601DateTime! + "The child categories." + children( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection + createdAt: ISO8601DateTime! + "A brief summary or description of the catgory." + description(locales: [String!]): Map! + id: ID! + "Whether the category is Not-Safe-for-Work." + isNsfw: Boolean! + "The parent category. Each category can have one parent." + parent: Category + "The URL-friendly identifier of this Category." + slug: String! + "The name of the category." + title(locales: [String!]): Map! + updatedAt: ISO8601DateTime! } "The connection type for Category." type CategoryConnection { - "A list of edges." - edges: [CategoryEdge] - "A list of nodes." - nodes: [Category] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [CategoryEdge] + "A list of nodes." + nodes: [Category] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type CategoryEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Category + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Category } "A single chapter of a manga" type Chapter implements Unit & WithTimestamps { - createdAt: ISO8601DateTime! - "A brief summary or description of the unit" - description(locales: [String!]): Map! - id: ID! - "The manga this chapter is in." - manga: Manga! - "The sequence number of this unit" - number: Int! - "When this chapter was released" - releasedAt: ISO8601Date - "A thumbnail image for the unit" - thumbnail: Image - "The titles for this unit in various locales" - titles: TitlesList! - updatedAt: ISO8601DateTime! - "The volume this chapter is in." - volume: Volume + createdAt: ISO8601DateTime! + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The manga this chapter is in." + manga: Manga! + "The sequence number of this unit" + number: Int! + "When this chapter was released" + releasedAt: ISO8601Date + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! + updatedAt: ISO8601DateTime! + "The volume this chapter is in." + volume: Volume } "The connection type for Chapter." type ChapterConnection { - "A list of edges." - edges: [ChapterEdge] - "A list of nodes." - nodes: [Chapter] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [ChapterEdge] + "A list of nodes." + nodes: [Chapter] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type ChapterEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Chapter + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Chapter } "Information about a Character in the Kitsu database" type Character implements WithTimestamps { - createdAt: ISO8601DateTime! - "A brief summary or description of the character." - description(locales: [String!]): Map! - id: ID! - "An image of the character" - image: Image - "Media this character appears in." - media( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection - "The name for this character in various locales" - names: TitlesList - "The original media this character showed up in" - primaryMedia: Media - "The URL-friendly identifier of this character" - slug: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + "A brief summary or description of the character." + description(locales: [String!]): Map! + id: ID! + "An image of the character" + image: Image + "Media this character appears in." + media( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection + "The name for this character in various locales" + names: TitlesList + "The original media this character showed up in" + primaryMedia: Media + "The URL-friendly identifier of this character" + slug: String! + updatedAt: ISO8601DateTime! } "Information about a VA (Person) voicing a Character in a Media" type CharacterVoice implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The company who hired this voice actor to play this role" - licensor: Producer - "The BCP47 locale tag for the voice acting role" - locale: String! - "The MediaCharacter node" - mediaCharacter: MediaCharacter! - "The person who voice acted this role" - person: Person! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The company who hired this voice actor to play this role" + licensor: Producer + "The BCP47 locale tag for the voice acting role" + locale: String! + "The MediaCharacter node" + mediaCharacter: MediaCharacter! + "The person who voice acted this role" + person: Person! + updatedAt: ISO8601DateTime! } "The connection type for CharacterVoice." type CharacterVoiceConnection { - "A list of edges." - edges: [CharacterVoiceEdge] - "A list of nodes." - nodes: [CharacterVoice] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [CharacterVoiceEdge] + "A list of nodes." + nodes: [CharacterVoice] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type CharacterVoiceEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: CharacterVoice + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: CharacterVoice } "A comment on a post" type Comment implements WithTimestamps { - "The user who created this comment for the parent post." - author: Profile! - "Unmodified content." - content: String! - "Html formatted content." - contentFormatted: String! - createdAt: ISO8601DateTime! - id: ID! - "Users who liked this comment." - likes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "The parent comment if this comment was a reply to another." - parent: Comment - "The post that this comment is attached to." - post: Post! - "All replies to a specific comment." - replies( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CommentConnection! - updatedAt: ISO8601DateTime! + "The user who created this comment for the parent post." + author: Profile! + "Unmodified content." + content: String! + "Html formatted content." + contentFormatted: String! + createdAt: ISO8601DateTime! + id: ID! + "Users who liked this comment." + likes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "The parent comment if this comment was a reply to another." + parent: Comment + "The post that this comment is attached to." + post: Post! + "All replies to a specific comment." + replies( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CommentConnection! + updatedAt: ISO8601DateTime! } "The connection type for Comment." type CommentConnection { - "A list of edges." - edges: [CommentEdge] - "A list of nodes." - nodes: [Comment] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [CommentEdge] + "A list of nodes." + nodes: [Comment] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type CommentEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Comment + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Comment } "An Episode of a Media" type Episode implements Unit & WithTimestamps { - "The anime this episode is in" - anime: Anime! - createdAt: ISO8601DateTime! - "A brief summary or description of the unit" - description(locales: [String!]): Map! - id: ID! - "The length of the episode in seconds" - length: Int - "The sequence number of this unit" - number: Int! - "When this episode aired" - releasedAt: ISO8601DateTime - "A thumbnail image for the unit" - thumbnail: Image - "The titles for this unit in various locales" - titles: TitlesList! - updatedAt: ISO8601DateTime! + "The anime this episode is in" + anime: Anime! + createdAt: ISO8601DateTime! + "A brief summary or description of the unit" + description(locales: [String!]): Map! + id: ID! + "The length of the episode in seconds" + length: Int + "The sequence number of this unit" + number: Int! + "When this episode aired" + releasedAt: ISO8601DateTime + "A thumbnail image for the unit" + thumbnail: Image + "The titles for this unit in various locales" + titles: TitlesList! + updatedAt: ISO8601DateTime! } "The connection type for Episode." type EpisodeConnection { - "A list of edges." - edges: [EpisodeEdge] - "A list of nodes." - nodes: [Episode] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [EpisodeEdge] + "A list of nodes." + nodes: [Episode] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "Autogenerated return type of EpisodeCreate" type EpisodeCreatePayload { - episode: Episode - "Graphql Errors" - errors: [Generic!] + episode: Episode + "Graphql Errors" + errors: [Generic!] } "Autogenerated return type of EpisodeDelete" type EpisodeDeletePayload { - episode: GenericDelete - "Graphql Errors" - errors: [Generic!] + episode: GenericDelete + "Graphql Errors" + errors: [Generic!] } "An edge in a connection." type EpisodeEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Episode + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Episode } type EpisodeMutation { - "Create an Episode." - create( - "Create an Episode" - input: EpisodeCreateInput! - ): EpisodeCreatePayload - "Delete an Episode." - delete( - "Delete an Episode" - input: GenericDeleteInput! - ): EpisodeDeletePayload - "Update an Episode." - update( - "Update an Episode" - input: EpisodeUpdateInput! - ): EpisodeUpdatePayload + "Create an Episode." + create( + "Create an Episode" + input: EpisodeCreateInput! + ): EpisodeCreatePayload + "Delete an Episode." + delete( + "Delete an Episode" + input: GenericDeleteInput! + ): EpisodeDeletePayload + "Update an Episode." + update( + "Update an Episode" + input: EpisodeUpdateInput! + ): EpisodeUpdatePayload } "Autogenerated return type of EpisodeUpdate" type EpisodeUpdatePayload { - episode: Episode - "Graphql Errors" - errors: [Generic!] + episode: Episode + "Graphql Errors" + errors: [Generic!] } "Favorite media, characters, and people for a user" type Favorite implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The kitsu object that is mapped" - item: FavoriteItem! - updatedAt: ISO8601DateTime! - "The user who favorited this item" - user: Profile! + createdAt: ISO8601DateTime! + id: ID! + "The kitsu object that is mapped" + item: FavoriteItemUnion! + updatedAt: ISO8601DateTime! + "The user who favorited this item" + user: Profile! } "The connection type for Favorite." type FavoriteConnection { - "A list of edges." - edges: [FavoriteEdge] - "A list of nodes." - nodes: [Favorite] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [FavoriteEdge] + "A list of nodes." + nodes: [Favorite] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type FavoriteEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Favorite + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Favorite } type Generic implements Base { - "The error code." - code: String - "A description of the error" - message: String! - "Which input value this error came from" - path: [String!] + "The error code." + code: String + "A description of the error" + message: String! + "Which input value this error came from" + path: [String!] } type GenericDelete { - id: ID! + id: ID! } type Image { - "A blurhash-encoded version of this image" - blurhash: String - "The original image" - original: ImageView! - "The various generated views of this image" - views(names: [String!]): [ImageView!]! + "A blurhash-encoded version of this image" + blurhash: String + "The original image" + original: ImageView! + "The various generated views of this image" + views(names: [String!]): [ImageView!]! } type ImageView implements WithTimestamps { - createdAt: ISO8601DateTime! - "The height of the image" - height: Int - "The name of this view of the image" - name: String! - updatedAt: ISO8601DateTime! - "The URL of this view of the image" - url: String! - "The width of the image" - width: Int + createdAt: ISO8601DateTime! + "The height of the image" + height: Int + "The name of this view of the image" + name: String! + updatedAt: ISO8601DateTime! + "The URL of this view of the image" + url: String! + "The width of the image" + width: Int } "The user library filterable by media_type and status" type Library { - "All Library Entries for a specific Media" - all( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type!, - status: [LibraryEntryStatus!] - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the completed status" - completed( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the current status" - current( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the dropped status" - dropped( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the on_hold status" - onHold( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! - "Library Entries for a specific Media filtered by the planned status" - planned( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection! + "All Library Entries for a specific Media" + all( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum!, + status: [LibraryEntryStatusEnum!] + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the completed status" + completed( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the current status" + current( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the dropped status" + dropped( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the on_hold status" + onHold( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection! + "Library Entries for a specific Media filtered by the planned status" + planned( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection! } "Information about a specific media entry for a user" type LibraryEntry implements WithTimestamps { - createdAt: ISO8601DateTime! - "History of user actions for this library entry." - events( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaTypes: [media_type!] = [ANIME] - ): LibraryEventConnection - "When the user finished this media." - finishedAt: ISO8601DateTime - id: ID! - "The last unit consumed" - lastUnit: Unit - "The media related to this library entry." - media: Media! - "The next unit to be consumed" - nextUnit: Unit - "Notes left by the profile related to this library entry." - notes: String - "If the media related to the library entry is Not-Safe-for-Work." - nsfw: Boolean! - "If this library entry is publicly visibile from their profile, or hidden." - private: Boolean! - "The number of episodes/chapters this user has watched/read" - progress: Int! - "When the user last watched an episode or read a chapter of this media." - progressedAt: ISO8601DateTime - "How much you enjoyed this media (lower meaning not liking)." - rating: Int - "The reaction based on the media of this library entry." - reaction: MediaReaction - "Amount of times this media has been rewatched." - reconsumeCount: Int! - "If the profile is currently rewatching this media." - reconsuming: Boolean! - "When the user started this media." - startedAt: ISO8601DateTime - status: LibraryEntryStatus! - updatedAt: ISO8601DateTime! - "The user who created this library entry." - user: Profile! - "Volumes that the profile owns (physically or digital)." - volumesOwned: Int! + createdAt: ISO8601DateTime! + "History of user actions for this library entry." + events( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaTypes: [MediaTypeEnum!] = [ANIME] + ): LibraryEventConnection + "When the user finished this media." + finishedAt: ISO8601DateTime + id: ID! + "The last unit consumed" + lastUnit: Unit + "The media related to this library entry." + media: Media! + "The next unit to be consumed" + nextUnit: Unit + "Notes left by the profile related to this library entry." + notes: String + "If the media related to the library entry is Not-Safe-for-Work." + nsfw: Boolean! + "If this library entry is publicly visibile from their profile, or hidden." + private: Boolean! + "The number of episodes/chapters this user has watched/read" + progress: Int! + "When the user last watched an episode or read a chapter of this media." + progressedAt: ISO8601DateTime + "How much you enjoyed this media (lower meaning not liking)." + rating: Int + "The reaction based on the media of this library entry." + reaction: MediaReaction + "Amount of times this media has been rewatched." + reconsumeCount: Int! + "If the profile is currently rewatching this media." + reconsuming: Boolean! + "When the user started this media." + startedAt: ISO8601DateTime + status: LibraryEntryStatusEnum! + updatedAt: ISO8601DateTime! + "The user who created this library entry." + user: Profile! + "Volumes that the profile owns (physically or digital)." + volumesOwned: Int! } "The connection type for LibraryEntry." type LibraryEntryConnection { - "A list of edges." - edges: [LibraryEntryEdge] - "A list of nodes." - nodes: [LibraryEntry] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [LibraryEntryEdge] + "A list of nodes." + nodes: [LibraryEntry] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "Autogenerated return type of LibraryEntryCreate" type LibraryEntryCreatePayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryDelete" type LibraryEntryDeletePayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: GenericDelete + "Graphql Errors" + errors: [Generic!] + libraryEntry: GenericDelete } "An edge in a connection." type LibraryEntryEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: LibraryEntry + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: LibraryEntry } type LibraryEntryMutation { - "Create a library entry" - create( - "Create a Library Entry" - input: LibraryEntryCreateInput! - ): LibraryEntryCreatePayload - "Delete a library entry" - delete( - "Delete Library Entry" - input: GenericDeleteInput! - ): LibraryEntryDeletePayload - "Update a library entry" - update( - "Update Library Entry" - input: LibraryEntryUpdateInput! - ): LibraryEntryUpdatePayload - "Update library entry progress by id" - updateProgressById( - "Update library entry progress by id" - input: UpdateProgressByIdInput! - ): LibraryEntryUpdateProgressByIdPayload - "Update library entry progress by media" - updateProgressByMedia( - "Update library entry progress by media" - input: UpdateProgressByMediaInput! - ): LibraryEntryUpdateProgressByMediaPayload - "Update library entry rating by id" - updateRatingById( - "Update library entry rating by id" - input: UpdateRatingByIdInput! - ): LibraryEntryUpdateRatingByIdPayload - "Update library entry rating by media" - updateRatingByMedia( - "Update library entry rating by media" - input: UpdateRatingByMediaInput! - ): LibraryEntryUpdateRatingByMediaPayload - "Update library entry status by id" - updateStatusById( - "Update library entry status by id" - input: UpdateStatusByIdInput! - ): LibraryEntryUpdateStatusByIdPayload - "Update library entry status by media" - updateStatusByMedia( - "Update library entry status by media" - input: UpdateStatusByMediaInput! - ): LibraryEntryUpdateStatusByMediaPayload + "Create a library entry" + create( + "Create a Library Entry" + input: LibraryEntryCreateInput! + ): LibraryEntryCreatePayload + "Delete a library entry" + delete( + "Delete Library Entry" + input: GenericDeleteInput! + ): LibraryEntryDeletePayload + "Update a library entry" + update( + "Update Library Entry" + input: LibraryEntryUpdateInput! + ): LibraryEntryUpdatePayload + "Update library entry progress by id" + updateProgressById( + "Update library entry progress by id" + input: UpdateProgressByIdInput! + ): LibraryEntryUpdateProgressByIdPayload + "Update library entry progress by media" + updateProgressByMedia( + "Update library entry progress by media" + input: UpdateProgressByMediaInput! + ): LibraryEntryUpdateProgressByMediaPayload + "Update library entry rating by id" + updateRatingById( + "Update library entry rating by id" + input: UpdateRatingByIdInput! + ): LibraryEntryUpdateRatingByIdPayload + "Update library entry rating by media" + updateRatingByMedia( + "Update library entry rating by media" + input: UpdateRatingByMediaInput! + ): LibraryEntryUpdateRatingByMediaPayload + "Update library entry status by id" + updateStatusById( + "Update library entry status by id" + input: UpdateStatusByIdInput! + ): LibraryEntryUpdateStatusByIdPayload + "Update library entry status by media" + updateStatusByMedia( + "Update library entry status by media" + input: UpdateStatusByMediaInput! + ): LibraryEntryUpdateStatusByMediaPayload } "Autogenerated return type of LibraryEntryUpdate" type LibraryEntryUpdatePayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateProgressById" type LibraryEntryUpdateProgressByIdPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateProgressByMedia" type LibraryEntryUpdateProgressByMediaPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateRatingById" type LibraryEntryUpdateRatingByIdPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateRatingByMedia" type LibraryEntryUpdateRatingByMediaPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateStatusById" type LibraryEntryUpdateStatusByIdPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "Autogenerated return type of LibraryEntryUpdateStatusByMedia" type LibraryEntryUpdateStatusByMediaPayload { - "Graphql Errors" - errors: [Generic!] - libraryEntry: LibraryEntry + "Graphql Errors" + errors: [Generic!] + libraryEntry: LibraryEntry } "History of user actions for a library entry." type LibraryEvent implements WithTimestamps { - "The data that was changed for this library event." - changedData: Map! - createdAt: ISO8601DateTime! - id: ID! - "The type of library event." - kind: LibraryEventKind! - "The library entry related to this library event." - libraryEntry: LibraryEntry! - "The media related to this library event." - media: Media! - updatedAt: ISO8601DateTime! - "The user who created this library event" - user: Profile! + "The data that was changed for this library event." + changedData: Map! + createdAt: ISO8601DateTime! + id: ID! + "The type of library event." + kind: LibraryEventKindEnum! + "The library entry related to this library event." + libraryEntry: LibraryEntry! + "The media related to this library event." + media: Media! + updatedAt: ISO8601DateTime! + "The user who created this library event" + user: Profile! } "The connection type for LibraryEvent." type LibraryEventConnection { - "A list of edges." - edges: [LibraryEventEdge] - "A list of nodes." - nodes: [LibraryEvent] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [LibraryEventEdge] + "A list of nodes." + nodes: [LibraryEvent] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type LibraryEventEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: LibraryEvent + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: LibraryEvent } type Manga implements Media & WithTimestamps { - "The recommended minimum age group for this media" - ageRating: AgeRating - "An explanation of why this received the age rating it did" - ageRatingGuide: String - "The average rating of this media amongst all Kitsu users" - averageRating: Float - "A large banner image for this media" - bannerImage: Image! - "A list of categories for this media" - categories( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CategoryConnection! - "The number of chapters in this manga." - chapterCount: Int - "The estimated number of chapters in this manga." - chapterCountGuess: Int - "The chapters in the manga." - chapters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ChapterConnection - "The characters who starred in this media" - characters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaCharacterConnection! - createdAt: ISO8601DateTime! - "A brief (mostly spoiler free) summary or description of the media." - description(locales: [String!]): Map! - "the day that this media made its final release" - endDate: Date - "The number of users with this in their favorites" - favoritesCount: Int - id: ID! - "A list of mappings for this media" - mappings( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MappingConnection! - "The time of the next release of this media" - nextRelease: ISO8601DateTime - "The poster image of this media" - posterImage: Image! - "The companies which helped to produce this media" - productions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaProductionConnection! - "A list of quotes from this media" - quotes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteConnection! - "A list of reactions for this media" - reactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "The season this was released in" - season: ReleaseSeason - "Whether the media is Safe-for-Work" - sfw: Boolean! - "The URL-friendly identifier of this media" - slug: String! - "The staff members who worked on this media" - staff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection! - "The day that this media first released" - startDate: Date - "The current releasing status of this media" - status: ReleaseStatus! - "A secondary type for categorizing Manga." - subtype: MangaSubtype! - "Description of when this media is expected to release" - tba: String - "The titles for this media in various locales" - titles: TitlesList! - "Anime or Manga." - type: String! - updatedAt: ISO8601DateTime! - "The number of users with this in their library" - userCount: Int - "The number of volumes in this manga." - volumeCount: Int + "The recommended minimum age group for this media" + ageRating: AgeRatingEnum + "An explanation of why this received the age rating it did" + ageRatingGuide: String + "The average rating of this media amongst all Kitsu users" + averageRating: Float + "A large banner image for this media" + bannerImage: Image! + "A list of categories for this media" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection! + "The number of chapters in this manga." + chapterCount: Int + "The estimated number of chapters in this manga." + chapterCountGuess: Int + "The chapters in the manga." + chapters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ChapterConnection + "The characters who starred in this media" + characters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaCharacterConnection! + createdAt: ISO8601DateTime! + "A brief (mostly spoiler free) summary or description of the media." + description(locales: [String!]): Map! + "the day that this media made its final release" + endDate: Date + "The number of users with this in their favorites" + favoritesCount: Int + id: ID! + "A list of mappings for this media" + mappings( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MappingConnection! + "The time of the next release of this media" + nextRelease: ISO8601DateTime + "The poster image of this media" + posterImage: Image! + "The companies which helped to produce this media" + productions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaProductionConnection! + "A list of quotes from this media" + quotes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteConnection! + "A list of reactions for this media" + reactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "The season this was released in" + season: ReleaseSeasonEnum + "Whether the media is Safe-for-Work" + sfw: Boolean! + "The URL-friendly identifier of this media" + slug: String! + "The staff members who worked on this media" + staff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection! + "The day that this media first released" + startDate: Date + "The current releasing status of this media" + status: ReleaseStatusEnum! + "A secondary type for categorizing Manga." + subtype: MangaSubtypeEnum! + "Description of when this media is expected to release" + tba: String + "The titles for this media in various locales" + titles: TitlesList! + "Anime or Manga." + type: String! + updatedAt: ISO8601DateTime! + "The number of users with this in their library" + userCount: Int + "The number of volumes in this manga." + volumeCount: Int } type MangaAmountConsumed implements AmountConsumed { - "Total media completed atleast once." - completed: Int! - id: ID! - "Total amount of media." - media: Int! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "Total progress of library including reconsuming." - units: Int! + "Total media completed atleast once." + completed: Int! + id: ID! + "Total amount of media." + media: Int! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "Total progress of library including reconsuming." + units: Int! } type MangaCategoryBreakdown implements CategoryBreakdown { - "A Map of category_id -> count for all categories present on the library entries" - categories: Map! - id: ID! - "The profile related to the user for this stat." - profile: Profile! - "Last time we fully recalculated this stat." - recalculatedAt: ISO8601Date! - "The total amount of library entries." - total: Int! + "A Map of category_id -> count for all categories present on the library entries" + categories: Map! + id: ID! + "The profile related to the user for this stat." + profile: Profile! + "Last time we fully recalculated this stat." + recalculatedAt: ISO8601Date! + "The total amount of library entries." + total: Int! } "The connection type for Manga." type MangaConnection { - "A list of edges." - edges: [MangaEdge] - "A list of nodes." - nodes: [Manga] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MangaEdge] + "A list of nodes." + nodes: [Manga] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MangaEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Manga + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Manga } "Media Mappings from External Sites (MAL, Anilist, etc..) to Kitsu." type Mapping implements WithTimestamps { - createdAt: ISO8601DateTime! - "The ID of the media from the external site." - externalId: ID! - "The name of the site which kitsu media is being linked from." - externalSite: MappingExternalSite! - id: ID! - "The kitsu object that is mapped." - item: MappingItem! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + "The ID of the media from the external site." + externalId: ID! + "The name of the site which kitsu media is being linked from." + externalSite: MappingExternalSiteEnum! + id: ID! + "The kitsu object that is mapped." + item: MappingItemUnion! + updatedAt: ISO8601DateTime! } "The connection type for Mapping." type MappingConnection { - "A list of edges." - edges: [MappingEdge] - "A list of nodes." - nodes: [Mapping] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MappingEdge] + "A list of nodes." + nodes: [Mapping] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MappingEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Mapping + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Mapping } "Information about a Character starring in a Media" type MediaCharacter implements WithTimestamps { - "The character" - character: Character! - createdAt: ISO8601DateTime! - id: ID! - "The media" - media: Media! - "The role this character had in the media" - role: CharacterRole! - updatedAt: ISO8601DateTime! - "The voices of this character" - voices( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - locale: [String!] - ): CharacterVoiceConnection + "The character" + character: Character! + createdAt: ISO8601DateTime! + id: ID! + "The media" + media: Media! + "The role this character had in the media" + role: CharacterRoleEnum! + updatedAt: ISO8601DateTime! + "The voices of this character" + voices( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + locale: [String!] + ): CharacterVoiceConnection } "The connection type for MediaCharacter." type MediaCharacterConnection { - "A list of edges." - edges: [MediaCharacterEdge] - "A list of nodes." - nodes: [MediaCharacter] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaCharacterEdge] + "A list of nodes." + nodes: [MediaCharacter] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaCharacterEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaCharacter + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaCharacter } "The connection type for Media." type MediaConnection { - "A list of edges." - edges: [MediaEdge] - "A list of nodes." - nodes: [Media] - "Information to aid in pagination." - pageInfo: PageInfo! + "A list of edges." + edges: [MediaEdge] + "A list of nodes." + nodes: [Media] + "Information to aid in pagination." + pageInfo: PageInfo! } "An edge in a connection." type MediaEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Media + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Media } "The role a company played in the creation or localization of a media" type MediaProduction implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The media" - media: Media! - "The producer" - person: Producer! - "The role this company played" - role: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The media" + media: Media! + "The producer" + person: Producer! + "The role this company played" + role: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaProduction." type MediaProductionConnection { - "A list of edges." - edges: [MediaProductionEdge] - "A list of nodes." - nodes: [MediaProduction] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaProductionEdge] + "A list of nodes." + nodes: [MediaProduction] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaProductionEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaProduction + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaProduction } "A simple review that is 140 characters long expressing how you felt about a media" type MediaReaction implements WithTimestamps { - "The author who wrote this reaction." - author: Profile! - createdAt: ISO8601DateTime! - id: ID! - "The library entry related to this reaction." - libraryEntry: LibraryEntry! - "Users who liked this reaction." - likes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "The media related to this reaction." - media: Media! - "When this media reaction was written based on media progress." - progress: Int! - "The reaction text related to a media." - reaction: String! - updatedAt: ISO8601DateTime! + "The author who wrote this reaction." + author: Profile! + createdAt: ISO8601DateTime! + id: ID! + "The library entry related to this reaction." + libraryEntry: LibraryEntry! + "Users who liked this reaction." + likes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "The media related to this reaction." + media: Media! + "When this media reaction was written based on media progress." + progress: Int! + "The reaction text related to a media." + reaction: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaReaction." type MediaReactionConnection { - "A list of edges." - edges: [MediaReactionEdge] - "A list of nodes." - nodes: [MediaReaction] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaReactionEdge] + "A list of nodes." + nodes: [MediaReaction] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaReactionEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaReaction + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaReaction } "Information about a person working on an anime" type MediaStaff implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The media" - media: Media! - "The person" - person: Person! - "The role this person had in the creation of this media" - role: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The media" + media: Media! + "The person" + person: Person! + "The role this person had in the creation of this media" + role: String! + updatedAt: ISO8601DateTime! } "The connection type for MediaStaff." type MediaStaffConnection { - "A list of edges." - edges: [MediaStaffEdge] - "A list of nodes." - nodes: [MediaStaff] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [MediaStaffEdge] + "A list of nodes." + nodes: [MediaStaff] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type MediaStaffEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: MediaStaff + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: MediaStaff } type Mutation { - anime: AnimeMutation - episode: EpisodeMutation - libraryEntry: LibraryEntryMutation - pro: ProMutation! + anime: AnimeMutation + episode: EpisodeMutation + libraryEntry: LibraryEntryMutation + pro: ProMutation! } "Information about pagination in a connection." type PageInfo { - "When paginating forwards, the cursor to continue." - endCursor: String - "When paginating forwards, are there more items?" - hasNextPage: Boolean! - "When paginating backwards, are there more items?" - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String + "When paginating forwards, are there more items?" + hasNextPage: Boolean! + "When paginating backwards, are there more items?" + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String } "A Voice Actor, Director, Animator, or other person who works in the creation and localization of media" type Person implements WithTimestamps { - "The day when this person was born" - birthday: Date - createdAt: ISO8601DateTime! - "A brief biography or description of the person." - description(locales: [String!]): Map! - id: ID! - "An image of the person" - image: Image - "Information about the person working on specific media" - mediaStaff( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaStaffConnection - "The primary name of this person." - name: String! - "The name of this person in various languages" - names: TitlesList! - "The URL-friendly identifier of this person." - slug: String! - updatedAt: ISO8601DateTime! - "The voice-acting roles this person has had." - voices( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CharacterVoiceConnection + "The day when this person was born" + birthday: Date + createdAt: ISO8601DateTime! + "A brief biography or description of the person." + description(locales: [String!]): Map! + id: ID! + "An image of the person" + image: Image + "Information about the person working on specific media" + mediaStaff( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaStaffConnection + "The primary name of this person." + name: String! + "The name of this person in various languages" + names: TitlesList! + "The URL-friendly identifier of this person." + slug: String! + updatedAt: ISO8601DateTime! + "The voice-acting roles this person has had." + voices( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CharacterVoiceConnection } "A post that is visible to your followers and globally in the news-feed." type Post implements WithTimestamps { - "The user who created this post." - author: Profile! - "All comments related to this post." - comments( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CommentConnection! - "Unmodified content." - content: String! - "Html formatted content." - contentFormatted: String! - createdAt: ISO8601DateTime! - "Users that are watching this post" - follows( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - id: ID! - "If a post is Not-Safe-for-Work." - isNsfw: Boolean! - "If this post spoils the tagged media." - isSpoiler: Boolean! - "Users that have liked this post." - likes( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "The media tagged in this post." - media: Media - updatedAt: ISO8601DateTime! + "The user who created this post." + author: Profile! + "All comments related to this post." + comments( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CommentConnection! + "Unmodified content." + content: String! + "Html formatted content." + contentFormatted: String! + createdAt: ISO8601DateTime! + "Users that are watching this post" + follows( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + id: ID! + "If a post is Not-Safe-for-Work." + isNsfw: Boolean! + "If this post spoils the tagged media." + isSpoiler: Boolean! + "Users that have liked this post." + likes( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "The media tagged in this post." + media: Media + updatedAt: ISO8601DateTime! } "The connection type for Post." type PostConnection { - "A list of edges." - edges: [PostEdge] - "A list of nodes." - nodes: [Post] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [PostEdge] + "A list of nodes." + nodes: [Post] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type PostEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Post + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Post } type ProMutation { - "Set the user's discord tag" - setDiscord( - "Your discord tag (Name#1234)" - discord: String! - ): SetDiscordPayload - "Set the user's Hall-of-Fame message" - setMessage( - "The message to set for your Hall of Fame entry" - message: String! - ): SetMessagePayload - "End the user's pro subscription" - unsubscribe: UnsubscribePayload + "Set the user's discord tag" + setDiscord( + "Your discord tag (Name#1234)" + discord: String! + ): SetDiscordPayload + "Set the user's Hall-of-Fame message" + setMessage( + "The message to set for your Hall of Fame entry" + message: String! + ): SetMessagePayload + "End the user's pro subscription" + unsubscribe: UnsubscribePayload } "A subscription to Kitsu PRO" type ProSubscription implements WithTimestamps { - "The account which is subscribed to Pro benefits" - account: Account! - "The billing service used for this subscription" - billingService: RecurringBillingService! - createdAt: ISO8601DateTime! - "The tier of Pro the account is subscribed to" - tier: ProTier! - updatedAt: ISO8601DateTime! + "The account which is subscribed to Pro benefits" + account: Account! + "The billing service used for this subscription" + billingService: RecurringBillingServiceEnum! + createdAt: ISO8601DateTime! + "The tier of Pro the account is subscribed to" + tier: ProTierEnum! + updatedAt: ISO8601DateTime! } "A company involved in the creation or localization of media" type Producer implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The name of this production company" - name: String! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The name of this production company" + name: String! + updatedAt: ISO8601DateTime! } "A user profile on Kitsu" type Profile implements WithTimestamps { - "A short biographical blurb about this profile" - about: String - "An avatar image to easily identify this profile" - avatarImage: Image - "A banner to display at the top of the profile" - bannerImage: Image - "When the user was born" - birthday: ISO8601Date - "All comments to any post this user has made." - comments( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): CommentConnection! - createdAt: ISO8601DateTime! - "Favorite media, characters, and people" - favorites( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): FavoriteConnection! - "People that follow the user" - followers( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "People the user is following" - following( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "What the user identifies as" - gender: String - id: ID! - "The user library of their media" - library: Library! - "A list of library events for this user" - libraryEvents( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - kind: [LibraryEventKind!], - "Returns the last _n_ elements from the list." - last: Int - ): LibraryEventConnection! - "The user's general location" - location: String - "Media reactions written by this user." - mediaReactions( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MediaReactionConnection! - "A non-unique publicly visible name for the profile. Minimum of 3 characters and any valid Unicode character" - name: String! - "Post pinned to the user profile" - pinnedPost: Post - "All posts this profile has made." - posts( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): PostConnection! - "The message this user has submitted to the Hall of Fame" - proMessage: String - "The PRO level the user currently has" - proTier: ProTier - "Links to the user on other (social media) sites." - siteLinks( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): SiteLinkConnection - "The URL-friendly identifier for this profile" - slug: String - "The different stats we calculate for this user." - stats: ProfileStats! - updatedAt: ISO8601DateTime! - "A fully qualified URL to the profile" - url: String - "The character this profile has declared as their waifu or husbando" - waifu: Character - "The properly-gendered term for the user's waifu. This should normally only be 'Waifu' or 'Husbando' but some people are jerks, including the person who wrote this..." - waifuOrHusbando: String + "A short biographical blurb about this profile" + about: String + "An avatar image to easily identify this profile" + avatarImage: Image + "A banner to display at the top of the profile" + bannerImage: Image + "When the user was born" + birthday: ISO8601Date + "All comments to any post this user has made." + comments( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CommentConnection! + createdAt: ISO8601DateTime! + "Favorite media, characters, and people" + favorites( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): FavoriteConnection! + "People that follow the user" + followers( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "People the user is following" + following( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "What the user identifies as" + gender: String + id: ID! + "The user library of their media" + library: Library! + "A list of library events for this user" + libraryEvents( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + kind: [LibraryEventKindEnum!], + "Returns the last _n_ elements from the list." + last: Int + ): LibraryEventConnection! + "The user's general location" + location: String + "Media reactions written by this user." + mediaReactions( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MediaReactionConnection! + "A non-unique publicly visible name for the profile. Minimum of 3 characters and any valid Unicode character" + name: String! + "Post pinned to the user profile" + pinnedPost: Post + "All posts this profile has made." + posts( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): PostConnection! + "The message this user has submitted to the Hall of Fame" + proMessage: String + "The PRO level the user currently has" + proTier: ProTierEnum + "Links to the user on other (social media) sites." + siteLinks( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): SiteLinkConnection + "The URL-friendly identifier for this profile" + slug: String + "The different stats we calculate for this user." + stats: ProfileStats! + updatedAt: ISO8601DateTime! + "A fully qualified URL to the profile" + url: String + "The character this profile has declared as their waifu or husbando" + waifu: Character + "The properly-gendered term for the user's waifu. This should normally only be 'Waifu' or 'Husbando' but some people are jerks, including the person who wrote this..." + waifuOrHusbando: String } "The connection type for Profile." type ProfileConnection { - "A list of edges." - edges: [ProfileEdge] - "A list of nodes." - nodes: [Profile] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [ProfileEdge] + "A list of nodes." + nodes: [Profile] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type ProfileEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Profile + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Profile } "The different types of user stats that we calculate." type ProfileStats { - "The total amount of anime you have watched over your whole life." - animeAmountConsumed: AnimeAmountConsumed! - "The breakdown of the different categories related to the anime you have completed" - animeCategoryBreakdown: AnimeCategoryBreakdown! - "The total amount of manga you ahve read over your whole life." - mangaAmountConsumed: MangaAmountConsumed! - "The breakdown of the different categories related to the manga you have completed" - mangaCategoryBreakdown: MangaCategoryBreakdown! + "The total amount of anime you have watched over your whole life." + animeAmountConsumed: AnimeAmountConsumed! + "The breakdown of the different categories related to the anime you have completed" + animeCategoryBreakdown: AnimeCategoryBreakdown! + "The total amount of manga you ahve read over your whole life." + mangaAmountConsumed: MangaAmountConsumed! + "The breakdown of the different categories related to the manga you have completed" + mangaCategoryBreakdown: MangaCategoryBreakdown! } type Query { - "All Anime in the Kitsu database" - anime( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): AnimeConnection! - "All Anime with specific Status" - animeByStatus( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - status: ReleaseStatus! - ): AnimeConnection - "Kitsu account details. You must supply an Authorization token in header." - currentAccount: Account - "Find a single Anime by ID" - findAnimeById(id: ID!): Anime - "Find a single Anime by Slug" - findAnimeBySlug(slug: String!): Anime - "Find a single Category by ID" - findCategoryById(id: ID!): Category - "Find a single Category by Slug" - findCategoryBySlug(slug: String!): Category - "Find a single Character by ID" - findCharacterById(id: ID!): Character - "Find a single Character by Slug" - findCharacterBySlug(slug: String!): Character - "Find a single Library Entry by ID" - findLibraryEntryById(id: ID!): LibraryEntry - "Find a single Library Event by ID" - findLibraryEventById(id: ID!): LibraryEvent - "Find a single Manga by ID" - findMangaById(id: ID!): Manga - "Find a single Manga by Slug" - findMangaBySlug(slug: String!): Manga - "Find a single Person by ID" - findPersonById(id: ID!): Person - "Find a single Person by Slug" - findPersonBySlug(slug: String!): Person - "Find a single User by ID" - findProfileById(id: ID!): Profile - "Find a single User by Slug" - findProfileBySlug(slug: String!): Profile - "List trending media on Kitsu" - globalTrending( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - medium: String! - ): MediaConnection! - "List of Library Entries by MediaType and MediaId" - libraryEntriesByMedia( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaId: ID!, - mediaType: media_type! - ): LibraryEntryConnection - "List of Library Entries by MediaType" - libraryEntriesByMediaType( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - mediaType: media_type! - ): LibraryEntryConnection - "List trending media within your network" - localTrending( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - medium: String! - ): MediaConnection! - "Find a specific Mapping Item by External ID and External Site." - lookupMapping(externalId: ID!, externalSite: MappingExternalSite!): MappingItem - "All Manga in the Kitsu database" - manga( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): MangaConnection! - "All Manga with specific Status" - mangaByStatus( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int, - status: ReleaseStatus! - ): MangaConnection - "Patrons sorted by a Proprietary Magic Algorithm" - patrons( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ProfileConnection! - "Get your current session info" - session: Session! + "All Anime in the Kitsu database" + anime( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): AnimeConnection! + "All Anime with specific Status" + animeByStatus( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + status: ReleaseStatusEnum! + ): AnimeConnection + "All Categories in the Kitsu Database" + categories( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): CategoryConnection + "Kitsu account details. You must supply an Authorization token in header." + currentAccount: Account + "Find a single Anime by ID" + findAnimeById(id: ID!): Anime + "Find a single Anime by Slug" + findAnimeBySlug(slug: String!): Anime + "Find a single Category by ID" + findCategoryById(id: ID!): Category + "Find a single Category by Slug" + findCategoryBySlug(slug: String!): Category + "Find a single Character by ID" + findCharacterById(id: ID!): Character + "Find a single Character by Slug" + findCharacterBySlug(slug: String!): Character + "Find a single Library Entry by ID" + findLibraryEntryById(id: ID!): LibraryEntry + "Find a single Library Event by ID" + findLibraryEventById(id: ID!): LibraryEvent + "Find a single Manga by ID" + findMangaById(id: ID!): Manga + "Find a single Manga by Slug" + findMangaBySlug(slug: String!): Manga + "Find a single Person by ID" + findPersonById(id: ID!): Person + "Find a single Person by Slug" + findPersonBySlug(slug: String!): Person + "Find a single User by ID" + findProfileById(id: ID!): Profile + "Find a single User by Slug" + findProfileBySlug(slug: String!): Profile + "List trending media on Kitsu" + globalTrending( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + medium: String! + ): MediaConnection! + "List of Library Entries by MediaType and MediaId" + libraryEntriesByMedia( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaId: ID!, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection + "List of Library Entries by MediaType" + libraryEntriesByMediaType( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + mediaType: MediaTypeEnum! + ): LibraryEntryConnection + "List trending media within your network" + localTrending( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + medium: String! + ): MediaConnection! + "Find a specific Mapping Item by External ID and External Site." + lookupMapping(externalId: ID!, externalSite: MappingExternalSiteEnum!): MappingItemUnion + "All Manga in the Kitsu database" + manga( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): MangaConnection! + "All Manga with specific Status" + mangaByStatus( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + status: ReleaseStatusEnum! + ): MangaConnection + "Patrons sorted by a Proprietary Magic Algorithm" + patrons( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ProfileConnection! + "Get your current session info" + session: Session! } "A quote from a media" type Quote implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The lines of the quote" - lines( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): QuoteLineConnection! - "The media this quote is excerpted from" - media: Media! - updatedAt: ISO8601DateTime! + createdAt: ISO8601DateTime! + id: ID! + "The lines of the quote" + lines( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): QuoteLineConnection! + "The media this quote is excerpted from" + media: Media! + updatedAt: ISO8601DateTime! } "The connection type for Quote." type QuoteConnection { - "A list of edges." - edges: [QuoteEdge] - "A list of nodes." - nodes: [Quote] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [QuoteEdge] + "A list of nodes." + nodes: [Quote] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type QuoteEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Quote + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Quote } "A line in a quote" type QuoteLine implements WithTimestamps { - "The character who said this line" - character: Character! - "The line that was spoken" - content: String! - createdAt: ISO8601DateTime! - id: ID! - "The quote this line is in" - quote: Quote! - updatedAt: ISO8601DateTime! + "The character who said this line" + character: Character! + "The line that was spoken" + content: String! + createdAt: ISO8601DateTime! + id: ID! + "The quote this line is in" + quote: Quote! + updatedAt: ISO8601DateTime! } "The connection type for QuoteLine." type QuoteLineConnection { - "A list of edges." - edges: [QuoteLineEdge] - "A list of nodes." - nodes: [QuoteLine] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [QuoteLineEdge] + "A list of nodes." + nodes: [QuoteLine] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type QuoteLineEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: QuoteLine + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: QuoteLine } "Information about a user session" type Session { - "The account associated with this session" - account: Account - "The profile associated with this session" - profile: Profile + "The account associated with this session" + account: Account + "The profile associated with this session" + profile: Profile } "Autogenerated return type of SetDiscord" type SetDiscordPayload { - discord: String! - "Graphql Errors" - errors: [Generic!] + discord: String! + "Graphql Errors" + errors: [Generic!] } "Autogenerated return type of SetMessage" type SetMessagePayload { - "Graphql Errors" - errors: [Generic!] - message: String! + "Graphql Errors" + errors: [Generic!] + message: String! } "A link to a user's profile on an external site." type SiteLink implements WithTimestamps { - "The user profile the site is linked to." - author: Profile! - createdAt: ISO8601DateTime! - id: ID! - updatedAt: ISO8601DateTime! - "A fully qualified URL of the user profile on an external site." - url: String! + "The user profile the site is linked to." + author: Profile! + createdAt: ISO8601DateTime! + id: ID! + updatedAt: ISO8601DateTime! + "A fully qualified URL of the user profile on an external site." + url: String! } "The connection type for SiteLink." type SiteLinkConnection { - "A list of edges." - edges: [SiteLinkEdge] - "A list of nodes." - nodes: [SiteLink] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [SiteLinkEdge] + "A list of nodes." + nodes: [SiteLink] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type SiteLinkEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: SiteLink + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: SiteLink } "The streaming company." type Streamer implements WithTimestamps { - createdAt: ISO8601DateTime! - id: ID! - "The name of the site that is streaming this media." - siteName: String! - "Additional media this site is streaming." - streamingLinks( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): StreamingLinkConnection! - updatedAt: ISO8601DateTime! - "Videos of the media being streamed." - videos( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): VideoConnection! + createdAt: ISO8601DateTime! + id: ID! + "The name of the site that is streaming this media." + siteName: String! + "Additional media this site is streaming." + streamingLinks( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): StreamingLinkConnection! + updatedAt: ISO8601DateTime! + "Videos of the media being streamed." + videos( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): VideoConnection! } "The stream link." type StreamingLink implements Streamable & WithTimestamps { - createdAt: ISO8601DateTime! - "Spoken language is replaced by language of choice." - dubs: [String!]! - id: ID! - "The media being streamed" - media: Media! - "Which regions this video is available in." - regions: [String!]! - "The site that is streaming this media." - streamer: Streamer! - "Languages this is translated to. Usually placed at bottom of media." - subs: [String!]! - updatedAt: ISO8601DateTime! - "Fully qualified URL for the streaming link." - url: String! + createdAt: ISO8601DateTime! + "Spoken language is replaced by language of choice." + dubs: [String!]! + id: ID! + "The media being streamed" + media: Media! + "Which regions this video is available in." + regions: [String!]! + "The site that is streaming this media." + streamer: Streamer! + "Languages this is translated to. Usually placed at bottom of media." + subs: [String!]! + updatedAt: ISO8601DateTime! + "Fully qualified URL for the streaming link." + url: String! } "The connection type for StreamingLink." type StreamingLinkConnection { - "A list of edges." - edges: [StreamingLinkEdge] - "A list of nodes." - nodes: [StreamingLink] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [StreamingLinkEdge] + "A list of nodes." + nodes: [StreamingLink] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type StreamingLinkEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: StreamingLink + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: StreamingLink } type TitlesList { - "A list of additional, alternative, abbreviated, or unofficial titles" - alternatives: [String!] - "The official or de facto international title" - canonical: String - "The locale code that identifies which title is used as the canonical title" - canonicalLocale: String - "The list of localized titles keyed by locale" - localized(locales: [String!]): Map! + "A list of additional, alternative, abbreviated, or unofficial titles" + alternatives: [String!] + "The official or de facto international title" + canonical: String + "The locale code that identifies which title is used as the canonical title" + canonicalLocale: String + "The list of localized titles keyed by locale" + localized(locales: [String!]): Map! } "Autogenerated return type of Unsubscribe" type UnsubscribePayload { - "Graphql Errors" - errors: [Generic!] - expiresAt: ISO8601DateTime + "Graphql Errors" + errors: [Generic!] + expiresAt: ISO8601DateTime } "The media video." type Video implements Streamable & WithTimestamps { - createdAt: ISO8601DateTime! - "Spoken language is replaced by language of choice." - dubs: [String!]! - "The episode of this video" - episode: Episode! - id: ID! - "Which regions this video is available in." - regions: [String!]! - "The site that is streaming this media." - streamer: Streamer! - "Languages this is translated to. Usually placed at bottom of media." - subs: [String!]! - updatedAt: ISO8601DateTime! - "The url of the video." - url: String! + createdAt: ISO8601DateTime! + "Spoken language is replaced by language of choice." + dubs: [String!]! + "The episode of this video" + episode: Episode! + id: ID! + "Which regions this video is available in." + regions: [String!]! + "The site that is streaming this media." + streamer: Streamer! + "Languages this is translated to. Usually placed at bottom of media." + subs: [String!]! + updatedAt: ISO8601DateTime! + "The url of the video." + url: String! } "The connection type for Video." type VideoConnection { - "A list of edges." - edges: [VideoEdge] - "A list of nodes." - nodes: [Video] - "Information to aid in pagination." - pageInfo: PageInfo! - "The total amount of nodes." - totalCount: Int! + "A list of edges." + edges: [VideoEdge] + "A list of nodes." + nodes: [Video] + "Information to aid in pagination." + pageInfo: PageInfo! + "The total amount of nodes." + totalCount: Int! } "An edge in a connection." type VideoEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Video + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Video } "A manga volume which can contain multiple chapters." type Volume implements WithTimestamps { - "The chapters in this volume." - chapters( - "Returns the elements in the list that come after the specified cursor." - after: String, - "Returns the elements in the list that come before the specified cursor." - before: String, - "Returns the first _n_ elements from the list." - first: Int, - "Returns the last _n_ elements from the list." - last: Int - ): ChapterConnection - createdAt: ISO8601DateTime! - id: ID! - "The isbn number of this volume." - isbn: [String!]! - "The manga this volume is in." - manga: Manga! - "The volume number." - number: Int! - "The date when this chapter was released." - published: ISO8601Date - "The titles for this chapter in various locales" - titles: TitlesList! - updatedAt: ISO8601DateTime! + "The chapters in this volume." + chapters( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int + ): ChapterConnection + createdAt: ISO8601DateTime! + id: ID! + "The isbn number of this volume." + isbn: [String!]! + "The manga this volume is in." + manga: Manga! + "The volume number." + number: Int! + "The date when this chapter was released." + published: ISO8601Date + "The titles for this chapter in various locales" + titles: TitlesList! + updatedAt: ISO8601DateTime! } -enum AgeRating { - "Acceptable for all ages" - G - "Parental guidance suggested; should be safe for preteens and older" - PG - "Possible lewd or intense themes; should be safe for teens and older" - R - "Contains adult content or themes; should only be viewed by adults" - R18 +enum AgeRatingEnum { + "Acceptable for all ages" + G + "Parental guidance suggested; should be safe for preteens and older" + PG + "Possible lewd or intense themes; should be safe for teens and older" + R + "Contains adult content or themes; should only be viewed by adults" + R18 } -enum AnimeSubtype { - MOVIE - MUSIC - "Original Net Animation (Web Anime)." - ONA - "Original Video Animation. Anime directly released to video market." - OVA - "Spinoffs or Extras of the original." - SPECIAL - TV +enum AnimeSubtypeEnum { + MOVIE + MUSIC + "Original Net Animation (Web Anime)." + ONA + "Original Video Animation. Anime directly released to video market." + OVA + "Spinoffs or Extras of the original." + SPECIAL + TV } -enum CharacterRole { - "A background character who generally only appears in a few episodes" - BACKGROUND - "A character from a different franchise making a (usually brief) appearance" - CAMEO - "A character who appears throughout a series and is a focal point of the media" - MAIN - "A character who appears in multiple episodes but is not a main character" - RECURRING +enum CharacterRoleEnum { + "A background character who generally only appears in a few episodes" + BACKGROUND + "A character from a different franchise making a (usually brief) appearance" + CAMEO + "A character who appears throughout a series and is a focal point of the media" + MAIN + "A character who appears in multiple episodes but is not a main character" + RECURRING } -enum LibraryEntryStatus { - "The user completed this media." - COMPLETED - "The user is currently reading or watching this media." - CURRENT - "The user started but chose not to finish this media." - DROPPED - "The user started but paused reading or watching this media." - ON_HOLD - "The user plans to read or watch this media in future." - PLANNED +enum LibraryEntryStatusEnum { + "The user completed this media." + COMPLETED + "The user is currently reading or watching this media." + CURRENT + "The user started but chose not to finish this media." + DROPPED + "The user started but paused reading or watching this media." + ON_HOLD + "The user plans to read or watch this media in future." + PLANNED } -enum LibraryEventKind { - "Notes were added/updated." - ANNOTATED - "Progress or Time Spent was added/updated." - PROGRESSED - "Rating was added/updated." - RATED - "Reaction was added/updated." - REACTED - "Status or Reconsuming was added/updated." - UPDATED +enum LibraryEventKindEnum { + "Notes were added/updated." + ANNOTATED + "Progress or Time Spent was added/updated." + PROGRESSED + "Rating was added/updated." + RATED + "Reaction was added/updated." + REACTED + "Status or Reconsuming was added/updated." + UPDATED } -enum MangaSubtype { - "Self published work." - DOUJIN - MANGA - "Chinese comics produced in China and in the Greater China region." - MANHUA - "A style of South Korean comic books and graphic novels" - MANHWA - NOVEL - "Original English Language." - OEL - ONESHOT +enum MangaSubtypeEnum { + "Self published work." + DOUJIN + MANGA + "Chinese comics produced in China and in the Greater China region." + MANHUA + "A style of South Korean comic books and graphic novels" + MANHWA + NOVEL + "Original English Language." + OEL + ONESHOT } -enum MappingExternalSite { - ANIDB - ANILIST_ANIME - ANILIST_MANGA - ANIMENEWSNETWORK - AOZORA - HULU - IMDB_EPISODES - MANGAUPDATES - MYANIMELIST_ANIME - MYANIMELIST_CHARACTERS - MYANIMELIST_MANGA - MYANIMELIST_PEOPLE - MYANIMELIST_PRODUCERS - MYDRAMALIST - THETVDB - THETVDB_SEASON - THETVDB_SERIES - TRAKT -} - -enum ProTier { - "Aozora Pro (only hides ads)" - AO_PRO @deprecated(reason : "No longer for sale") - "Aozora Pro+ (only hides ads)" - AO_PRO_PLUS @deprecated(reason : "No longer for sale") - "Top tier of Kitsu Pro" - PATRON - "Basic tier of Kitsu Pro" - PRO -} - -enum RatingSystem { - "1-20 in increments of 1 displayed as 1-10 in 0.5 increments" - ADVANCED - "1-20 in increments of 2 displayed as 5 stars in 0.5 star increments" - REGULAR - "1-20 displayed as 4 smileys - Awful (1), Meh (8), Good (14) and Great (20)" - SIMPLE -} - -enum RecurringBillingService { - "Billed through Apple In-App Subscription" - APPLE - "Billed through Google Play Subscription" - GOOGLE_PLAY - "Bill a PayPal account" - PAYPAL - "Bill a credit card via Stripe" - STRIPE -} - -enum ReleaseSeason { - "Released during the Fall season" - FALL - "Released during the Spring season" - SPRING - "Released during the Summer season" - SUMMER - "Released during the Winter season" - WINTER -} - -enum ReleaseStatus { - "This media is currently releasing" - CURRENT - "This media is no longer releasing" - FINISHED - "The release date has not been announced yet" - TBA - "This media is not released yet" - UNRELEASED - "This media is releasing soon" - UPCOMING -} - -enum TitleLanguagePreference { - "Prefer the most commonly-used title for media" - CANONICAL - "Prefer the localized title for media" - LOCALIZED - "Prefer the romanized title for media" - ROMANIZED +enum MappingExternalSiteEnum { + ANIDB + ANILIST_ANIME + ANILIST_MANGA + ANIMENEWSNETWORK + AOZORA + HULU + IMDB_EPISODES + MANGAUPDATES + MYANIMELIST_ANIME + MYANIMELIST_CHARACTERS + MYANIMELIST_MANGA + MYANIMELIST_PEOPLE + MYANIMELIST_PRODUCERS + MYDRAMALIST + THETVDB + THETVDB_SEASON + THETVDB_SERIES + TRAKT } "これはアニメやマンガです" -enum media_type { - ANIME - MANGA +enum MediaTypeEnum { + ANIME + MANGA +} + +enum ProTierEnum { + "Aozora Pro (only hides ads)" + AO_PRO @deprecated(reason : "No longer for sale") + "Aozora Pro+ (only hides ads)" + AO_PRO_PLUS @deprecated(reason : "No longer for sale") + "Top tier of Kitsu Pro" + PATRON + "Basic tier of Kitsu Pro" + PRO +} + +enum RatingSystemEnum { + "1-20 in increments of 1 displayed as 1-10 in 0.5 increments" + ADVANCED + "1-20 in increments of 2 displayed as 5 stars in 0.5 star increments" + REGULAR + "1-20 displayed as 4 smileys - Awful (1), Meh (8), Good (14) and Great (20)" + SIMPLE +} + +enum RecurringBillingServiceEnum { + "Billed through Apple In-App Subscription" + APPLE + "Billed through Google Play Subscription" + GOOGLE_PLAY + "Bill a PayPal account" + PAYPAL + "Bill a credit card via Stripe" + STRIPE +} + +enum ReleaseSeasonEnum { + "Released during the Fall season" + FALL + "Released during the Spring season" + SPRING + "Released during the Summer season" + SUMMER + "Released during the Winter season" + WINTER +} + +enum ReleaseStatusEnum { + "This media is currently releasing" + CURRENT + "This media is no longer releasing" + FINISHED + "The release date has not been announced yet" + TBA + "This media is not released yet" + UNRELEASED + "This media is releasing soon" + UPCOMING +} + +enum TitleLanguagePreferenceEnum { + "Prefer the most commonly-used title for media" + CANONICAL + "Prefer the localized title for media" + LOCALIZED + "Prefer the romanized title for media" + ROMANIZED } input AnimeCreateInput { - ageRating: AgeRating - ageRatingGuide: String - bannerImage: Upload - description: Map! - endDate: Date - episodeCount: Int - episodeLength: Int - posterImage: Upload - startDate: Date - tba: String - titles: TitlesListInput! - youtubeTrailerVideoId: String + ageRating: AgeRatingEnum + ageRatingGuide: String + bannerImage: Upload + description: Map! + endDate: Date + episodeCount: Int + episodeLength: Int + posterImage: Upload + startDate: Date + tba: String + titles: TitlesListInput! + youtubeTrailerVideoId: String } input AnimeUpdateInput { - ageRating: AgeRating - ageRatingGuide: String - bannerImage: Upload - description: Map - endDate: Date - episodeCount: Int - episodeLength: Int - id: ID! - posterImage: Upload - startDate: Date - tba: String - titles: TitlesListInput - youtubeTrailerVideoId: String + ageRating: AgeRatingEnum + ageRatingGuide: String + bannerImage: Upload + description: Map + endDate: Date + episodeCount: Int + episodeLength: Int + id: ID! + posterImage: Upload + startDate: Date + tba: String + titles: TitlesListInput + youtubeTrailerVideoId: String } input EpisodeCreateInput { - description: Map - length: Int - mediaId: ID! - mediaType: media_type! - number: Int! - releasedAt: Date - thumbnailImage: Upload - titles: TitlesListInput! + description: Map + length: Int + mediaId: ID! + mediaType: MediaTypeEnum! + number: Int! + releasedAt: Date + thumbnailImage: Upload + titles: TitlesListInput! } input EpisodeUpdateInput { - description: Map - id: ID! - length: Int - number: Int - releasedAt: Date - thumbnailImage: Upload - titles: TitlesListInput + description: Map + id: ID! + length: Int + number: Int + releasedAt: Date + thumbnailImage: Upload + titles: TitlesListInput } input GenericDeleteInput { - id: ID! + id: ID! } input LibraryEntryCreateInput { - finishedAt: ISO8601DateTime - mediaId: ID! - mediaType: media_type! - notes: String - private: Boolean = false - progress: Int = 0 - rating: Int - reconsumeCount: Int = 0 - reconsuming: Boolean = false - startedAt: ISO8601DateTime - status: LibraryEntryStatus! - userId: ID! - volumesOwned: Int = 0 + finishedAt: ISO8601DateTime + mediaId: ID! + mediaType: MediaTypeEnum! + notes: String + private: Boolean = false + progress: Int = 0 + rating: Int + reconsumeCount: Int = 0 + reconsuming: Boolean = false + startedAt: ISO8601DateTime + status: LibraryEntryStatusEnum! + userId: ID! + volumesOwned: Int = 0 } input LibraryEntryUpdateInput { - finishedAt: ISO8601DateTime - id: ID! - notes: String - private: Boolean - progress: Int - rating: Int - reconsumeCount: Int - reconsuming: Boolean - startedAt: ISO8601DateTime - status: LibraryEntryStatus - volumesOwned: Int + finishedAt: ISO8601DateTime + id: ID! + notes: String + private: Boolean + progress: Int + rating: Int + reconsumeCount: Int + reconsuming: Boolean + startedAt: ISO8601DateTime + status: LibraryEntryStatusEnum + volumesOwned: Int } input TitlesListInput { - alternatives: [String!] - canonicalLocale: String - localized: Map + alternatives: [String!] + canonicalLocale: String + localized: Map } input UpdateProgressByIdInput { - id: ID! - progress: Int! + id: ID! + progress: Int! } input UpdateProgressByMediaInput { - mediaId: ID! - mediaType: media_type! - progress: Int! + mediaId: ID! + mediaType: MediaTypeEnum! + progress: Int! } input UpdateRatingByIdInput { - id: ID! - "A number between 2 - 20" - rating: Int! + id: ID! + "A number between 2 - 20" + rating: Int! } input UpdateRatingByMediaInput { - mediaId: ID! - mediaType: media_type! - "A number between 2 - 20" - rating: Int! + mediaId: ID! + mediaType: MediaTypeEnum! + "A number between 2 - 20" + rating: Int! } input UpdateStatusByIdInput { - id: ID! - status: LibraryEntryStatus! + id: ID! + status: LibraryEntryStatusEnum! } input UpdateStatusByMediaInput { - mediaId: ID! - mediaType: media_type! - status: LibraryEntryStatus! + mediaId: ID! + mediaType: MediaTypeEnum! + status: LibraryEntryStatusEnum! } From ecce90abd5ff8460de2cd2d0df49b0369db5107b Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 5 Oct 2020 12:32:12 -0400 Subject: [PATCH 68/86] Fix hiding anime on completion --- frontEndSrc/js/anime.js | 16 +- public/es/scripts.js | 16 +- public/js/scripts.min.js | 18 +- public/js/scripts.min.js.map | 2 +- .../Mutations/CreateFullLibraryItem.graphql | 35 +++- src/AnimeClient/API/Kitsu/schema.graphql | 187 ++++++++++++++---- 6 files changed, 195 insertions(+), 79 deletions(-) diff --git a/frontEndSrc/js/anime.js b/frontEndSrc/js/anime.js index 55672e5f..083ab288 100644 --- a/frontEndSrc/js/anime.js +++ b/frontEndSrc/js/anime.js @@ -6,7 +6,7 @@ const search = (query) => { _.show('.cssload-loader'); // Do the api search - return _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => { + _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); // Hide the loader @@ -18,19 +18,13 @@ const search = (query) => { }; if (_.hasElement('.anime #search')) { - let prevRequest = null; - _.on('#search', 'input', _.throttle(250, (e) => { const query = encodeURIComponent(e.target.value); if (query === '') { return; } - if (prevRequest !== null) { - prevRequest.abort(); - } - - prevRequest = search(query); + search(query); })); } @@ -53,12 +47,12 @@ _.on('body.anime.list', 'click', '.plus-one', (e) => { // If the episode count is 0, and incremented, // change status to currently watching if (isNaN(watchedCount) || watchedCount === 0) { - data.data.status = 'CURRENT'; + data.data.status = 'current'; } // If you increment at the last episode, mark as completed if ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) { - data.data.status = 'COMPLETED'; + data.data.status = 'completed'; } _.show('#loading-shadow'); @@ -78,7 +72,7 @@ _.on('body.anime.list', 'click', '.plus-one', (e) => { return; } - if (String(resData.data.status).toUpperCase() === 'COMPLETED') { + if (resData.data.libraryEntry.update.libraryEntry.status === 'COMPLETED') { _.hide(parentSel); } diff --git a/public/es/scripts.js b/public/es/scripts.js index 9e574ff0..ad79cedd 100644 --- a/public/es/scripts.js +++ b/public/es/scripts.js @@ -590,7 +590,7 @@ const search = (query) => { AnimeClient.show('.cssload-loader'); // Do the api search - return AnimeClient.get(AnimeClient.url('/anime-collection/search'), { query }, (searchResults, status) => { + AnimeClient.get(AnimeClient.url('/anime-collection/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); // Hide the loader @@ -602,19 +602,13 @@ const search = (query) => { }; if (AnimeClient.hasElement('.anime #search')) { - let prevRequest = null; - AnimeClient.on('#search', 'input', AnimeClient.throttle(250, (e) => { const query = encodeURIComponent(e.target.value); if (query === '') { return; } - if (prevRequest !== null) { - prevRequest.abort(); - } - - prevRequest = search(query); + search(query); })); } @@ -637,12 +631,12 @@ AnimeClient.on('body.anime.list', 'click', '.plus-one', (e) => { // If the episode count is 0, and incremented, // change status to currently watching if (isNaN(watchedCount) || watchedCount === 0) { - data.data.status = 'CURRENT'; + data.data.status = 'current'; } // If you increment at the last episode, mark as completed if ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) { - data.data.status = 'COMPLETED'; + data.data.status = 'completed'; } AnimeClient.show('#loading-shadow'); @@ -662,7 +656,7 @@ AnimeClient.on('body.anime.list', 'click', '.plus-one', (e) => { return; } - if (String(resData.data.status).toUpperCase() === 'COMPLETED') { + if (resData.data.libraryEntry.update.libraryEntry.status === 'COMPLETED') { AnimeClient.hide(parentSel); } diff --git a/public/js/scripts.min.js b/public/js/scripts.min.js index 073c592c..a8ecba2a 100644 --- a/public/js/scripts.min.js +++ b/public/js/scripts.min.js @@ -16,13 +16,13 @@ function(beat){var status=JSON.parse(beat);if(status.hasAuth!==true){document.re x.id+'.webp" type="image/webp" />\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'+item.canonicalTitle+"
\n\t\t\t\t\t\t\t"+titles+'\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t')});return results.join("")}function renderMangaSearchResults(data){var results=[];data.forEach(function(x){var item=x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults, -status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search")){var prevRequest=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search(query)}))}AnimeClient.on("body.anime.list","click",".plus-one", -function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="CURRENT";if(!isNaN(watchedCount)&& -watchedCount+1===totalCount)data.data.status="COMPLETED";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(String(resData.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow"); -AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults); -AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target; -var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)|| -completed===0)data.data.status="CURRENT";if(!isNaN(completed)&&completed+1===total)data.data.status="COMPLETED";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(String(data.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed; -AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() +'\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults, +status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search"))AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;search(query)}));AnimeClient.on("body.anime.list","click",".plus-one",function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount= +parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&&watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow"); +AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.libraryEntry.update.libraryEntry.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number", +parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML= +renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")? +"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="CURRENT";if(!isNaN(completed)&&completed+1===total)data.data.status="COMPLETED"; +data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(String(data.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed;AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow"); +AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() //# sourceMappingURL=scripts.min.js.map diff --git a/public/js/scripts.min.js.map b/public/js/scripts.min.js.map index 6e417ecd..54921546 100644 --- a/public/js/scripts.min.js.map +++ b/public/js/scripts.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (String(resData.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (String(data.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG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AM,CACLkG,SAAUQ,SADL,CAHI,CAUX,IAAIP,KAAA,CAAMO,SAAN,CAAJ;AAAwBA,SAAxB,GAAsC,CAAtC,CACC1G,IAAAA,KAAA8B,OAAA,CAAmB,SAIpB,IAAK,CAACqE,KAAA,CAAMO,SAAN,CAAN,EAA4BA,SAA5B,CAAwC,CAAxC,GAA+CC,KAA/C,CACC3G,IAAAA,KAAA8B,OAAA,CAAmB,WAIpB9B,KAAAA,KAAAkG,SAAA,CAAqB,EAAEQ,SAEvBhE,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,KAAAA,CAAOA,WAAAA,IAAAA,CAAM,kBAANA,CAAPA,CAAkC,CACjC1C,KAAAA,IADiC,CAEjCY,SAAU,MAFuB,CAGjCrD,KAAM,MAH2B,CAIjCuD,SAAU,kBAJuB,CAKjCD,QAASA,QAAA,EAAM,CACd,GAAIO,MAAA,CAAOpB,IAAAA,KAAA8B,OAAP,CAAAT,YAAA,EAAJ,GAA+C,WAA/C,CACCqB,WAAAA,KAAAA,CAAOiD,SAAPjD,CAGDA,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,EAAAA,CAAI,GAAJA,CAAQnF,IAARmF,CAAI,QAAJA,CAAsBiD,SAAtBjD,CAAAA,CAAkC,CAAlCA,CAAAA,YAAAA,CAAoDgE,SACpDhE;WAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA,CAAiDkE,SAAjDlE,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA,YAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CkE,SAA3ClE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file +{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\t_.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tsearch(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.libraryEntry.update.libraryEntry.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (String(data.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","libraryEntry","update","prevRequest","abort","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,IAAV,CAAAA,OACX,IAAI,MAAOZ,SAAX,GAAwB,QAAxB,CACC,MAAOA,SAGRY,QAAA,CAAWA,OAAD,GAAa,IAAb,EAAqBA,OAAAC,SAArB,GAA0C,CAA1C,CACPD,OADO,CAEPR,QAEH,KAAIU,SAAW,EACf,IAAId,QAAAe,MAAA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uB,CAGjCrD,KAAM,MAH2B,CAIjCuD,SAAU,kBAJuB,CAKjCD,QAASA,QAAA,EAAM,CACd,GAAIO,MAAA,CAAOpB,IAAAA,KAAA8B,OAAP,CAAAT,YAAA,EAAJ,GAA+C,WAA/C,CACCqB,WAAAA,KAAAA,CAAO+C,SAAP/C,CAGDA,YAAAA,KAAAA,CAAO,iBAAPA,CAEAA,YAAAA,EAAAA,CAAI,GAAJA,CAAQnF,IAARmF,CAAI,QAAJA,CAAsB+C,SAAtB/C,CAAAA,CAAkC,CAAlCA,CAAAA,YAAAA,CAAoDkE,SACpDlE,YAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA,CAAiDoE,SAAjDpE,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA;WAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CoE,SAA3CpE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Mutations/CreateFullLibraryItem.graphql b/src/AnimeClient/API/Kitsu/Mutations/CreateFullLibraryItem.graphql index 5a30c439..cbdf6912 100644 --- a/src/AnimeClient/API/Kitsu/Mutations/CreateFullLibraryItem.graphql +++ b/src/AnimeClient/API/Kitsu/Mutations/CreateFullLibraryItem.graphql @@ -4,8 +4,14 @@ mutation ( $userId: ID! $id: ID!, - $mediaType: media_type!, - $status: MediaListStatus, + $mediaType: MediaTypeEnum!, + $status: LibraryEntryStatusEnum!, + $notes: String, + $private: Boolean, + $progress: Int, + $reconsumeCount: Int, + $reconsuming: Boolean, + $rating: Int, ) { libraryEntry { create(input: { @@ -13,9 +19,30 @@ mutation ( mediaId: $id mediaType: $mediaType status: $status + notes: $notes + private: $private + progress: $progress + reconsuming: $reconsuming + reconsumeCount: $reconsumeCount + rating: $rating }) { - mediaId - status + libraryEntry { + user { + id + slug + } + media { + id + slug + } + status + notes + private + progress + reconsumeCount + reconsuming + rating + } } } } \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/schema.graphql b/src/AnimeClient/API/Kitsu/schema.graphql index da9bab43..d15394cc 100644 --- a/src/AnimeClient/API/Kitsu/schema.graphql +++ b/src/AnimeClient/API/Kitsu/schema.graphql @@ -1028,32 +1028,32 @@ type LibraryEntryMutation { "Update library entry progress by id" updateProgressById( "Update library entry progress by id" - input: UpdateProgressByIdInput! + input: LibraryEntryUpdateProgressByIdInput! ): LibraryEntryUpdateProgressByIdPayload "Update library entry progress by media" updateProgressByMedia( "Update library entry progress by media" - input: UpdateProgressByMediaInput! + input: LibraryEntryUpdateProgressByMediaInput! ): LibraryEntryUpdateProgressByMediaPayload "Update library entry rating by id" updateRatingById( "Update library entry rating by id" - input: UpdateRatingByIdInput! + input: LibraryEntryUpdateRatingByIdInput! ): LibraryEntryUpdateRatingByIdPayload "Update library entry rating by media" updateRatingByMedia( "Update library entry rating by media" - input: UpdateRatingByMediaInput! + input: LibraryEntryUpdateRatingByMediaInput! ): LibraryEntryUpdateRatingByMediaPayload "Update library entry status by id" updateStatusById( "Update library entry status by id" - input: UpdateStatusByIdInput! + input: LibraryEntryUpdateStatusByIdInput! ): LibraryEntryUpdateStatusByIdPayload "Update library entry status by media" updateStatusByMedia( "Update library entry status by media" - input: UpdateStatusByMediaInput! + input: LibraryEntryUpdateStatusByMediaInput! ): LibraryEntryUpdateStatusByMediaPayload } @@ -1352,6 +1352,20 @@ type MappingConnection { totalCount: Int! } +"Autogenerated return type of MappingCreate" +type MappingCreatePayload { + "Graphql Errors" + errors: [Generic!] + mapping: Mapping +} + +"Autogenerated return type of MappingDelete" +type MappingDeletePayload { + "Graphql Errors" + errors: [Generic!] + mapping: GenericDelete +} + "An edge in a connection." type MappingEdge { "A cursor for use in pagination." @@ -1360,6 +1374,31 @@ type MappingEdge { node: Mapping } +type MappingMutation { + "Create a Mapping" + create( + "Create a Mapping" + input: MappingCreateInput! + ): MappingCreatePayload + "Delete a Mapping" + delete( + "Delete a Mapping" + input: GenericDeleteInput! + ): MappingDeletePayload + "Update a Mapping" + update( + "Update a Mapping" + input: MappingUpdateInput! + ): MappingUpdatePayload +} + +"Autogenerated return type of MappingUpdate" +type MappingUpdatePayload { + "Graphql Errors" + errors: [Generic!] + mapping: Mapping +} + "Information about a Character starring in a Media" type MediaCharacter implements WithTimestamps { "The character" @@ -1541,6 +1580,7 @@ type Mutation { anime: AnimeMutation episode: EpisodeMutation libraryEntry: LibraryEntryMutation + mapping: MappingMutation pro: ProMutation! } @@ -1940,7 +1980,7 @@ type Query { first: Int, "Returns the last _n_ elements from the list." last: Int, - medium: String! + mediaType: MediaTypeEnum! ): MediaConnection! "List of Library Entries by MediaType and MediaId" libraryEntriesByMedia( @@ -1977,7 +2017,7 @@ type Query { first: Int, "Returns the last _n_ elements from the list." last: Int, - medium: String! + mediaType: MediaTypeEnum! ): MediaConnection! "Find a specific Mapping Item by External ID and External Site." lookupMapping(externalId: ID!, externalSite: MappingExternalSiteEnum!): MappingItemUnion @@ -2015,6 +2055,42 @@ type Query { "Returns the last _n_ elements from the list." last: Int ): ProfileConnection! + "Search for Anime by title using Algolia. The most relevant results will be at the top." + searchAnimeByTitle( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + title: String! + ): AnimeConnection! + "Search for Manga by title using Algolia. The most relevant results will be at the top." + searchMangaByTitle( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + title: String! + ): MangaConnection! + "Search for any media (Anime, Manga) by title using Algolia. The most relevant results will be at the top." + searchMediaByTitle( + "Returns the elements in the list that come after the specified cursor." + after: String, + "Returns the elements in the list that come before the specified cursor." + before: String, + "Returns the first _n_ elements from the list." + first: Int, + "Returns the last _n_ elements from the list." + last: Int, + title: String! + ): MediaConnection! "Get your current session info" session: Session! } @@ -2395,6 +2471,16 @@ enum MappingExternalSiteEnum { TRAKT } +enum MappingItemEnum { + ANIME + CATEGORY + CHARACTER + EPISODE + MANGA + PERSON + PRODUCER +} + "これはアニメやマンガです" enum MediaTypeEnum { ANIME @@ -2551,47 +2637,62 @@ input LibraryEntryUpdateInput { volumesOwned: Int } +input LibraryEntryUpdateProgressByIdInput { + id: ID! + progress: Int! +} + +input LibraryEntryUpdateProgressByMediaInput { + mediaId: ID! + mediaType: MediaTypeEnum! + progress: Int! +} + +input LibraryEntryUpdateRatingByIdInput { + id: ID! + "A number between 2 - 20" + rating: Int! +} + +input LibraryEntryUpdateRatingByMediaInput { + mediaId: ID! + mediaType: MediaTypeEnum! + "A number between 2 - 20" + rating: Int! +} + +input LibraryEntryUpdateStatusByIdInput { + id: ID! + status: LibraryEntryStatusEnum! +} + +input LibraryEntryUpdateStatusByMediaInput { + mediaId: ID! + mediaType: MediaTypeEnum! + status: LibraryEntryStatusEnum! +} + +input MappingCreateInput { + externalId: ID! + externalSite: MappingExternalSiteEnum! + itemId: ID! + itemType: MappingItemEnum! +} + +input MappingUpdateInput { + externalId: ID + externalSite: MappingExternalSiteEnum + id: ID! + itemId: ID + itemType: MappingItemEnum +} + input TitlesListInput { alternatives: [String!] canonicalLocale: String localized: Map } -input UpdateProgressByIdInput { - id: ID! - progress: Int! -} - -input UpdateProgressByMediaInput { - mediaId: ID! - mediaType: MediaTypeEnum! - progress: Int! -} - -input UpdateRatingByIdInput { - id: ID! - "A number between 2 - 20" - rating: Int! -} - -input UpdateRatingByMediaInput { - mediaId: ID! - mediaType: MediaTypeEnum! - "A number between 2 - 20" - rating: Int! -} - -input UpdateStatusByIdInput { - id: ID! - status: LibraryEntryStatusEnum! -} - -input UpdateStatusByMediaInput { - mediaId: ID! - mediaType: MediaTypeEnum! - status: LibraryEntryStatusEnum! -} - "A date, expressed as an ISO8601 string" scalar Date From 24d6eaf0da952dbc36ac9b3f2c83a4c0e443aa27 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 7 Oct 2020 09:10:11 -0400 Subject: [PATCH 69/86] Add back search query canceling for anime search --- frontEndSrc/js/anime.js | 14 ++++++++++---- public/es/scripts.js | 14 ++++++++++---- public/js/scripts.min.js | 18 +++++++++--------- public/js/scripts.min.js.map | 2 +- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/frontEndSrc/js/anime.js b/frontEndSrc/js/anime.js index 083ab288..3d92af9e 100644 --- a/frontEndSrc/js/anime.js +++ b/frontEndSrc/js/anime.js @@ -6,7 +6,7 @@ const search = (query) => { _.show('.cssload-loader'); // Do the api search - _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => { + return _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); // Hide the loader @@ -18,13 +18,19 @@ const search = (query) => { }; if (_.hasElement('.anime #search')) { + let prevRequest = null; + _.on('#search', 'input', _.throttle(250, (e) => { const query = encodeURIComponent(e.target.value); if (query === '') { return; } - search(query); + if (prevRequest !== null) { + prevRequest.abort(); + } + + prevRequest = search(query); })); } @@ -47,12 +53,12 @@ _.on('body.anime.list', 'click', '.plus-one', (e) => { // If the episode count is 0, and incremented, // change status to currently watching if (isNaN(watchedCount) || watchedCount === 0) { - data.data.status = 'current'; + data.data.status = 'CURRENT'; } // If you increment at the last episode, mark as completed if ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) { - data.data.status = 'completed'; + data.data.status = 'COMPLETED'; } _.show('#loading-shadow'); diff --git a/public/es/scripts.js b/public/es/scripts.js index ad79cedd..d01d2a44 100644 --- a/public/es/scripts.js +++ b/public/es/scripts.js @@ -590,7 +590,7 @@ const search = (query) => { AnimeClient.show('.cssload-loader'); // Do the api search - AnimeClient.get(AnimeClient.url('/anime-collection/search'), { query }, (searchResults, status) => { + return AnimeClient.get(AnimeClient.url('/anime-collection/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); // Hide the loader @@ -602,13 +602,19 @@ const search = (query) => { }; if (AnimeClient.hasElement('.anime #search')) { + let prevRequest = null; + AnimeClient.on('#search', 'input', AnimeClient.throttle(250, (e) => { const query = encodeURIComponent(e.target.value); if (query === '') { return; } - search(query); + if (prevRequest !== null) { + prevRequest.abort(); + } + + prevRequest = search(query); })); } @@ -631,12 +637,12 @@ AnimeClient.on('body.anime.list', 'click', '.plus-one', (e) => { // If the episode count is 0, and incremented, // change status to currently watching if (isNaN(watchedCount) || watchedCount === 0) { - data.data.status = 'current'; + data.data.status = 'CURRENT'; } // If you increment at the last episode, mark as completed if ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) { - data.data.status = 'completed'; + data.data.status = 'COMPLETED'; } AnimeClient.show('#loading-shadow'); diff --git a/public/js/scripts.min.js b/public/js/scripts.min.js index a8ecba2a..76f510ea 100644 --- a/public/js/scripts.min.js +++ b/public/js/scripts.min.js @@ -16,13 +16,13 @@ function(beat){var status=JSON.parse(beat);if(status.hasAuth!==true){document.re x.id+'.webp" type="image/webp" />\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'+item.canonicalTitle+"
\n\t\t\t\t\t\t\t"+titles+'\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t')});return results.join("")}function renderMangaSearchResults(data){var results=[];data.forEach(function(x){var item=x.attributes;var titles=item.titles.join("
");results.push('\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults, -status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search"))AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;search(query)}));AnimeClient.on("body.anime.list","click",".plus-one",function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount= -parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="current";if(!isNaN(watchedCount)&&watchedCount+1===totalCount)data.data.status="completed";AnimeClient.show("#loading-shadow"); -AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.libraryEntry.update.libraryEntry.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number", -parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML= -renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target;var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")? -"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)||completed===0)data.data.status="CURRENT";if(!isNaN(completed)&&completed+1===total)data.data.status="COMPLETED"; -data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(String(data.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed;AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow"); -AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() +'\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t')});return results.join("")}var search=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/anime-collection/search"),{query:query},function(searchResults, +status){searchResults=JSON.parse(searchResults);AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderAnimeSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".anime #search")){var prevRequest=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest!==null)prevRequest.abort();prevRequest=search(query)}))}AnimeClient.on("body.anime.list","click",".plus-one", +function(e){var parentSel=AnimeClient.closestParent(e.target,"article");var watchedCount=parseInt(AnimeClient.$(".completed_number",parentSel)[0].textContent,10)||0;var totalCount=parseInt(AnimeClient.$(".total_number",parentSel)[0].textContent,10);var title=AnimeClient.$(".name a",parentSel)[0].textContent;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:watchedCount+1}};if(isNaN(watchedCount)||watchedCount===0)data.data.status="CURRENT";if(!isNaN(watchedCount)&& +watchedCount+1===totalCount)data.data.status="COMPLETED";AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/anime/increment"),{data:data,dataType:"json",type:"POST",success:function(res){var resData=JSON.parse(res);if(resData.errors){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop();return}if(resData.data.libraryEntry.update.libraryEntry.status==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow"); +AnimeClient.showMessage("success","Successfully updated "+title);AnimeClient.$(".completed_number",parentSel)[0].textContent=++watchedCount;AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+title+". ");AnimeClient.scrollToTop()}})});var search$1=function(query){AnimeClient.show(".cssload-loader");return AnimeClient.get(AnimeClient.url("/manga/search"),{query:query},function(searchResults,status){searchResults=JSON.parse(searchResults); +AnimeClient.hide(".cssload-loader");AnimeClient.$("#series-list")[0].innerHTML=renderMangaSearchResults(searchResults.data)})};if(AnimeClient.hasElement(".manga #search")){var prevRequest$1=null;AnimeClient.on("#search","input",AnimeClient.throttle(250,function(e){var query=encodeURIComponent(e.target.value);if(query==="")return;if(prevRequest$1!==null)prevRequest$1.abort();prevRequest$1=search$1(query)}))}AnimeClient.on(".manga.list","click",".edit-buttons button",function(e){var thisSel=e.target; +var parentSel=AnimeClient.closestParent(e.target,"article");var type=thisSel.classList.contains("plus-one-chapter")?"chapter":"volume";var completed=parseInt(AnimeClient.$("."+type+"s_read",parentSel)[0].textContent,10)||0;var total=parseInt(AnimeClient.$("."+type+"_count",parentSel)[0].textContent,10);var mangaName=AnimeClient.$(".name",parentSel)[0].textContent;if(isNaN(completed))completed=0;var data={id:parentSel.dataset.kitsuId,mal_id:parentSel.dataset.malId,data:{progress:completed}};if(isNaN(completed)|| +completed===0)data.data.status="CURRENT";if(!isNaN(completed)&&completed+1===total)data.data.status="COMPLETED";data.data.progress=++completed;AnimeClient.show("#loading-shadow");AnimeClient.ajax(AnimeClient.url("/manga/increment"),{data:data,dataType:"json",type:"POST",mimeType:"application/json",success:function(){if(String(data.data.status).toUpperCase()==="COMPLETED")AnimeClient.hide(parentSel);AnimeClient.hide("#loading-shadow");AnimeClient.$("."+type+"s_read",parentSel)[0].textContent=completed; +AnimeClient.showMessage("success","Successfully updated "+mangaName);AnimeClient.scrollToTop()},error:function(){AnimeClient.hide("#loading-shadow");AnimeClient.showMessage("error","Failed to update "+mangaName);AnimeClient.scrollToTop()}})})})() //# sourceMappingURL=scripts.min.js.map diff --git a/public/js/scripts.min.js.map b/public/js/scripts.min.js.map index 54921546..15438512 100644 --- a/public/js/scripts.min.js.map +++ b/public/js/scripts.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\t_.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tsearch(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'current';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'completed';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.libraryEntry.update.libraryEntry.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (String(data.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","libraryEntry","update","prevRequest","abort","thisSel","classList","contains","completed","total","mangaName"],"mappings":"YAIA,yBAAoBA,UACnB,IAAIC,EAAIC,CAACC,GAAAC,SAADF,EAAiBC,GAAAE,cAAjBH,kBAAA,CAAqDF,QAArD,CACR,KAAIM,EAAIC,OAAAC,OACR,OAAO,EAAEF,CAAT,EAAc,CAAd,EAAmBL,CAAAQ,KAAA,CAAOH,CAAP,CAAnB,GAAiCH,GAAjC,EACA,MAAOG,EAAP,CAAW,GAGL,kBAINI,KAAMA,QAAA,EAAM,GAQZ,EAAAC,QAAC,CAACX,QAAD,CAAWY,OAAX,CAA2B,CAAhBA,OAAA,CAAAA,OAAA,GAAA,SAAA,CAAU,IAAV,CAAAA,OACX,IAAI,MAAOZ,SAAX,GAAwB,QAAxB,CACC,MAAOA,SAGRY,QAAA,CAAWA,OAAD,GAAa,IAAb,EAAqBA,OAAAC,SAArB,GAA0C,CAA1C,CACPD,OADO,CAEPR,QAEH,KAAIU,SAAW,EACf,IAAId,QAAAe,MAAA,CAAe,YAAf,CAAJ,CACCD,QAAAE,KAAA,CAAcZ,QAAAa,eAAA,CAAwBjB,QAAAkB,MAAA,CAAe,GAAf,CAAA,CAAoB,CAApB,CAAxB,CAAd,CADD;IAGCJ,SAAA,CAAW,EAAAK,MAAAC,MAAA,CAAeR,OAAAV,iBAAA,CAAyBF,QAAzB,CAAf,CAGZ,OAAOc,SAhBoB,EAwB5B,WAAAO,QAAW,CAACrB,QAAD,CAAW,CAC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CAAI,QAAJA,CAAsB+C,SAAtB/C,CAAAA,CAAkC,CAAlCA,CAAAA,YAAAA,CAAoDkE,SACpDlE,YAAAA,YAAAA,CAAc,SAAdA,CAAyB,uBAAzBA,CAAiDoE,SAAjDpE,CACAA,YAAAA,YAAAA,EATc,CALkB,CAgBjC3B,MAAOA,QAAA,EAAM,CACZ2B,WAAAA,KAAAA,CAAO,iBAAPA,CACAA;WAAAA,YAAAA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CoE,SAA3CpE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file +{"version":3,"file":"scripts.min.js.map","sources":["../../frontEndSrc/js/anime-client.js","../../frontEndSrc/js/events.js","../../frontEndSrc/js/anon.js","../../frontEndSrc/js/session-check.js","../../frontEndSrc/js/template-helpers.js","../../frontEndSrc/js/anime.js","../../frontEndSrc/js/manga.js"],"sourcesContent":["// -------------------------------------------------------------------------\n// ! Base\n// -------------------------------------------------------------------------\n\nconst matches = (elm, selector) => {\n\tlet m = (elm.document || elm.ownerDocument).querySelectorAll(selector);\n\tlet i = matches.length;\n\twhile (--i >= 0 && m.item(i) !== elm) {};\n\treturn i > -1;\n}\n\nexport const AnimeClient = {\n\t/**\n\t * Placeholder function\n\t */\n\tnoop: () => {},\n\t/**\n\t * DOM selector\n\t *\n\t * @param {string} selector - The dom selector string\n\t * @param {object} [context]\n\t * @return {[HTMLElement]} - array of dom elements\n\t */\n\t$(selector, context = null) {\n\t\tif (typeof selector !== 'string') {\n\t\t\treturn selector;\n\t\t}\n\n\t\tcontext = (context !== null && context.nodeType === 1)\n\t\t\t? context\n\t\t\t: document;\n\n\t\tlet elements = [];\n\t\tif (selector.match(/^#([\\w]+$)/)) {\n\t\t\telements.push(document.getElementById(selector.split('#')[1]));\n\t\t} else {\n\t\t\telements = [].slice.apply(context.querySelectorAll(selector));\n\t\t}\n\n\t\treturn elements;\n\t},\n\t/**\n\t * Does the selector exist on the current page?\n\t *\n\t * @param {string} selector\n\t * @returns {boolean}\n\t */\n\thasElement (selector) {\n\t\treturn AnimeClient.$(selector).length > 0;\n\t},\n\t/**\n\t * Scroll to the top of the Page\n\t *\n\t * @return {void}\n\t */\n\tscrollToTop () {\n\t\tconst el = AnimeClient.$('header')[0];\n\t\tel.scrollIntoView(true);\n\t},\n\t/**\n\t * Hide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\thide (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.setAttribute('hidden', 'hidden'));\n\t\t} else {\n\t\t\tsel.setAttribute('hidden', 'hidden');\n\t\t}\n\t},\n\t/**\n\t * UnHide the selected element\n\t *\n\t * @param {string|Element} sel - the selector of the element to hide\n\t * @return {void}\n\t */\n\tshow (sel) {\n\t\tif (typeof sel === 'string') {\n\t\t\tsel = AnimeClient.$(sel);\n\t\t}\n\n\t\tif (Array.isArray(sel)) {\n\t\t\tsel.forEach(el => el.removeAttribute('hidden'));\n\t\t} else {\n\t\t\tsel.removeAttribute('hidden');\n\t\t}\n\t},\n\t/**\n\t * Display a message box\n\t *\n\t * @param {string} type - message type: info, error, success\n\t * @param {string} message - the message itself\n\t * @return {void}\n\t */\n\tshowMessage (type, message) {\n\t\tlet template =\n\t\t\t`
\n\t\t\t\t\n\t\t\t\t${message}\n\t\t\t\t\n\t\t\t
`;\n\n\t\tlet sel = AnimeClient.$('.message');\n\t\tif (sel[0] !== undefined) {\n\t\t\tsel[0].remove();\n\t\t}\n\n\t\tAnimeClient.$('header')[0].insertAdjacentHTML('beforeend', template);\n\t},\n\t/**\n\t * Finds the closest parent element matching the passed selector\n\t *\n\t * @param {HTMLElement} current - the current HTMLElement\n\t * @param {string} parentSelector - selector for the parent element\n\t * @return {HTMLElement|null} - the parent element\n\t */\n\tclosestParent (current, parentSelector) {\n\t\tif (Element.prototype.closest !== undefined) {\n\t\t\treturn current.closest(parentSelector);\n\t\t}\n\n\t\twhile (current !== document.documentElement) {\n\t\t\tif (matches(current, parentSelector)) {\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tcurrent = current.parentElement;\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Generate a full url from a relative path\n\t *\n\t * @param {string} path - url path\n\t * @return {string} - full url\n\t */\n\turl (path) {\n\t\tlet uri = `//${document.location.host}`;\n\t\turi += (path.charAt(0) === '/') ? path : `/${path}`;\n\n\t\treturn uri;\n\t},\n\t/**\n\t * Throttle execution of a function\n\t *\n\t * @see https://remysharp.com/2010/07/21/throttling-function-calls\n\t * @see https://jsfiddle.net/jonathansampson/m7G64/\n\t * @param {Number} interval - the minimum throttle time in ms\n\t * @param {Function} fn - the function to throttle\n\t * @param {Object} [scope] - the 'this' object for the function\n\t * @return {Function}\n\t */\n\tthrottle (interval, fn, scope) {\n\t\tlet wait = false;\n\t\treturn function (...args) {\n\t\t\tconst context = scope || this;\n\n\t\t\tif ( ! wait) {\n\t\t\t\tfn.apply(context, args);\n\t\t\t\twait = true;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twait = false;\n\t\t\t\t}, interval);\n\t\t\t}\n\t\t};\n\t},\n};\n\n// -------------------------------------------------------------------------\n// ! Events\n// -------------------------------------------------------------------------\n\nfunction addEvent(sel, event, listener) {\n\t// Recurse!\n\tif (! event.match(/^([\\w\\-]+)$/)) {\n\t\tevent.split(' ').forEach((evt) => {\n\t\t\taddEvent(sel, evt, listener);\n\t\t});\n\t}\n\n\tsel.addEventListener(event, listener, false);\n}\n\nfunction delegateEvent(sel, target, event, listener) {\n\t// Attach the listener to the parent\n\taddEvent(sel, event, (e) => {\n\t\t// Get live version of the target selector\n\t\tAnimeClient.$(target, sel).forEach((element) => {\n\t\t\tif(e.target == element) {\n\t\t\t\tlistener.call(element, e);\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Add an event listener\n *\n * @param {string|HTMLElement} sel - the parent selector to bind to\n * @param {string} event - event name(s) to bind\n * @param {string|HTMLElement|function} target - the element to directly bind the event to\n * @param {function} [listener] - event listener callback\n * @return {void}\n */\nAnimeClient.on = (sel, event, target, listener) => {\n\tif (listener === undefined) {\n\t\tlistener = target;\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\taddEvent(el, event, listener);\n\t\t});\n\t} else {\n\t\tAnimeClient.$(sel).forEach((el) => {\n\t\t\tdelegateEvent(el, target, event, listener);\n\t\t});\n\t}\n};\n\n// -------------------------------------------------------------------------\n// ! Ajax\n// -------------------------------------------------------------------------\n\n/**\n * Url encoding for non-get requests\n *\n * @param data\n * @returns {string}\n * @private\n */\nfunction ajaxSerialize(data) {\n\tlet pairs = [];\n\n\tObject.keys(data).forEach((name) => {\n\t\tlet value = data[name].toString();\n\n\t\tname = encodeURIComponent(name);\n\t\tvalue = encodeURIComponent(value);\n\n\t\tpairs.push(`${name}=${value}`);\n\t});\n\n\treturn pairs.join('&');\n}\n\n/**\n * Make an ajax request\n *\n * Config:{\n * \tdata: // data to send with the request\n * \ttype: // http verb of the request, defaults to GET\n * \tsuccess: // success callback\n * \terror: // error callback\n * }\n *\n * @param {string} url - the url to request\n * @param {Object} config - the configuration object\n * @return {XMLHttpRequest}\n */\nAnimeClient.ajax = (url, config) => {\n\t// Set some sane defaults\n\tconst defaultConfig = {\n\t\tdata: {},\n\t\ttype: 'GET',\n\t\tdataType: '',\n\t\tsuccess: AnimeClient.noop,\n\t\tmimeType: 'application/x-www-form-urlencoded',\n\t\terror: AnimeClient.noop\n\t}\n\n\tconfig = {\n\t\t...defaultConfig,\n\t\t...config,\n\t}\n\n\tlet request = new XMLHttpRequest();\n\tlet method = String(config.type).toUpperCase();\n\n\tif (method === 'GET') {\n\t\turl += (url.match(/\\?/))\n\t\t\t? ajaxSerialize(config.data)\n\t\t\t: `?${ajaxSerialize(config.data)}`;\n\t}\n\n\trequest.open(method, url);\n\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tlet responseText = '';\n\n\t\t\tif (request.responseType === 'json') {\n\t\t\t\tresponseText = JSON.parse(request.responseText);\n\t\t\t} else {\n\t\t\t\tresponseText = request.responseText;\n\t\t\t}\n\n\t\t\tif (request.status > 299) {\n\t\t\t\tconfig.error.call(null, request.status, responseText, request.response);\n\t\t\t} else {\n\t\t\t\tconfig.success.call(null, responseText, request.status);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (config.dataType === 'json') {\n\t\tconfig.data = JSON.stringify(config.data);\n\t\tconfig.mimeType = 'application/json';\n\t} else {\n\t\tconfig.data = ajaxSerialize(config.data);\n\t}\n\n\trequest.setRequestHeader('Content-Type', config.mimeType);\n\n\tif (method === 'GET') {\n\t\trequest.send(null);\n\t} else {\n\t\trequest.send(config.data);\n\t}\n\n\treturn request\n};\n\n/**\n * Do a get request\n *\n * @param {string} url\n * @param {object|function} data\n * @param {function} [callback]\n * @return {XMLHttpRequest}\n */\nAnimeClient.get = (url, data, callback = null) => {\n\tif (callback === null) {\n\t\tcallback = data;\n\t\tdata = {};\n\t}\n\n\treturn AnimeClient.ajax(url, {\n\t\tdata,\n\t\tsuccess: callback\n\t});\n};\n\n// -------------------------------------------------------------------------\n// Export\n// -------------------------------------------------------------------------\n\nexport default AnimeClient;","import _ from './anime-client.js';\n\n// ----------------------------------------------------------------------------\n// Event subscriptions\n// ----------------------------------------------------------------------------\n_.on('header', 'click', '.message', hide);\n_.on('form.js-delete', 'submit', confirmDelete);\n_.on('.js-clear-cache', 'click', clearAPICache);\n_.on('.vertical-tabs input', 'change', scrollToSection);\n_.on('.media-filter', 'input', filterMedia);\n\n// ----------------------------------------------------------------------------\n// Handler functions\n// ----------------------------------------------------------------------------\n\n/**\n * Hide the html element attached to the event\n *\n * @param event\n * @return void\n */\nfunction hide (event) {\n\t_.hide(event.target)\n}\n\n/**\n * Confirm deletion of an item\n *\n * @param event\n * @return void\n */\nfunction confirmDelete (event) {\n\tconst proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');\n\n\tif (proceed === false) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}\n}\n\n/**\n * Clear the API cache, and show a message if the cache is cleared\n *\n * @return void\n */\nfunction clearAPICache () {\n\t_.get('/cache_purge', () => {\n\t\t_.showMessage('success', 'Successfully purged api cache');\n\t});\n}\n\n/**\n * Scroll to the accordion/vertical tab section just opened\n *\n * @param event\n * @return void\n */\nfunction scrollToSection (event) {\n\tconst el = event.currentTarget.parentElement;\n\tconst rect = el.getBoundingClientRect();\n\n\tconst top = rect.top + window.pageYOffset;\n\n\twindow.scrollTo({\n\t\ttop,\n\t\tbehavior: 'smooth',\n\t});\n}\n\n/**\n * Filter an anime or manga list\n *\n * @param event\n * @return void\n */\nfunction filterMedia (event) {\n\tconst rawFilter = event.target.value;\n\tconst filter = new RegExp(rawFilter, 'i');\n\n\t// console.log('Filtering items by: ', filter);\n\n\tif (rawFilter !== '') {\n\t\t// Filter the cover view\n\t\t_.$('article.media').forEach(article => {\n\t\t\tconst titleLink = _.$('.name a', article)[0];\n\t\t\tconst title = String(titleLink.textContent).trim();\n\t\t\tif ( ! filter.test(title)) {\n\t\t\t\t_.hide(article);\n\t\t\t} else {\n\t\t\t\t_.show(article);\n\t\t\t}\n\t\t});\n\n\t\t// Filter the list view\n\t\t_.$('table.media-wrap tbody tr').forEach(tr => {\n\t\t\tconst titleCell = _.$('td.align-left', tr)[0];\n\t\t\tconst titleLink = _.$('a', titleCell)[0];\n\t\t\tconst linkTitle = String(titleLink.textContent).trim();\n\t\t\tconst textTitle = String(titleCell.textContent).trim();\n\t\t\tif ( ! (filter.test(linkTitle) || filter.test(textTitle))) {\n\t\t\t\t_.hide(tr);\n\t\t\t} else {\n\t\t\t\t_.show(tr);\n\t\t\t}\n\t\t});\n\t} else {\n\t\t_.show('article.media');\n\t\t_.show('table.media-wrap tbody tr');\n\t}\n}\n","import './events.js';\n\nif ('serviceWorker' in navigator) {\n\tnavigator.serviceWorker.register('/sw.js').then(reg => {\n\t\tconsole.log('Service worker registered', reg.scope);\n\t}).catch(error => {\n\t\tconsole.error('Failed to register service worker', error);\n\t});\n}\n\n","import _ from './anime-client.js';\n\n(() => {\n\t// Var is intentional\n\tvar hidden = null;\n\tvar visibilityChange = null;\n\n\tif (typeof document.hidden !== \"undefined\") {\n\t\thidden = \"hidden\";\n\t\tvisibilityChange = \"visibilitychange\";\n\t} else if (typeof document.msHidden !== \"undefined\") {\n\t\thidden = \"msHidden\";\n\t\tvisibilityChange = \"msvisibilitychange\";\n\t} else if (typeof document.webkitHidden !== \"undefined\") {\n\t\thidden = \"webkitHidden\";\n\t\tvisibilityChange = \"webkitvisibilitychange\";\n\t}\n\n\tfunction handleVisibilityChange() {\n\t\t// Check the user's session to see if they are currently logged-in\n\t\t// when the page becomes visible\n\t\tif ( ! document[hidden]) {\n\t\t\t_.get('/heartbeat', (beat) => {\n\t\t\t\tconst status = JSON.parse(beat)\n\n\t\t\t\t// If the session is expired, immediately reload so that\n\t\t\t\t// you can't attempt to do an action that requires authentication\n\t\t\t\tif (status.hasAuth !== true) {\n\t\t\t\t\tdocument.removeEventListener(visibilityChange, handleVisibilityChange, false);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (hidden === null) {\n\t\tconsole.info('Page visibility API not supported, JS session check will not work');\n\t} else {\n\t\tdocument.addEventListener(visibilityChange, handleVisibilityChange, false);\n\t}\n})();","import _ from './anime-client.js';\n\n// Click on hidden MAL checkbox so\n// that MAL id is passed\n_.on('main', 'change', '.big-check', (e) => {\n\tconst id = e.target.id;\n\tdocument.getElementById(`mal_${id}`).checked = true;\n});\n\nexport function renderAnimeSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}\n\nexport function renderMangaSearchResults (data) {\n\tconst results = [];\n\n\tdata.forEach(x => {\n\t\tconst item = x.attributes;\n\t\tconst titles = item.titles.join('
');\n\n\t\tresults.push(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tInfo Page\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t`);\n\t});\n\n\treturn results.join('');\n}","import _ from './anime-client.js'\nimport { renderAnimeSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t// Show the loader\n\t_.show('.cssload-loader');\n\n\t// Do the api search\n\treturn _.get(_.url('/anime-collection/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\n\t\t// Hide the loader\n\t\t_.hide('.cssload-loader');\n\n\t\t// Show the results\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.anime #search')) {\n\tlet prevRequest = null;\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tconst query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n// Action to increment episode count\n_.on('body.anime.list', 'click', '.plus-one', (e) => {\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet watchedCount = parseInt(_.$('.completed_number', parentSel)[ 0 ].textContent, 10) || 0;\n\tlet totalCount = parseInt(_.$('.total_number', parentSel)[ 0 ].textContent, 10);\n\tlet title = _.$('.name a', parentSel)[ 0 ].textContent;\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: watchedCount + 1\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently watching\n\tif (isNaN(watchedCount) || watchedCount === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last episode, mark as completed\n\tif ((!isNaN(watchedCount)) && (watchedCount + 1) === totalCount) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t_.show('#loading-shadow');\n\n\t// okay, lets actually make some changes!\n\t_.ajax(_.url('/anime/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tsuccess: (res) => {\n\t\t\tconst resData = JSON.parse(res);\n\n\t\t\tif (resData.errors) {\n\t\t\t\t_.hide('#loading-shadow');\n\t\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t\t_.scrollToTop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resData.data.libraryEntry.update.libraryEntry.status === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.showMessage('success', `Successfully updated ${title}`);\n\t\t\t_.$('.completed_number', parentSel)[ 0 ].textContent = ++watchedCount;\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${title}. `);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});","import _ from './anime-client.js'\nimport { renderMangaSearchResults } from './template-helpers.js'\n\nconst search = (query) => {\n\t_.show('.cssload-loader');\n\treturn _.get(_.url('/manga/search'), { query }, (searchResults, status) => {\n\t\tsearchResults = JSON.parse(searchResults);\n\t\t_.hide('.cssload-loader');\n\t\t_.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data);\n\t});\n};\n\nif (_.hasElement('.manga #search')) {\n\tlet prevRequest = null\n\n\t_.on('#search', 'input', _.throttle(250, (e) => {\n\t\tlet query = encodeURIComponent(e.target.value);\n\t\tif (query === '') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (prevRequest !== null) {\n\t\t\tprevRequest.abort();\n\t\t}\n\n\t\tprevRequest = search(query);\n\t}));\n}\n\n/**\n * Javascript for editing manga, if logged in\n */\n_.on('.manga.list', 'click', '.edit-buttons button', (e) => {\n\tlet thisSel = e.target;\n\tlet parentSel = _.closestParent(e.target, 'article');\n\tlet type = thisSel.classList.contains('plus-one-chapter') ? 'chapter' : 'volume';\n\tlet completed = parseInt(_.$(`.${type}s_read`, parentSel)[ 0 ].textContent, 10) || 0;\n\tlet total = parseInt(_.$(`.${type}_count`, parentSel)[ 0 ].textContent, 10);\n\tlet mangaName = _.$('.name', parentSel)[ 0 ].textContent;\n\n\tif (isNaN(completed)) {\n\t\tcompleted = 0;\n\t}\n\n\t// Setup the update data\n\tlet data = {\n\t\tid: parentSel.dataset.kitsuId,\n\t\tmal_id: parentSel.dataset.malId,\n\t\tdata: {\n\t\t\tprogress: completed\n\t\t}\n\t};\n\n\t// If the episode count is 0, and incremented,\n\t// change status to currently reading\n\tif (isNaN(completed) || completed === 0) {\n\t\tdata.data.status = 'CURRENT';\n\t}\n\n\t// If you increment at the last chapter, mark as completed\n\tif ((!isNaN(completed)) && (completed + 1) === total) {\n\t\tdata.data.status = 'COMPLETED';\n\t}\n\n\t// Update the total count\n\tdata.data.progress = ++completed;\n\n\t_.show('#loading-shadow');\n\n\t_.ajax(_.url('/manga/increment'), {\n\t\tdata,\n\t\tdataType: 'json',\n\t\ttype: 'POST',\n\t\tmimeType: 'application/json',\n\t\tsuccess: () => {\n\t\t\tif (String(data.data.status).toUpperCase() === 'COMPLETED') {\n\t\t\t\t_.hide(parentSel);\n\t\t\t}\n\n\t\t\t_.hide('#loading-shadow');\n\n\t\t\t_.$(`.${type}s_read`, parentSel)[ 0 ].textContent = completed;\n\t\t\t_.showMessage('success', `Successfully updated ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t},\n\t\terror: () => {\n\t\t\t_.hide('#loading-shadow');\n\t\t\t_.showMessage('error', `Failed to update ${mangaName}`);\n\t\t\t_.scrollToTop();\n\t\t}\n\t});\n});"],"names":["selector","m","querySelectorAll","elm","document","ownerDocument","i","matches","length","item","noop","$","context","nodeType","elements","match","push","getElementById","split","slice","apply","hasElement","AnimeClient","scrollToTop","el","scrollIntoView","hide","sel","Array","isArray","forEach","setAttribute","show","removeAttribute","showMessage","type","message","template","undefined","remove","insertAdjacentHTML","closestParent","current","parentSelector","Element","prototype","closest","documentElement","parentElement","url","path","uri","location","host","charAt","throttle","interval","fn","scope","wait","args","setTimeout","addEvent","event","listener","evt","addEventListener","delegateEvent","target","e","element","call","stopPropagation","on","AnimeClient.on","ajaxSerialize","data","pairs","Object","keys","name","value","toString","encodeURIComponent","join","ajax","AnimeClient.ajax","config","dataType","success","mimeType","error","defaultConfig","request","XMLHttpRequest","method","String","toUpperCase","open","onreadystatechange","request.onreadystatechange","readyState","responseText","responseType","JSON","parse","status","response","stringify","setRequestHeader","send","get","AnimeClient.get","callback","confirmDelete","clearAPICache","scrollToSection","filterMedia","_","proceed","preventDefault","window","scrollTo","top","behavior","rawFilter","article","filter","test","title","tr","titleCell","linkTitle","textTitle","navigator","serviceWorker","register","then","reg","console","log","catch","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","beat","hasAuth","removeEventListener","reload","info","id","checked","renderAnimeSearchResults","x","results","slug","mal_id","canonicalTitle","titles","renderMangaSearchResults","query","searchResults","prevRequest","abort","search","parentSel","watchedCount","parseInt","totalCount","dataset","kitsuId","malId","progress","isNaN","res","resData","errors","libraryEntry","update","thisSel","classList","contains","completed","total","mangaName"],"mappings":"Y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AA,CAAc,OAAdA,CAAuB,mBAAvBA,CAA2CoE,SAA3CpE,CACAA,YAAAA,YAAAA,EAHY,CAhBoB,CAAlCA,CArC2D;"} \ No newline at end of file From 238a42380621dd206a56bfe14ce1a56bcfc050f7 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 7 Oct 2020 15:30:42 -0400 Subject: [PATCH 70/86] Fix updating anime status when certain fields are empty --- app/views/anime/edit.php | 2 +- src/AnimeClient/API/Kitsu/ListItem.php | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/views/anime/edit.php b/app/views/anime/edit.php index 500f777d..6d9a8ff2 100644 --- a/app/views/anime/edit.php +++ b/app/views/anime/edit.php @@ -32,7 +32,7 @@ diff --git a/src/AnimeClient/API/Kitsu/ListItem.php b/src/AnimeClient/API/Kitsu/ListItem.php index d3db19b2..258bf108 100644 --- a/src/AnimeClient/API/Kitsu/ListItem.php +++ b/src/AnimeClient/API/Kitsu/ListItem.php @@ -143,16 +143,27 @@ final class ListItem extends AbstractListItem { */ public function update(string $id, FormItemData $data): Request { - return $this->requestBuilder->mutateRequest('UpdateLibraryItem', [ + // Data to always send + $updateData = [ 'id' => $id, 'notes' => $data['notes'], 'private' => (bool)$data['private'], - 'progress' => (int)$data['progress'], - 'ratingTwenty' => (int)$data['ratingTwenty'], 'reconsumeCount' => (int)$data['reconsumeCount'], 'reconsuming' => (bool)$data['reconsuming'], 'status' => strtoupper($data['status']), - ]); + ]; + + // Only send these variables if they have a value + if ($data['progress'] !== NULL) + { + $updateData['progress'] = (int)$data['progress']; + } + if ($data['ratingTwenty'] !== NULL) + { + $updateData['ratingTwenty'] = (int)$data['ratingTwenty']; + } + + return $this->requestBuilder->mutateRequest('UpdateLibraryItem', $updateData); } /** From 58669f023c17a4b980d3959bc8d4f337b6717e6b Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 9 Oct 2020 16:16:23 -0400 Subject: [PATCH 71/86] Update dependency versions, add Amp base package as dependency --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bc469397..46b5f80a 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ } }, "require": { - "amphp/http-client": "^4.2.2", + "amphp/amp": "^2.5.0", + "amphp/http-client": "^4.5.0", "aura/html": "^2.5.0", "aura/router": "^3.1.0", "aura/session": "^2.1.0", @@ -66,7 +67,7 @@ "phpstan/phpstan": "^0.12.19", "phpunit/phpunit": "^8.5.2", "roave/security-advisories": "dev-master", - "robmorgan/phinx": "^0.10.6", + "robmorgan/phinx": "^0.12.4", "sebastian/phpcpd": "^4.1.0", "spatie/phpunit-snapshot-assertions": "^4.1.0", "squizlabs/php_codesniffer": "^3.5.4", From 30db156df7b3e9ce7a8a433c17493797c6e38c87 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 9 Oct 2020 16:18:45 -0400 Subject: [PATCH 72/86] Pull anime lists from GraphQL, see #33 --- src/AnimeClient/API/Kitsu/AnimeTrait.php | 48 +++++- src/AnimeClient/API/Kitsu/Model.php | 83 +++++++++- .../API/Kitsu/Queries/GetLibrary.graphql | 3 + src/AnimeClient/API/Kitsu/RequestBuilder.php | 63 +++---- .../Transformer/AnimeListTransformer.php | 49 +++--- .../Transformer/OldAnimeListTransformer.php | 156 ++++++++++++++++++ src/AnimeClient/AnimeClient.php | 1 - src/AnimeClient/Controller/Anime.php | 4 +- .../Transformer/AnimeListTransformerTest.php | 4 +- 9 files changed, 340 insertions(+), 71 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index dc50309b..2c6a20cf 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -17,11 +17,12 @@ namespace Aviat\AnimeClient\API\Kitsu; use Amp\Http\Client\Request; +use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeHistoryTransformer; -use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer; use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; use Aviat\AnimeClient\API\ParallelAPIRequest; @@ -39,9 +40,9 @@ trait AnimeTrait { * to a common format used by * templates * - * @var AnimeListTransformer + * @var OldAnimeListTransformer */ - protected AnimeListTransformer $animeListTransformer; + protected OldAnimeListTransformer $oldListTransformer; /** * @var AnimeTransformer @@ -124,6 +125,45 @@ trait AnimeTrait { $list = $this->cache->get($key, NULL); + if ($list === NULL) + { + $data = $this->getRawList(ListType::ANIME, $status) ?? []; + + // Bail out on no data + if (empty($data)) + { + return []; + } + + $transformer = new AnimeListTransformer(); + $transformed = $transformer->transformCollection($data); + $keyed = []; + + foreach($transformed as $item) + { + $keyed[$item['id']] = $item; + } + + $list = $keyed; + $this->cache->set($key, $list); + } + + return $list; + } + + /** + * Get the anime list for the configured user + * + * @param string $status - The watching status to filter the list with + * @return array + * @throws InvalidArgumentException + */ + public function oldGetAnimeList(string $status): array + { + $key = "kitsu-anime-list-{$status}"; + + $list = $this->cache->get($key, NULL); + if ($list === NULL) { $data = $this->getRawAnimeList($status) ?? []; @@ -142,7 +182,7 @@ trait AnimeTrait { $item['included'] = $included; } unset($item); - $transformed = $this->animeListTransformer->transformCollection($data['data']); + $transformed = $this->oldListTransformer->transformCollection($data['data']); $keyed = []; foreach($transformed as $item) diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 89db3804..4db7c866 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -17,7 +17,9 @@ namespace Aviat\AnimeClient\API\Kitsu; use function Amp\Promise\wait; +use function Aviat\AnimeClient\getApiClient; +use Amp; use Amp\Http\Client\Request; use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\{ @@ -27,7 +29,7 @@ use Aviat\AnimeClient\API\{ }; use Aviat\AnimeClient\API\Kitsu\Transformer\{ AnimeTransformer, - AnimeListTransformer, + OldAnimeListTransformer, LibraryEntryTransformer, MangaTransformer, MangaListTransformer @@ -49,7 +51,7 @@ final class Model { use MangaTrait; use MutationTrait; - protected const LIST_PAGE_SIZE = 75; + protected const LIST_PAGE_SIZE = 100; /** * @var ListItem @@ -64,7 +66,7 @@ final class Model { public function __construct(ListItem $listItem) { $this->animeTransformer = new AnimeTransformer(); - $this->animeListTransformer = new AnimeListTransformer(); + $this->oldListTransformer = new OldAnimeListTransformer(); $this->mangaTransformer = new MangaTransformer(); $this->mangaListTransformer = new MangaListTransformer(); @@ -351,6 +353,81 @@ final class Model { ]); } + /** + * Get the raw anime/manga list from GraphQL + * + * @param string $type + * @param string $status + * @return array + */ + public function getRawList(string $type, string $status = ''): array + { + $pages = []; + + foreach ($this->getRawListPages(strtoupper($type), strtoupper($status)) as $page) + { + $pages[] = $page; + } + + return array_merge(...$pages); + } + + protected function getRawListPages(string $type, string $status = ''): ?\Generator + { + $items = $this->getRawPages($type, $status); + + while (wait($items->advance())) + { + yield $items->getCurrent(); + } + } + + protected function getRawPages(string $type, string $status = ''): Amp\Iterator + { + $cursor = ''; + $username = $this->getUsername(); + + return new Amp\Producer(function (callable $emit) use ($type, $status, $cursor, $username) { + while (TRUE) + { + $vars = [ + 'type' => $type, + 'slug' => $username, + ]; + if ($status !== '') + { + $vars['status'] = $status; + } + if ($cursor !== '') + { + $vars['after'] = $cursor; + } + + $request = $this->requestBuilder->queryRequest('GetLibrary', $vars); + $response = yield getApiClient()->request($request); + $json = yield $response->getBody()->buffer(); + + $rawData = Json::decode($json); + $data = $rawData['data']['findProfileBySlug']['library']['all'] ?? []; + $page = $data['pageInfo']; + if (empty($data)) + { + // @TODO Error logging + break; + } + + $cursor = $page['endCursor']; + + yield $emit($data['nodes']); + + if ($page['hasNextPage'] === FALSE) + { + break; + } + } + }); + } + private function getUserId(): string { static $userId = NULL; diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql index cf87b320..e28e44a5 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql @@ -52,6 +52,8 @@ query ( sfw slug status + startDate + endDate type titles { canonical @@ -60,6 +62,7 @@ query ( } ...on Anime { episodeCount + episodeLength streamingLinks(first: 10) { nodes { dubs diff --git a/src/AnimeClient/API/Kitsu/RequestBuilder.php b/src/AnimeClient/API/Kitsu/RequestBuilder.php index e103c42a..2afb4d6c 100644 --- a/src/AnimeClient/API/Kitsu/RequestBuilder.php +++ b/src/AnimeClient/API/Kitsu/RequestBuilder.php @@ -180,14 +180,7 @@ final class RequestBuilder extends APIRequestBuilder { return ($response->getStatus() === 204); } - /** - * Run a GraphQL API query - * - * @param string $name - * @param array $variables - * @return array - */ - public function runQuery(string $name, array $variables = []): array + public function queryRequest(string $name, array $variables = []): Request { $file = __DIR__ . "/Queries/{$name}.graphql"; if ( ! file_exists($file)) @@ -209,11 +202,33 @@ final class RequestBuilder extends APIRequestBuilder { } } - return $this->graphResponse([ - 'body' => $body + return $this->setUpRequest('POST', K::GRAPHQL_ENDPOINT, [ + 'body' => $body, ]); } + /** + * Run a GraphQL API query + * + * @param string $name + * @param array $variables + * @return array + */ + public function runQuery(string $name, array $variables = []): array + { + $request = $this->queryRequest($name, $variables); + $response = getResponse($request); + $validResponseCodes = [200, 201]; + + if ( ! \in_array($response->getStatus(), $validResponseCodes, TRUE)) + { + $logger = $this->container->getLogger('kitsu-graphql'); + $logger->warning('Non 200 response for GraphQL call', (array)$response->getBody()); + } + + return Json::decode(wait($response->getBody()->buffer())); + } + /** * @param string $name * @param array $variables @@ -256,6 +271,13 @@ final class RequestBuilder extends APIRequestBuilder { { $request = $this->mutateRequest($name, $variables); $response = getResponse($request); + $validResponseCodes = [200, 201]; + + if ( ! \in_array($response->getStatus(), $validResponseCodes, TRUE)) + { + $logger = $this->container->getLogger('kitsu-graphql'); + $logger->warning('Non 200 response for GraphQL call', (array)$response->getBody()); + } return Json::decode(wait($response->getBody()->buffer())); } @@ -286,27 +308,6 @@ final class RequestBuilder extends APIRequestBuilder { return $response; } - /** - * Remove some boilerplate for GraphQL requests - * - * @param array $options - * @return array - * @throws \Throwable - */ - protected function graphResponse(array $options = []): array - { - $response = $this->getResponse('POST', K::GRAPHQL_ENDPOINT, $options); - $validResponseCodes = [200, 201]; - - if ( ! \in_array($response->getStatus(), $validResponseCodes, TRUE)) - { - $logger = $this->container->getLogger('kitsu-graphql'); - $logger->warning('Non 200 response for GraphQL call', (array)$response->getBody()); - } - - return Json::decode(wait($response->getBody()->buffer())); - } - /** * Make a request * diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php index 078b8105..4a2c0e40 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeListTransformer.php @@ -38,34 +38,27 @@ final class AnimeListTransformer extends AbstractTransformer { */ public function transform($item): AnimeListItem { - $included = $item['included']; - $animeId = $item['relationships']['media']['data']['id']; - $anime = $included['anime'][$animeId]; + $animeId = $item['media']['id']; + $anime = $item['media']; $genres = []; - foreach($anime['relationships']['categories'] as $genre) - { - $genres[] = $genre['title']; - } - - sort($genres); - - $rating = (int) $item['attributes']['ratingTwenty'] !== 0 - ? $item['attributes']['ratingTwenty'] / 2 + $rating = (int) $item['rating'] !== 0 + ? (int)$item['rating'] / 2 : '-'; - $total_episodes = array_key_exists('episodeCount', $anime) && (int) $anime['episodeCount'] !== 0 + $total_episodes = (int) $anime['episodeCount'] !== 0 ? (int) $anime['episodeCount'] : '-'; $MALid = NULL; - if (array_key_exists('mappings', $anime['relationships'])) + $mappings = $anime['mappings']['nodes'] ?? []; + if ( ! empty($mappings)) { - foreach ($anime['relationships']['mappings'] as $mapping) + foreach ($mappings as $mapping) { - if ($mapping['externalSite'] === 'myanimelist/anime') + if ($mapping['externalSite'] === 'MYANIMELIST_ANIME') { $MALid = $mapping['externalId']; break; @@ -73,19 +66,19 @@ final class AnimeListTransformer extends AbstractTransformer { } } - $streamingLinks = array_key_exists('streamingLinks', $anime['relationships']) - ? Kitsu::parseListItemStreamingLinks($included, $animeId) + $streamingLinks = array_key_exists('nodes', $anime['streamingLinks']) + ? Kitsu::parseStreamingLinks($anime['streamingLinks']['nodes']) : []; - $titles = Kitsu::filterTitles($anime); - $title = array_shift($titles); + $titles = Kitsu::getFilteredTitles($anime['titles']); + $title = $anime['titles']['canonical']; return AnimeListItem::from([ 'id' => $item['id'], 'mal_id' => $MALid, 'episodes' => [ - 'watched' => (int) $item['attributes']['progress'] !== 0 - ? (int) $item['attributes']['progress'] + 'watched' => (int) $item['progress'] !== 0 + ? (int) $item['progress'] : '-', 'total' => $total_episodes, 'length' => $anime['episodeLength'], @@ -102,16 +95,16 @@ final class AnimeListTransformer extends AbstractTransformer { 'titles' => $titles, 'slug' => $anime['slug'], 'show_type' => (string)StringType::from($anime['subtype'])->upperCaseFirst(), - 'cover_image' => $anime['posterImage']['small'], + 'cover_image' => $anime['posterImage']['views'][1]['url'], 'genres' => $genres, 'streaming_links' => $streamingLinks, ], - 'watching_status' => $item['attributes']['status'], - 'notes' => $item['attributes']['notes'], - 'rewatching' => (bool) $item['attributes']['reconsuming'], - 'rewatched' => (int) $item['attributes']['reconsumeCount'], + 'watching_status' => $item['status'], + 'notes' => $item['notes'], + 'rewatching' => (bool) $item['reconsuming'], + 'rewatched' => (int) $item['reconsumeCount'], 'user_rating' => $rating, - 'private' => $item['attributes']['private'] ?? FALSE, + 'private' => $item['private'] ?? FALSE, ]); } diff --git a/src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php new file mode 100644 index 00000000..0268eb16 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php @@ -0,0 +1,156 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu\Transformer; + +use Aviat\AnimeClient\Kitsu; +use Aviat\AnimeClient\Types\{ + FormItem, + AnimeListItem +}; +use Aviat\Ion\Transformer\AbstractTransformer; +use Aviat\Ion\Type\StringType; + +/** + * Transformer for anime list + */ +final class OldAnimeListTransformer extends AbstractTransformer { + + /** + * Convert raw api response to a more + * logical and workable structure + * + * @param array $item API library item + * @return AnimeListItem + */ + public function transform($item): AnimeListItem + { + $included = $item['included']; + $animeId = $item['relationships']['media']['data']['id']; + $anime = $included['anime'][$animeId]; + + $genres = []; + + foreach($anime['relationships']['categories'] as $genre) + { + $genres[] = $genre['title']; + } + + sort($genres); + + $rating = (int) $item['attributes']['ratingTwenty'] !== 0 + ? $item['attributes']['ratingTwenty'] / 2 + : '-'; + + $total_episodes = array_key_exists('episodeCount', $anime) && (int) $anime['episodeCount'] !== 0 + ? (int) $anime['episodeCount'] + : '-'; + + $MALid = NULL; + + if (array_key_exists('mappings', $anime['relationships'])) + { + foreach ($anime['relationships']['mappings'] as $mapping) + { + if ($mapping['externalSite'] === 'myanimelist/anime') + { + $MALid = $mapping['externalId']; + break; + } + } + } + + $streamingLinks = array_key_exists('streamingLinks', $anime['relationships']) + ? Kitsu::parseListItemStreamingLinks($included, $animeId) + : []; + + $titles = Kitsu::filterTitles($anime); + $title = array_shift($titles); + + return AnimeListItem::from([ + 'id' => $item['id'], + 'mal_id' => $MALid, + 'episodes' => [ + 'watched' => (int) $item['attributes']['progress'] !== 0 + ? (int) $item['attributes']['progress'] + : '-', + 'total' => $total_episodes, + 'length' => $anime['episodeLength'], + ], + 'airing' => [ + 'status' => Kitsu::getAiringStatus($anime['startDate'], $anime['endDate']), + 'started' => $anime['startDate'], + 'ended' => $anime['endDate'] + ], + 'anime' => [ + 'id' => $animeId, + 'age_rating' => $anime['ageRating'], + 'title' => $title, + 'titles' => $titles, + 'slug' => $anime['slug'], + 'show_type' => (string)StringType::from($anime['subtype'])->upperCaseFirst(), + 'cover_image' => $anime['posterImage']['small'], + 'genres' => $genres, + 'streaming_links' => $streamingLinks, + ], + 'watching_status' => $item['attributes']['status'], + 'notes' => $item['attributes']['notes'], + 'rewatching' => (bool) $item['attributes']['reconsuming'], + 'rewatched' => (int) $item['attributes']['reconsumeCount'], + 'user_rating' => $rating, + 'private' => $item['attributes']['private'] ?? FALSE, + ]); + } + + /** + * Convert transformed data to + * api response format + * + * @param array $item Transformed library item + * @return FormItem API library item + */ + public function untransform($item): FormItem + { + $privacy = (array_key_exists('private', $item) && $item['private']); + $rewatching = (array_key_exists('rewatching', $item) && $item['rewatching']); + + $untransformed = FormItem::from([ + 'id' => $item['id'], + 'anilist_item_id' => $item['anilist_item_id'] ?? NULL, + 'mal_id' => $item['mal_id'] ?? NULL, + 'data' => [ + 'status' => $item['watching_status'], + 'reconsuming' => $rewatching, + 'reconsumeCount' => $item['rewatched'], + 'notes' => $item['notes'], + 'private' => $privacy + ] + ]); + + if (is_numeric($item['episodes_watched']) && $item['episodes_watched'] > 0) + { + $untransformed['data']['progress'] = (int) $item['episodes_watched']; + } + + if (is_numeric($item['user_rating']) && $item['user_rating'] > 0) + { + $untransformed['data']['ratingTwenty'] = $item['user_rating'] * 2; + } + + return $untransformed; + } +} +// End of AnimeListTransformer.php \ No newline at end of file diff --git a/src/AnimeClient/AnimeClient.php b/src/AnimeClient/AnimeClient.php index c9c70216..3aa76ffe 100644 --- a/src/AnimeClient/AnimeClient.php +++ b/src/AnimeClient/AnimeClient.php @@ -240,7 +240,6 @@ function getResponse ($request): Response $request = new Request($request); } - return wait($client->request($request)); } diff --git a/src/AnimeClient/Controller/Anime.php b/src/AnimeClient/Controller/Anime.php index 41326edc..1a5e17dc 100644 --- a/src/AnimeClient/Controller/Anime.php +++ b/src/AnimeClient/Controller/Anime.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient\Controller; use Aura\Router\Exception\RouteNotFound; use Aviat\AnimeClient\Controller as BaseController; -use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; use Aviat\AnimeClient\Model\Anime as AnimeModel; @@ -228,7 +228,7 @@ final class Anime extends BaseController { // Do some minor data manipulation for // large form-based updates - $transformer = new AnimeListTransformer(); + $transformer = new OldAnimeListTransformer(); $postData = $transformer->untransform($data); $fullResult = $this->model->updateLibraryItem(FormItem::from($postData)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php index ad742a8a..bdb1f81f 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php @@ -16,7 +16,7 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; use Aviat\AnimeClient\Tests\AnimeClientTestCase; use Aviat\Ion\Friend; use Aviat\Ion\Json; @@ -33,7 +33,7 @@ class AnimeListTransformerTest extends AnimeClientTestCase { $this->beforeTransform = Json::decodeFile("{$this->dir}/animeListItemBeforeTransform.json"); - $this->transformer = new AnimeListTransformer(); + $this->transformer = new OldAnimeListTransformer(); } public function testTransform() From dddef5add6dd896b44f6d283581cc4d54e25a502 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 12 Oct 2020 14:06:49 -0400 Subject: [PATCH 73/86] Fix Manga List Incrementing, start of GraphQL conversion --- src/AnimeClient/API/Kitsu/MangaTrait.php | 6 +- src/AnimeClient/API/Kitsu/Model.php | 4 +- .../Mutations/IncrementLibraryItem.graphql | 2 +- .../Transformer/OldMangaListTransformer.php | 148 ++++++++++++++++++ src/AnimeClient/Controller/Manga.php | 8 +- .../Transformer/MangaListTransformerTest.php | 4 +- 6 files changed, 161 insertions(+), 11 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index ef2b15fa..45d50fac 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -21,7 +21,7 @@ use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\MangaReadingStatus\Kitsu as KitsuReadingStatus; use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaHistoryTransformer; -use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; use Aviat\AnimeClient\API\Mapping\MangaReadingStatus; use Aviat\AnimeClient\API\ParallelAPIRequest; @@ -40,9 +40,9 @@ trait MangaTrait { protected MangaTransformer $mangaTransformer; /** - * @var MangaListTransformer + * @var OldMangaListTransformer */ - protected MangaListTransformer $mangaListTransformer; + protected OldMangaListTransformer $mangaListTransformer; // ------------------------------------------------------------------------- // ! Manga-specific methods diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 4db7c866..25d4083d 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -32,7 +32,7 @@ use Aviat\AnimeClient\API\Kitsu\Transformer\{ OldAnimeListTransformer, LibraryEntryTransformer, MangaTransformer, - MangaListTransformer + OldMangaListTransformer }; use Aviat\Banker\Exception\InvalidArgumentException; @@ -68,7 +68,7 @@ final class Model { $this->animeTransformer = new AnimeTransformer(); $this->oldListTransformer = new OldAnimeListTransformer(); $this->mangaTransformer = new MangaTransformer(); - $this->mangaListTransformer = new MangaListTransformer(); + $this->mangaListTransformer = new OldMangaListTransformer(); $this->listItem = $listItem; } diff --git a/src/AnimeClient/API/Kitsu/Mutations/IncrementLibraryItem.graphql b/src/AnimeClient/API/Kitsu/Mutations/IncrementLibraryItem.graphql index 1ad752b3..190b9d2d 100644 --- a/src/AnimeClient/API/Kitsu/Mutations/IncrementLibraryItem.graphql +++ b/src/AnimeClient/API/Kitsu/Mutations/IncrementLibraryItem.graphql @@ -1,4 +1,4 @@ -mutation($id: ID!, $progress: Int) { +mutation($id: ID!, $progress: Int!) { libraryEntry{ update(input: { id: $id, progress: $progress }) { libraryEntry { diff --git a/src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php new file mode 100644 index 00000000..4f645f23 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php @@ -0,0 +1,148 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\API\Kitsu\Transformer; + +use Aviat\AnimeClient\Kitsu; +use Aviat\AnimeClient\Types\{ + FormItem, FormItemData, + MangaListItem, MangaListItemDetail +}; +use Aviat\Ion\Transformer\AbstractTransformer; +use Aviat\Ion\Type\StringType; + +/** + * Data transformation class for zippered Hummingbird manga + */ +final class OldMangaListTransformer extends AbstractTransformer { + /** + * Remap zipped anime data to a more logical form + * + * @param array $item manga entry item + * @return MangaListItem + */ + public function transform($item): MangaListItem + { + $included = $item['included']; + $mangaId = $item['relationships']['media']['data']['id']; + $manga = $included['manga'][$mangaId]; + + $genres = []; + + foreach ($manga['relationships']['categories'] as $genre) + { + $genres[] = $genre['title']; + } + + sort($genres); + + $rating = (int) $item['attributes']['ratingTwenty'] !== 0 + ? $item['attributes']['ratingTwenty'] / 2 + : '-'; + + $totalChapters = ((int) $manga['chapterCount'] !== 0) + ? $manga['chapterCount'] + : '-'; + + $totalVolumes = ((int) $manga['volumeCount'] !== 0) + ? $manga['volumeCount'] + : '-'; + + $readChapters = ((int) $item['attributes']['progress'] !== 0) + ? $item['attributes']['progress'] + : '-'; + + $MALid = NULL; + + if (array_key_exists('mappings', $manga['relationships'])) + { + foreach ($manga['relationships']['mappings'] as $mapping) + { + if ($mapping['externalSite'] === 'myanimelist/manga') + { + $MALid = $mapping['externalId']; + break; + } + } + } + + $titles = Kitsu::filterTitles($manga); + $title = array_shift($titles); + + return MangaListItem::from([ + 'id' => $item['id'], + 'mal_id' => $MALid, + 'chapters' => [ + 'read' => $readChapters, + 'total' => $totalChapters + ], + 'volumes' => [ + 'read' => '-', //$item['attributes']['volumes_read'], + 'total' => $totalVolumes + ], + 'manga' => MangaListItemDetail::from([ + 'genres' => $genres, + 'id' => $mangaId, + 'image' => $manga['posterImage']['small'], + 'slug' => $manga['slug'], + 'title' => $title, + 'titles' => $titles, + 'type' => (string)StringType::from($manga['subtype'])->upperCaseFirst(), + 'url' => 'https://kitsu.io/manga/' . $manga['slug'], + ]), + 'reading_status' => $item['attributes']['status'], + 'notes' => $item['attributes']['notes'], + 'rereading' => (bool)$item['attributes']['reconsuming'], + 'reread' => $item['attributes']['reconsumeCount'], + 'user_rating' => $rating, + ]); + } + + /** + * Untransform data to update the api + * + * @param array $item + * @return FormItem + */ + public function untransform($item): FormItem + { + $rereading = array_key_exists('rereading', $item) && (bool)$item['rereading']; + + $map = FormItem::from([ + 'id' => $item['id'], + 'mal_id' => $item['mal_id'], + 'data' => FormItemData::from([ + 'status' => $item['status'], + 'reconsuming' => $rereading, + 'reconsumeCount' => (int)$item['reread_count'], + 'notes' => $item['notes'], + ]), + ]); + + if (is_numeric($item['chapters_read']) && $item['chapters_read'] > 0) + { + $map['data']['progress'] = (int)$item['chapters_read']; + } + + if (is_numeric($item['new_rating']) && $item['new_rating'] > 0) + { + $map['data']['ratingTwenty'] = $item['new_rating'] * 2; + } + + return $map; + } +} +// End of MangaListTransformer.php \ No newline at end of file diff --git a/src/AnimeClient/Controller/Manga.php b/src/AnimeClient/Controller/Manga.php index 3775fc30..55cb03ab 100644 --- a/src/AnimeClient/Controller/Manga.php +++ b/src/AnimeClient/Controller/Manga.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient\Controller; use Aura\Router\Exception\RouteNotFound; use Aviat\AnimeClient\Controller; -use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; use Aviat\AnimeClient\API\Mapping\MangaReadingStatus; use Aviat\AnimeClient\Model\Manga as MangaModel; use Aviat\AnimeClient\Types\FormItem; @@ -229,7 +229,7 @@ final class Manga extends Controller { // Do some minor data manipulation for // large form-based updates - $transformer = new MangaListTransformer(); + $transformer = new OldMangaListTransformer(); $post_data = $transformer->untransform($data); $full_result = $this->model->updateLibraryItem(FormItem::from($post_data)); @@ -264,7 +264,9 @@ final class Manga extends Controller { $data = $this->request->getParsedBody(); } - [$body, $statusCode] = $this->model->incrementLibraryItem(FormItem::from($data)); + $res = $this->model->incrementLibraryItem(FormItem::from($data)); + $body = $res['body']; + $statusCode = $res['statusCode']; $this->cache->clear(); $this->outputJSON($body, $statusCode); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php index 34561157..7a2fe86b 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php @@ -17,7 +17,7 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; use Aviat\AnimeClient\API\JsonAPI; -use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; use Aviat\AnimeClient\Tests\AnimeClientTestCase; use Aviat\AnimeClient\Types\{ FormItem, @@ -52,7 +52,7 @@ class MangaListTransformerTest extends AnimeClientTestCase { $this->beforeTransform = $rawBefore['data']; // $this->afterTransform = Json::decodeFile("{$this->dir}/mangaListAfterTransform.json"); - $this->transformer = new MangaListTransformer(); + $this->transformer = new OldMangaListTransformer(); } public function testTransform() From 22de5776a787a96729ce8cfdbc197e93df1bd387 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 16 Oct 2020 13:28:35 -0400 Subject: [PATCH 74/86] Fetch Manga List via GraphQL, see #33 --- src/AnimeClient/API/Kitsu/AnimeTrait.php | 47 ------------------- src/AnimeClient/API/Kitsu/MangaTrait.php | 38 ++++----------- .../API/Kitsu/Queries/GetLibrary.graphql | 1 + .../Transformer/MangaListTransformer.php | 44 ++++++++--------- 4 files changed, 30 insertions(+), 100 deletions(-) diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index 2c6a20cf..fab16c70 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -20,7 +20,6 @@ use Amp\Http\Client\Request; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; -use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeHistoryTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer; @@ -151,52 +150,6 @@ trait AnimeTrait { return $list; } - /** - * Get the anime list for the configured user - * - * @param string $status - The watching status to filter the list with - * @return array - * @throws InvalidArgumentException - */ - public function oldGetAnimeList(string $status): array - { - $key = "kitsu-anime-list-{$status}"; - - $list = $this->cache->get($key, NULL); - - if ($list === NULL) - { - $data = $this->getRawAnimeList($status) ?? []; - - // Bail out on no data - if (empty($data)) - { - return []; - } - - $included = JsonAPI::organizeIncludes($data['included']); - $included = JsonAPI::inlineIncludedRelationships($included, 'anime'); - - foreach($data['data'] as $i => &$item) - { - $item['included'] = $included; - } - unset($item); - $transformed = $this->oldListTransformer->transformCollection($data['data']); - $keyed = []; - - foreach($transformed as $item) - { - $keyed[$item['id']] = $item; - } - - $list = $keyed; - $this->cache->set($key, $list); - } - - return $list; - } - /** * Get the number of anime list items * diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index 45d50fac..94168d0d 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -21,6 +21,7 @@ use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\MangaReadingStatus\Kitsu as KitsuReadingStatus; use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaHistoryTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; use Aviat\AnimeClient\API\Mapping\MangaReadingStatus; @@ -109,54 +110,35 @@ trait MangaTrait { * Get the manga list for the configured user * * @param string $status - The reading status by which to filter the list - * @param int $limit - The number of list items to fetch per page - * @param int $offset - The page offset * @return array * @throws InvalidArgumentException */ - public function getMangaList(string $status, int $limit = 200, int $offset = 0): array + public function getMangaList(string $status): array { - $options = [ - 'query' => [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => 'manga', - 'status' => $status, - ], - 'include' => 'media,media.categories,media.mappings', - 'page' => [ - 'offset' => $offset, - 'limit' => $limit - ], - 'sort' => '-updated_at' - ] - ]; - $key = "kitsu-manga-list-{$status}"; $list = $this->cache->get($key, NULL); if ($list === NULL) { - $data = $this->requestBuilder->getRequest('library-entries', $options) ?? []; + $data = $this->getRawList(ListType::MANGA, $status) ?? []; // Bail out on no data - if (empty($data) || ( ! array_key_exists('included', $data))) + if (empty($data)) { return []; } - $included = JsonAPI::organizeIncludes($data['included']); - $included = JsonAPI::inlineIncludedRelationships($included, 'manga'); + $transformer = new MangaListTransformer(); + $transformed = $transformer->transformCollection($data); + $keyed = []; - foreach($data['data'] as $i => &$item) + foreach($transformed as $item) { - $item['included'] = $included; + $keyed[$item['id']] = $item; } - unset($item); - - $list = $this->mangaListTransformer->transformCollection($data['data']); + $list = $keyed; $this->cache->set($key, $list); } diff --git a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql index e28e44a5..f2dd3bdd 100644 --- a/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql +++ b/src/AnimeClient/API/Kitsu/Queries/GetLibrary.graphql @@ -79,6 +79,7 @@ query ( } ...on Manga { chapterCount + volumeCount subtype } } diff --git a/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php index 435faf34..81a9d930 100644 --- a/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php +++ b/src/AnimeClient/API/Kitsu/Transformer/MangaListTransformer.php @@ -36,21 +36,14 @@ final class MangaListTransformer extends AbstractTransformer { */ public function transform($item): MangaListItem { - $included = $item['included']; - $mangaId = $item['relationships']['media']['data']['id']; - $manga = $included['manga'][$mangaId]; + $mangaId = $item['media']['id']; + $manga = $item['media']; $genres = []; - foreach ($manga['relationships']['categories'] as $genre) - { - $genres[] = $genre['title']; - } - - sort($genres); - - $rating = (int) $item['attributes']['ratingTwenty'] !== 0 - ? $item['attributes']['ratingTwenty'] / 2 + // Rating is 1-20, we want 1-10 + $rating = (int) $item['rating'] !== 0 + ? $item['rating'] / 2 : '-'; $totalChapters = ((int) $manga['chapterCount'] !== 0) @@ -61,17 +54,18 @@ final class MangaListTransformer extends AbstractTransformer { ? $manga['volumeCount'] : '-'; - $readChapters = ((int) $item['attributes']['progress'] !== 0) - ? $item['attributes']['progress'] + $readChapters = ((int) $item['progress'] !== 0) + ? $item['progress'] : '-'; $MALid = NULL; - if (array_key_exists('mappings', $manga['relationships'])) + $mappings = $manga['mappings']['nodes'] ?? []; + if ( ! empty($mappings)) { - foreach ($manga['relationships']['mappings'] as $mapping) + foreach ($mappings as $mapping) { - if ($mapping['externalSite'] === 'myanimelist/manga') + if ($mapping['externalSite'] === 'MYANIMELIST_MANGA') { $MALid = $mapping['externalId']; break; @@ -79,8 +73,8 @@ final class MangaListTransformer extends AbstractTransformer { } } - $titles = Kitsu::filterTitles($manga); - $title = array_shift($titles); + $titles = Kitsu::getFilteredTitles($manga['titles']); + $title = $manga['titles']['canonical']; return MangaListItem::from([ 'id' => $item['id'], @@ -96,17 +90,17 @@ final class MangaListTransformer extends AbstractTransformer { 'manga' => MangaListItemDetail::from([ 'genres' => $genres, 'id' => $mangaId, - 'image' => $manga['posterImage']['small'], + 'image' => $manga['posterImage']['views'][1]['url'], 'slug' => $manga['slug'], 'title' => $title, 'titles' => $titles, - 'type' => (string)StringType::from($manga['subtype'])->upperCaseFirst(), + 'type' => (string)StringType::from($manga['subtype'])->toLowerCase()->upperCaseFirst(), 'url' => 'https://kitsu.io/manga/' . $manga['slug'], ]), - 'reading_status' => $item['attributes']['status'], - 'notes' => $item['attributes']['notes'], - 'rereading' => (bool)$item['attributes']['reconsuming'], - 'reread' => $item['attributes']['reconsumeCount'], + 'reading_status' => strtolower($item['status']), + 'notes' => $item['notes'], + 'rereading' => (bool)$item['reconsuming'], + 'reread' => $item['reconsumeCount'], 'user_rating' => $rating, ]); } From 1e3bfa7a0a9caa015e310e46075fc762c7c9ee40 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 16 Oct 2020 16:18:56 -0400 Subject: [PATCH 75/86] Sync Kitsu and Anilist both via GraphQL, see #33 --- src/AnimeClient/API/Kitsu/MangaTrait.php | 1 - src/AnimeClient/API/Kitsu/Model.php | 146 +++++++++--------- .../API/Kitsu/Queries/GetSyncLibrary.graphql | 42 +++++ src/AnimeClient/Command/SyncLists.php | 124 ++++++--------- src/AnimeClient/Enum/APISource.php | 27 ---- 5 files changed, 167 insertions(+), 173 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Queries/GetSyncLibrary.graphql delete mode 100644 src/AnimeClient/Enum/APISource.php diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index 94168d0d..740d2633 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -19,7 +19,6 @@ namespace Aviat\AnimeClient\API\Kitsu; use Amp\Http\Client\Request; use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\MangaReadingStatus\Kitsu as KitsuReadingStatus; -use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaHistoryTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 25d4083d..830d5afe 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -329,16 +329,27 @@ final class Model { */ public function getSyncList(string $type): array { - $options = [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => $type, - ], - 'include' => "{$type},{$type}.mappings", - // 'sort' => '-updated_at' + $statuses = [ + 'CURRENT', + 'PLANNED', + 'ON_HOLD', + 'DROPPED', + 'COMPLETED', ]; - return $this->getRawSyncList($type, $options); + $pages = []; + + // Although I can fetch the whole list without segregating by status, + // this way is much faster... + foreach ($statuses as $status) + { + foreach ($this->getRawSyncListPages(strtoupper($type), $status) as $page) + { + $pages[] = $page; + } + } + + return array_merge(...$pages); } /** @@ -412,6 +423,9 @@ final class Model { $page = $data['pageInfo']; if (empty($data)) { + dump($rawData); + die(); + // @TODO Error logging break; } @@ -428,6 +442,58 @@ final class Model { }); } + protected function getRawSyncListPages(string $type, string $status): ?\Generator + { + $items = $this->getRawSyncPages($type, $status); + + while (wait($items->advance())) + { + yield $items->getCurrent(); + } + } + + protected function getRawSyncPages(string $type, $status): Amp\Iterator { + $cursor = ''; + $username = $this->getUsername(); + + return new Amp\Producer(function (callable $emit) use ($type, $status, $cursor, $username) { + while (TRUE) + { + $vars = [ + 'type' => $type, + 'slug' => $username, + 'status' => $status, + ]; + if ($cursor !== '') + { + $vars['after'] = $cursor; + } + + $request = $this->requestBuilder->queryRequest('GetSyncLibrary', $vars); + $response = yield getApiClient()->request($request); + $json = yield $response->getBody()->buffer(); + + $rawData = Json::decode($json); + $data = $rawData['data']['findProfileBySlug']['library']['all'] ?? []; + $page = $data['pageInfo']; + if (empty($data)) + { + dump($rawData); + die(); + } + + $cursor = $page['endCursor']; + + yield $emit($data['nodes']); + + if ($page['hasNextPage'] === FALSE) + { + break; + } + } + }); + } + private function getUserId(): string { static $userId = NULL; @@ -467,68 +533,4 @@ final class Model { return $res['data']['findProfileBySlug']['library']['all']['totalCount']; } - - /** - * Get the full anime list - * - * @param string $type - * @param array $options - * @return array - * @throws InvalidArgumentException - * @throws Throwable - */ - private function getRawSyncList(string $type, array $options): array - { - $count = $this->getListCount($type); - $size = static::LIST_PAGE_SIZE; - $pages = ceil($count / $size); - - $requester = new ParallelAPIRequest(); - - // Set up requests - for ($i = 0; $i < $pages; $i++) - { - $offset = $i * $size; - $requester->addRequest($this->getRawSyncListPage($type, $size, $offset, $options)); - } - - $responses = $requester->makeRequests(); - $output = []; - - foreach($responses as $response) - { - $data = Json::decode($response); - $output[] = $data; - } - - return array_merge_recursive(...$output); - } - - /** - * Get the full anime list in paginated form - * - * @param string $type - * @param int $limit - * @param int $offset - * @param array $options - * @return Request - * @throws InvalidArgumentException - */ - private function getRawSyncListPage(string $type, int $limit, int $offset = 0, array $options = []): Request - { - $defaultOptions = [ - 'filter' => [ - 'user_id' => $this->getUserId(), - 'kind' => $type, - ], - 'page' => [ - 'offset' => $offset, - 'limit' => $limit - ], - 'sort' => '-updated_at' - ]; - $options = array_merge($defaultOptions, $options); - - return $this->requestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); - } } \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Queries/GetSyncLibrary.graphql b/src/AnimeClient/API/Kitsu/Queries/GetSyncLibrary.graphql new file mode 100644 index 00000000..436f84c5 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Queries/GetSyncLibrary.graphql @@ -0,0 +1,42 @@ +query ( + $slug: String!, + $type: MediaTypeEnum!, + $status: [LibraryEntryStatusEnum!], + $after: String +) { + findProfileBySlug(slug: $slug) { + library { + all(first: 100, after: $after, mediaType: $type, status: $status) { + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + nodes { + id + notes + nsfw + private + progress + progressedAt + rating + reconsumeCount + reconsuming + status + media { + id + slug + mappings(first: 10) { + nodes { + externalId + externalSite + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/AnimeClient/Command/SyncLists.php b/src/AnimeClient/Command/SyncLists.php index d16fc9c5..aa3c0cb0 100644 --- a/src/AnimeClient/Command/SyncLists.php +++ b/src/AnimeClient/Command/SyncLists.php @@ -20,14 +20,12 @@ use ConsoleKit\Widgets; use Aviat\AnimeClient\API\{ Anilist\MissingIdException, - FailedResponseException, - JsonAPI, ParallelAPIRequest }; use Aviat\AnimeClient\API; use Aviat\AnimeClient\API\Anilist; use Aviat\AnimeClient\API\Mapping\{AnimeWatchingStatus, MangaReadingStatus}; -use Aviat\AnimeClient\Enum\{APISource, ListType, SyncAction}; +use Aviat\AnimeClient\Enum\{ListType, SyncAction}; use Aviat\AnimeClient\Types\FormItem; use Aviat\Ion\Di\Exception\ContainerException; use Aviat\Ion\Di\Exception\NotFoundException; @@ -40,6 +38,9 @@ use function in_array; * Syncs list data between Anilist and Kitsu */ final class SyncLists extends BaseCommand { + protected const KITSU_GREATER = 1; + protected const ANILIST_GREATER = -1; + protected const SAME = 0; /** * Model for making requests to Anilist API @@ -315,37 +316,24 @@ final class SyncLists extends BaseCommand { return []; } - if ( ! array_key_exists('included', $data)) - { - dump([ - 'problem' => 'Missing included data in method ' . __METHOD__, - 'data' => $data - ]); - return []; - } - - $includes = JsonAPI::organizeIncludes($data['included']); - $includes['mappings'] = $this->filterMappings($includes['mappings'], $type); - $output = []; - foreach($data['data'] as $listItem) + foreach($data as $listItem) { - $id = $listItem['relationships'][$type]['data']['id']; - - $potentialMappings = $includes[$type][$id]['relationships']['mappings']; + // If there's no mapping, we can't sync, so continue + if ( ! is_array($listItem['media']['mappings']['nodes'])) + { + continue; + } $malId = NULL; - foreach ($potentialMappings as $mappingId) + foreach ($listItem['media']['mappings']['nodes'] as $mapping) { - if (is_array($mappingId)) + $uType = strtoupper($type); + if ($mapping['externalSite'] === "MYANIMELIST_{$uType}") { - continue; - } - - if (array_key_exists($mappingId, $includes['mappings'])) - { - $malId = $includes['mappings'][$mappingId]['externalId']; + $malId = $mapping['externalId']; + break; } } @@ -355,10 +343,22 @@ final class SyncLists extends BaseCommand { continue; } - $output[$listItem['id']] = [ - 'id' => $listItem['id'], + $output[$listItem['media']['id']] = [ + 'id' => $listItem['media']['id'], + 'slug' => $listItem['media']['slug'], 'malId' => $malId, - 'data' => $listItem['attributes'], + 'data' => [ + 'notes' => $listItem['notes'], + 'private' => $listItem['private'], + 'progress' => $listItem['progress'], + // Comparision is done on 1-10 scale, + // Kitsu returns 1-20 scale. + 'rating' => $listItem['rating'] / 2, + 'reconsumeCount' => $listItem['reconsumeCount'], + 'reconsuming' => $listItem['reconsuming'], + 'status' => strtolower($listItem['status']), + 'updatedAt' => $listItem['progressedAt'], + ] ]; } @@ -460,7 +460,7 @@ final class SyncLists extends BaseCommand { 'private' => $kItem['private'], 'progress' => $kItem['progress'], 'repeat' => $kItem['reconsumeCount'], - 'score' => $kItem['ratingTwenty'] * 5, // 100 point score on Anilist + 'score' => $kItem['rating'] * 10, // 100 point score on Anilist 'status' => $newItemStatus, ], ]; @@ -492,10 +492,9 @@ final class SyncLists extends BaseCommand { 'status', ]; $diff = []; - $dateDiff = new DateTime($kitsuItem['data']['updatedAt']) <=> new DateTime((string)$anilistItem['data']['updatedAt']); - - // Correct differences in notation - $kitsuItem['data']['rating'] = $kitsuItem['data']['ratingTwenty'] / 2; + $dateDiff = ($kitsuItem['data']['updatedAt'] !== NULL) + ? new DateTime($kitsuItem['data']['updatedAt']) <=> new DateTime((string)$anilistItem['data']['updatedAt']) + : 0; foreach($compareKeys as $key) { @@ -535,12 +534,12 @@ final class SyncLists extends BaseCommand { // If status is the same, and progress count is different, use greater progress if ($sameStatus && ( ! $sameProgress)) { - if ($diff['progress'] === 1) + if ($diff['progress'] === self::KITSU_GREATER) { $update['data']['progress'] = $kitsuItem['data']['progress']; $return['updateType'][] = API::ANILIST; } - else if($diff['progress'] === -1) + else if($diff['progress'] === self::ANILIST_GREATER) { $update['data']['progress'] = $anilistItem['data']['progress']; $return['updateType'][] = API::KITSU; @@ -550,12 +549,12 @@ final class SyncLists extends BaseCommand { // If status is different, use the status of the more recently updated item if ( ! $sameStatus) { - if ($dateDiff === 1) + if ($dateDiff === self::KITSU_GREATER) { $update['data']['status'] = $kitsuItem['data']['status']; $return['updateType'][] = API::ANILIST; } - else if ($dateDiff === -1) + else if ($dateDiff === self::ANILIST_GREATER) { $update['data']['status'] = $anilistItem['data']['status']; $return['updateType'][] = API::KITSU; @@ -566,7 +565,7 @@ final class SyncLists extends BaseCommand { // But, at least for now, assume newer record is correct if ( ! ($sameStatus || $sameProgress)) { - if ($dateDiff === 1) + if ($dateDiff === self::KITSU_GREATER) { $update['data']['status'] = $kitsuItem['data']['status']; @@ -577,7 +576,7 @@ final class SyncLists extends BaseCommand { $return['updateType'][] = API::ANILIST; } - else if($dateDiff === -1) + else if($dateDiff === self::ANILIST_GREATER) { $update['data']['status'] = $anilistItem['data']['status']; @@ -594,7 +593,7 @@ final class SyncLists extends BaseCommand { if ( ! $sameRating) { if ( - $dateDiff === 1 && + $dateDiff === self::KITSU_GREATER && $kitsuItem['data']['rating'] !== 0 && $kitsuItem['data']['ratingTwenty'] !== 0 ) @@ -602,7 +601,7 @@ final class SyncLists extends BaseCommand { $update['data']['ratingTwenty'] = $kitsuItem['data']['ratingTwenty']; $return['updateType'][] = API::ANILIST; } - else if($dateDiff === -1 && $anilistItem['data']['rating'] !== 0) + else if($dateDiff === self::ANILIST_GREATER && $anilistItem['data']['rating'] !== 0) { $update['data']['ratingTwenty'] = $anilistItem['data']['rating'] * 2; $return['updateType'][] = API::KITSU; @@ -612,7 +611,7 @@ final class SyncLists extends BaseCommand { // If notes are set, use kitsu, otherwise, set kitsu from anilist if ( ! $sameNotes) { - if ($kitsuItem['data']['notes'] !== '') + if ( ! empty($kitsuItem['data']['notes'])) { $update['data']['notes'] = $kitsuItem['data']['notes']; $return['updateType'][] = API::ANILIST; @@ -627,12 +626,12 @@ final class SyncLists extends BaseCommand { // Assume the larger reconsumeCount is correct if ( ! $sameRewatchCount) { - if ($diff['reconsumeCount'] === 1) + if ($diff['reconsumeCount'] === self::KITSU_GREATER) { $update['data']['reconsumeCount'] = $kitsuItem['data']['reconsumeCount']; $return['updateType'][] = API::ANILIST; } - else if ($diff['reconsumeCount'] === -1) + else if ($diff['reconsumeCount'] === self::ANILIST_GREATER) { $update['data']['reconsumeCount'] = $anilistItem['data']['reconsumeCount']; $return['updateType'][] = API::KITSU; @@ -659,11 +658,14 @@ final class SyncLists extends BaseCommand { // to handle each combination of fields if ($return['updateType'][0] === API::ANILIST) { + // Anilist GraphQL expects a rating from 1-100 $prevData = [ 'notes' => $kitsuItem['data']['notes'], 'private' => $kitsuItem['data']['private'], 'progress' => $kitsuItem['data']['progress'], - 'rating' => $kitsuItem['data']['ratingTwenty'] * 5, + // Transformed Kitsu data returns a rating from 1-10 + // Anilist expects a rating from 1-100 + 'rating' => $kitsuItem['data']['rating'] * 10, 'reconsumeCount' => $kitsuItem['data']['reconsumeCount'], 'reconsuming' => $kitsuItem['data']['reconsuming'], 'status' => $kitsuItem['data']['status'], @@ -677,6 +679,8 @@ final class SyncLists extends BaseCommand { 'notes' => $anilistItem['data']['notes'], 'private' => $anilistItem['data']['private'], 'progress' => $anilistItem['data']['progress'] ?? 0, + // Anilist returns a rating between 1-100 + // Kitsu expects a rating from 1-20 'rating' => (((int)$anilistItem['data']['rating']) > 0) ? $anilistItem['data']['rating'] / 5 : 0, @@ -824,30 +828,4 @@ final class SyncLists extends BaseCommand { } } } - - // ------------------------------------------------------------------------ - // Other Helpers - // ------------------------------------------------------------------------ - - /** - * Filter Kitsu mappings for the specified type - * - * @param array $includes - * @param string $type - * @return array - */ - private function filterMappings(array $includes, string $type = ListType::ANIME): array - { - $output = []; - - foreach($includes as $id => $mapping) - { - if ($mapping['externalSite'] === "myanimelist/{$type}") - { - $output[$id] = $mapping; - } - } - - return $output; - } } diff --git a/src/AnimeClient/Enum/APISource.php b/src/AnimeClient/Enum/APISource.php deleted file mode 100644 index 66bccf17..00000000 --- a/src/AnimeClient/Enum/APISource.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @copyright 2015 - 2020 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 5.1 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\Enum; - -use Aviat\Ion\Enum as BaseEnum; - -/** - * Types of lists - */ -final class APISource extends BaseEnum { - public const KITSU = 'kitsu'; - public const ANILIST = 'anilist'; -} \ No newline at end of file From 5340c394664771bd992a6af21bb9c75b531e7a75 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 21 Oct 2020 14:51:17 -0400 Subject: [PATCH 76/86] More GraphQL conversion, test updates, see #33 --- src/AnimeClient/API/Kitsu/AnimeTrait.php | 34 - src/AnimeClient/API/Kitsu/MangaTrait.php | 28 - src/AnimeClient/API/Kitsu/Model.php | 25 +- tests/AnimeClient/API/Kitsu/ModelTest.php | 42 + .../Transformer/AnimeListTransformerTest.php | 8 +- .../Transformer/AnimeTransformerTest.php | 3 - .../Transformer/MangaListTransformerTest.php | 21 +- .../Transformer/MangaTransformerTest.php | 10 +- ...eListTransformerTest__testTransform__1.php | 45 - ...eListTransformerTest__testTransform__1.yml | 36 +- ...st__testUntransform with data set 0__1.php | 15 - ...st__testUntransform with data set 1__1.php | 15 - ...st__testUntransform with data set 2__1.php | 14 - ...AnimeTransformerTest__testTransform__1.php | 315 -- ...AnimeTransformerTest__testTransform__1.yml | 94 +- ...aListTransformerTest__testTransform__1.yml | 68 +- ...MangaTransformerTest__testTransform__1.php | 86 - ...MangaTransformerTest__testTransform__1.yml | 41 +- .../test_data/Kitsu/animeAfterTransform.json | 52 - .../test_data/Kitsu/animeBeforeTransform.json | 4042 +++++++++++++++-- .../Kitsu/animeListItemAfterTransform.json | 30 - .../Kitsu/animeListItemBeforeTransform.json | 1271 +----- .../test_data/Kitsu/mangaAfterTransform.json | 12 - .../test_data/Kitsu/mangaBeforeTransform.json | 648 ++- .../Kitsu/mangaListAfterTransform.json | 126 - .../Kitsu/mangaListBeforeTransform.json | 1433 +----- 26 files changed, 4763 insertions(+), 3751 deletions(-) create mode 100644 tests/AnimeClient/API/Kitsu/ModelTest.php delete mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.php delete mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.php delete mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.php delete mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.php delete mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.php delete mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php delete mode 100644 tests/AnimeClient/test_data/Kitsu/animeAfterTransform.json delete mode 100644 tests/AnimeClient/test_data/Kitsu/animeListItemAfterTransform.json delete mode 100644 tests/AnimeClient/test_data/Kitsu/mangaAfterTransform.json delete mode 100644 tests/AnimeClient/test_data/Kitsu/mangaListAfterTransform.json diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index fab16c70..04141df2 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -222,40 +222,6 @@ trait AnimeTrait { return $output; } - /** - * Get the mal id for the anime represented by the kitsu id - * to enable updating MyAnimeList - * - * @param string $kitsuAnimeId The id of the anime on Kitsu - * @return string|null Returns the mal id if it exists, otherwise null - */ - public function getMalIdForAnime(string $kitsuAnimeId): ?string - { - $options = [ - 'query' => [ - 'include' => 'mappings' - ] - ]; - $data = $this->requestBuilder->getRequest("anime/{$kitsuAnimeId}", $options); - - if ( ! array_key_exists('included', $data)) - { - return NULL; - } - - $mappings = array_column($data['included'], 'attributes'); - - foreach($mappings as $map) - { - if ($map['externalSite'] === 'myanimelist/anime') - { - return $map['externalId']; - } - } - - return NULL; - } - /** * Get the full anime list in paginated form * diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index 740d2633..67406bbd 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -242,32 +242,4 @@ trait MangaTrait { return $this->requestBuilder->setUpRequest('GET', 'library-entries', ['query' => $options]); } - - /** - * Get the mal id for the manga represented by the kitsu id - * to enable updating MyAnimeList - * - * @param string $kitsuMangaId The id of the manga on Kitsu - * @return string|null Returns the mal id if it exists, otherwise null - */ - public function getMalIdForManga(string $kitsuMangaId): ?string - { - $options = [ - 'query' => [ - 'include' => 'mappings' - ] - ]; - $data = $this->requestBuilder->getRequest("manga/{$kitsuMangaId}", $options); - $mappings = array_column($data['included'], 'attributes'); - - foreach($mappings as $map) - { - if ($map['externalSite'] === 'myanimelist/manga') - { - return $map['externalId']; - } - } - - return NULL; - } } \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index 830d5afe..bfcfe0e3 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -279,27 +279,12 @@ final class Model { */ public function getKitsuIdFromMALId(string $malId, string $type='anime'): ?string { - $options = [ - 'query' => [ - 'filter' => [ - 'external_site' => "myanimelist/{$type}", - 'external_id' => $malId - ], - 'fields' => [ - 'media' => 'id,slug' - ], - 'include' => 'item' - ] - ]; + $raw = $this->requestBuilder->runQuery('GetIdByMapping', [ + 'id' => $malId, + 'site' => strtoupper("MYANIMELIST_{$type}"), + ]); - $raw = $this->requestBuilder->getRequest('mappings', $options); - - if ( ! array_key_exists('included', $raw)) - { - return NULL; - } - - return $raw['included'][0]['id']; + return $raw['data']['lookupMapping']['id'] ?? NULL; } /** diff --git a/tests/AnimeClient/API/Kitsu/ModelTest.php b/tests/AnimeClient/API/Kitsu/ModelTest.php new file mode 100644 index 00000000..a4ed7a49 --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/ModelTest.php @@ -0,0 +1,42 @@ + + * @copyright 2015 - 2020 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 5.1 + * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient + */ + +namespace Aviat\AnimeClient\Tests\API\Kitsu; + +use Aviat\AnimeClient\Tests\AnimeClientTestCase; + +class ModelTest extends AnimeClientTestCase { + + protected $model; + + public function setUp(): void + { + parent::setup(); + $this->model = $this->container->get('kitsu-model'); + } + + public function testGetAnimeKitsuIdFromMALId(): void + { + $kitsuId = $this->model->getKitsuIdFromMALId("1", 'anime'); + self::assertEquals("1", $kitsuId); + } + + public function testGetNullFromMALAnimeId(): void + { + $kitsuId = $this->model->getKitsuIdFromMALId("0", 'anime'); + self::assertNull($kitsuId); + } +} \ No newline at end of file diff --git a/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php index bdb1f81f..bee7b320 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/AnimeListTransformerTest.php @@ -16,9 +16,8 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\Tests\AnimeClientTestCase; -use Aviat\Ion\Friend; use Aviat\Ion\Json; class AnimeListTransformerTest extends AnimeClientTestCase { @@ -31,9 +30,10 @@ class AnimeListTransformerTest extends AnimeClientTestCase { parent::setUp(); $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu'; - $this->beforeTransform = Json::decodeFile("{$this->dir}/animeListItemBeforeTransform.json"); + $raw = Json::decodeFile("{$this->dir}/animeListItemBeforeTransform.json"); + $this->beforeTransform = $raw['data']['findLibraryEntryById']; - $this->transformer = new OldAnimeListTransformer(); + $this->transformer = new AnimeListTransformer(); } public function testTransform() diff --git a/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php index 540e96b9..ee17a20e 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/AnimeTransformerTest.php @@ -24,7 +24,6 @@ class AnimeTransformerTest extends AnimeClientTestCase { protected $dir; protected $beforeTransform; - protected $afterTransform; protected $transformer; public function setUp(): void { @@ -38,8 +37,6 @@ class AnimeTransformerTest extends AnimeClientTestCase { public function testTransform() { - $this->markTestSkipped('Skip until fixed with GraphQL snapshot'); - $actual = $this->transformer->transform($this->beforeTransform); $this->assertMatchesSnapshot($actual); } diff --git a/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php index 7a2fe86b..40eb7b89 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/MangaListTransformerTest.php @@ -16,8 +16,7 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\JsonAPI; -use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; use Aviat\AnimeClient\Tests\AnimeClientTestCase; use Aviat\AnimeClient\Types\{ FormItem, @@ -30,29 +29,17 @@ class MangaListTransformerTest extends AnimeClientTestCase { protected $dir; protected $rawBefore; protected $beforeTransform; - protected $afterTransform; protected $transformer; public function setUp(): void { parent::setUp(); - $kitsuModel = $this->container->get('kitsu-model'); - $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu'; // Prep for transform - $rawBefore = Json::decodeFile("{$this->dir}/mangaListBeforeTransform.json"); - $included = JsonAPI::organizeIncludes($rawBefore['included']); - $included = JsonAPI::inlineIncludedRelationships($included, 'manga'); - foreach($rawBefore['data'] as $i => &$item) - { - $item['included'] = $included; - } - - $this->beforeTransform = $rawBefore['data']; - // $this->afterTransform = Json::decodeFile("{$this->dir}/mangaListAfterTransform.json"); - - $this->transformer = new OldMangaListTransformer(); + $raw = Json::decodeFile("{$this->dir}/mangaListBeforeTransform.json"); + $this->beforeTransform = $raw['data']['findProfileBySlug']['library']['all']['nodes']; + $this->transformer = new MangaListTransformer(); } public function testTransform() diff --git a/tests/AnimeClient/API/Kitsu/Transformer/MangaTransformerTest.php b/tests/AnimeClient/API/Kitsu/Transformer/MangaTransformerTest.php index fee0ea0f..298476aa 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/MangaTransformerTest.php +++ b/tests/AnimeClient/API/Kitsu/Transformer/MangaTransformerTest.php @@ -16,7 +16,6 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; -use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; use Aviat\AnimeClient\Tests\AnimeClientTestCase; use Aviat\Ion\Json; @@ -25,26 +24,19 @@ class MangaTransformerTest extends AnimeClientTestCase { protected $dir; protected $beforeTransform; - protected $afterTransform; protected $transformer; public function setUp(): void { parent::setUp(); $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu'; - $data = Json::decodeFile("{$this->dir}/mangaBeforeTransform.json"); - $baseData = $data['data'][0]['attributes']; - $baseData['included'] = $data['included']; - $baseData['id'] = $data['data'][0]['id']; - $this->beforeTransform = $baseData; + $this->beforeTransform = Json::decodeFile("{$this->dir}/mangaBeforeTransform.json"); $this->transformer = new MangaTransformer(); } public function testTransform() { - $this->markTestSkipped('Skip until fixed with GraphQL snapshot'); - $actual = $this->transformer->transform($this->beforeTransform); $this->assertMatchesSnapshot($actual); } diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.php b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.php deleted file mode 100644 index 7559803d..00000000 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.php +++ /dev/null @@ -1,45 +0,0 @@ - '15839442', - 'mal_id' => '33206', - 'episodes' => - array ( - 'watched' => '-', - 'total' => '-', - 'length' => NULL, - ), - 'airing' => - array ( - 'status' => 'Currently Airing', - 'started' => '2017-01-12', - 'ended' => NULL, - ), - 'anime' => - Aviat\AnimeClient\Types\Anime::__set_state(array( - 'age_rating' => NULL, - 'cover_image' => 'https://media.kitsu.io/anime/poster_images/12243/small.jpg?1481144116', - 'genres' => - array ( - 0 => 'Comedy', - 1 => 'Fantasy', - 2 => 'Slice of Life', - ), - 'id' => '12243', - 'show_type' => 'TV', - 'slug' => 'kobayashi-san-chi-no-maid-dragon', - 'streaming_links' => - array ( - ), - 'title' => 'Kobayashi-san Chi no Maid Dragon', - 'titles' => - array ( - 0 => 'Miss Kobayashi\'s Dragon Maid', - 1 => '小林さんちのメイドラゴン', - ), - )), - 'notes' => NULL, - 'private' => false, - 'rewatching' => false, - 'rewatched' => 0, - 'user_rating' => '-', - 'watching_status' => 'current', -)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml index 866e1a5b..47d326a2 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml @@ -1,28 +1,28 @@ empty: false -id: '15839442' -mal_id: '33206' +id: '435513' +mal_id: '209' episodes: - watched: '-' - total: '-' - length: null + watched: 7 + total: 26 + length: 1500 airing: - status: 'Currently Airing' - started: '2017-01-12' - ended: null + status: 'Finished Airing' + started: '2003-09-01' + ended: '2004-03-16' anime: empty: false - age_rating: null - cover_image: 'https://media.kitsu.io/anime/poster_images/12243/small.jpg?1481144116' - genres: [Comedy, Fantasy, 'Slice of Life'] - id: '12243' + age_rating: PG + cover_image: 'https://media.kitsu.io/anime/poster_images/185/small.jpg?1597697520' + genres: { } + id: '185' show_type: TV - slug: kobayashi-san-chi-no-maid-dragon - streaming_links: { } - title: 'Kobayashi-san Chi no Maid Dragon' - titles: ['Miss Kobayashi''s Dragon Maid', 小林さんちのメイドラゴン] -notes: null + slug: r-o-d + streaming_links: [{ meta: { name: Crunchyroll, link: true, image: streaming-logos/crunchyroll.svg }, link: 'http://www.crunchyroll.com/rod', subs: [en], dubs: [ja] }, { meta: { name: Hulu, link: true, image: streaming-logos/hulu.svg }, link: 'http://www.hulu.com/rod-the-tv', subs: [en], dubs: [ja] }] + title: 'R.O.D the TV' + titles: ['アール・オー・ディー ザ・ティーヴィー'] +notes: '' private: false rewatching: false rewatched: 0 user_rating: '-' -watching_status: current +watching_status: CURRENT diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.php b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.php deleted file mode 100644 index f37516c9..00000000 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.php +++ /dev/null @@ -1,15 +0,0 @@ - 14047981, - 'anilist_item_id' => NULL, - 'mal_id' => NULL, - 'data' => - Aviat\AnimeClient\Types\FormItemData::__set_state(array( - 'notes' => 'Very formulaic.', - 'private' => false, - 'progress' => 38, - 'ratingTwenty' => 16, - 'reconsumeCount' => 0, - 'reconsuming' => false, - 'status' => 'current', - )), -)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.php b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.php deleted file mode 100644 index 672b1d43..00000000 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.php +++ /dev/null @@ -1,15 +0,0 @@ - 14047981, - 'anilist_item_id' => NULL, - 'mal_id' => '12345', - 'data' => - Aviat\AnimeClient\Types\FormItemData::__set_state(array( - 'notes' => 'Very formulaic.', - 'private' => true, - 'progress' => 38, - 'ratingTwenty' => 16, - 'reconsumeCount' => 0, - 'reconsuming' => true, - 'status' => 'current', - )), -)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.php b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.php deleted file mode 100644 index e0e27ff4..00000000 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.php +++ /dev/null @@ -1,14 +0,0 @@ - 14047983, - 'anilist_item_id' => NULL, - 'mal_id' => '12347', - 'data' => - Aviat\AnimeClient\Types\FormItemData::__set_state(array( - 'notes' => '', - 'private' => true, - 'progress' => 12, - 'reconsumeCount' => 0, - 'reconsuming' => true, - 'status' => 'current', - )), -)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.php b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.php deleted file mode 100644 index b4329b78..00000000 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.php +++ /dev/null @@ -1,315 +0,0 @@ - - array ( - ), - 'staff' => - array ( - ), - 'age_rating' => 'R', - 'age_rating_guide' => 'Violence, Profanity', - 'cover_image' => 'https://media.kitsu.io/anime/poster_images/7442/small.jpg?1418580054', - 'episode_count' => 25, - 'episode_length' => 24, - 'genres' => - array ( - ), - 'id' => 32344, - 'included' => - array ( - 'categories' => - array ( - 23 => - array ( - 'name' => 'Super Power', - 'slug' => 'super-power', - 'description' => NULL, - ), - 11 => - array ( - 'name' => 'Fantasy', - 'slug' => 'fantasy', - 'description' => '', - ), - 4 => - array ( - 'name' => 'Drama', - 'slug' => 'drama', - 'description' => '', - ), - 1 => - array ( - 'name' => 'Action', - 'slug' => 'action', - 'description' => '', - ), - ), - 'mappings' => - array ( - 5686 => - array ( - 'externalSite' => 'myanimelist/anime', - 'externalId' => '16498', - 'relationships' => - array ( - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/mappings/5686/relationships/media', - 'related' => 'https://kitsu.io/api/edge/mappings/5686/media', - ), - ), - ), - ), - 14153 => - array ( - 'externalSite' => 'thetvdb/series', - 'externalId' => '267440', - 'relationships' => - array ( - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/mappings/14153/relationships/media', - 'related' => 'https://kitsu.io/api/edge/mappings/14153/media', - ), - ), - ), - ), - 15073 => - array ( - 'externalSite' => 'thetvdb/season', - 'externalId' => '514060', - 'relationships' => - array ( - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/mappings/15073/relationships/media', - 'related' => 'https://kitsu.io/api/edge/mappings/15073/media', - ), - ), - ), - ), - ), - 'streamingLinks' => - array ( - 103 => - array ( - 'url' => 'http://www.crunchyroll.com/attack-on-titan', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - 'relationships' => - array ( - 'streamer' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/103/relationships/streamer', - 'related' => 'https://kitsu.io/api/edge/streaming-links/103/streamer', - ), - ), - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/103/relationships/media', - 'related' => 'https://kitsu.io/api/edge/streaming-links/103/media', - ), - ), - ), - ), - 102 => - array ( - 'url' => 'http://www.hulu.com/attack-on-titan', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - 'relationships' => - array ( - 'streamer' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/102/relationships/streamer', - 'related' => 'https://kitsu.io/api/edge/streaming-links/102/streamer', - ), - ), - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/102/relationships/media', - 'related' => 'https://kitsu.io/api/edge/streaming-links/102/media', - ), - ), - ), - ), - 101 => - array ( - 'url' => 'http://www.funimation.com/shows/attack-on-titan/videos/episodes', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - 'relationships' => - array ( - 'streamer' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/101/relationships/streamer', - 'related' => 'https://kitsu.io/api/edge/streaming-links/101/streamer', - ), - ), - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/101/relationships/media', - 'related' => 'https://kitsu.io/api/edge/streaming-links/101/media', - ), - ), - ), - ), - 100 => - array ( - 'url' => 't', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - 'relationships' => - array ( - 'streamer' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/100/relationships/streamer', - 'related' => 'https://kitsu.io/api/edge/streaming-links/100/streamer', - ), - ), - 'media' => - array ( - 'links' => - array ( - 'self' => 'https://kitsu.io/api/edge/streaming-links/100/relationships/media', - 'related' => 'https://kitsu.io/api/edge/streaming-links/100/media', - ), - ), - ), - ), - ), - ), - 'show_type' => 'TV', - 'slug' => 'attack-on-titan', - 'status' => 'Finished Airing', - 'streaming_links' => - array ( - 0 => - array ( - 'meta' => - array ( - 'name' => 'Crunchyroll', - 'link' => true, - 'image' => 'streaming-logos/crunchyroll.svg', - ), - 'link' => 'http://www.crunchyroll.com/attack-on-titan', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - ), - 1 => - array ( - 'meta' => - array ( - 'name' => 'Funimation', - 'link' => true, - 'image' => 'streaming-logos/funimation.svg', - ), - 'link' => 'http://www.funimation.com/shows/attack-on-titan/videos/episodes', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - ), - 2 => - array ( - 'meta' => - array ( - 'name' => 'Hulu', - 'link' => true, - 'image' => 'streaming-logos/hulu.svg', - ), - 'link' => 'http://www.hulu.com/attack-on-titan', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - ), - 3 => - array ( - 'meta' => - array ( - 'name' => 'Netflix', - 'link' => false, - 'image' => 'streaming-logos/netflix.svg', - ), - 'link' => 't', - 'subs' => - array ( - 0 => 'en', - ), - 'dubs' => - array ( - 0 => 'ja', - ), - ), - ), - 'synopsis' => 'Several hundred years ago, humans were nearly exterminated by titans. Titans are typically several stories tall, seem to have no intelligence, devour human beings and, worst of all, seem to do it for the pleasure rather than as a food source. A small percentage of humanity survived by enclosing themselves in a city protected by extremely high walls, even taller than the biggest of titans. Flash forward to the present and the city has not seen a titan in over 100 years. Teenage boy Eren and his foster sister Mikasa witness something horrific as the city walls are destroyed by a colossal titan that appears out of thin air. As the smaller titans flood the city, the two kids watch in horror as their mother is eaten alive. Eren vows that he will murder every single titan and take revenge for all of mankind. - -(Source: ANN)', - 'title' => 'Attack on Titan', - 'titles' => - array ( - 0 => 'Attack on Titan', - 1 => 'Shingeki no Kyojin', - 2 => '進撃の巨人', - ), - 'trailer_id' => 'n4Nj6Y_SNYI', - 'url' => 'https://kitsu.io/anime/attack-on-titan', -)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml index 3e28a782..62863b54 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml @@ -1,36 +1,90 @@ empty: false -characters: { } -staff: { } +characters: + main: { 38506: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38506/original.jpg?1483096805', width: null } }, name: 'Armin Arlert', slug: armin-arelet }, 38507: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38507/original.jpg?1483096805', width: null } }, name: 'Eren Yeager', slug: eren-jager }, 38505: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38505/original.jpg?1483096805', width: null } }, name: 'Mikasa Ackerman', slug: mikasa-ackerman } } + background: { 95639: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/95639/original.jpg?1533149500', width: null } }, name: Abel, slug: goggles }, 39820: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39820/original.jpg?1483096805', width: null } }, name: 'Anka Rheinberger', slug: anka-rheinberger }, 38511: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38511/original.jpg?1483096805', width: null } }, name: 'Annie Leonhart', slug: annie-leonhardt }, 39806: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39806/original.jpg?1483096805', width: null } }, name: Balto, slug: balto }, 39816: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39816/original.jpg?1483096805', width: null } }, name: 'Bertolt Hoover', slug: bertolt-hoover }, 72418: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/72418/original.jpg?1485079569', width: null } }, name: 'Boris Feulner', slug: boris-feulner }, 39827: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39827/original.jpg?1483096805', width: null } }, name: 'Carla Yeager', slug: carla-yeager }, 38513: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38513/original.jpg?1483096805', width: null } }, name: 'Connie Springer', slug: conny-springer }, 77248: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/77248/original.jpg?1485081285', width: null } }, name: 'Darius Baer Varbrun', slug: darius-baer-varbrun }, 52597: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52597/original.jpg?1483096805', width: null } }, name: 'Darius Zackly', slug: darius-zackly }, 39804: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39804/original.jpg?1483096805', width: null } }, name: Dazz, slug: dazz }, 80627: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/80627/original.jpg?1485082510', width: null } }, name: 'Dennis Eibringer', slug: dennis-eibringer }, 78275: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/78275/original.jpg?1485081646', width: null } }, name: Dieter, slug: dieter }, 52595: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52595/original.jpg?1483096805', width: null } }, name: 'Dimo Reeves', slug: dimo-reeves }, 52593: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52593/original.jpg?1483096805', width: null } }, name: 'Dita Ness', slug: dita-ness }, 39818: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39818/original.jpg?1483096805', width: null } }, name: 'Dot Pixis', slug: dot-pixis }, 39815: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39815/original.jpg?1483096805', width: null } }, name: 'Eld Jinn', slug: erd-gin }, 83223: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/83223/original.jpg?1485083597', width: null } }, name: 'Eld''s lover', slug: eld-s-lover }, 39823: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39823/original.jpg?1483096805', width: null } }, name: 'Erwin Smith', slug: erwin-smith }, 39809: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39809/original.jpg?1483096805', width: null } }, name: 'Father Ackerman', slug: father-ackerman }, 88007: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/88007/original.jpg?1485085456', width: null } }, name: 'Father Bozado', slug: father-bozado }, 90705: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/90705/original.jpg?1485086503', width: null } }, name: 'Father Leonhart', slug: father-leonhart }, 91050: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/91050/original.jpg?1485086660', width: null } }, name: 'Father Ral', slug: father-ral }, 39802: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39802/original.jpg?1483096805', width: null } }, name: Franz, slug: franz-06354328-6618-42d4-be45-3fcff7b57e8a }, 39800: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39800/original.jpg?1483096805', width: null } }, name: 'Grandfather Arlert', slug: armin-s-grandfather }, 88409: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/88409/original.jpg?1485085615', width: null } }, name: 'Grandfather Schultz', slug: grandfather-schultz }, 39828: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39828/original.jpg?1483096805', width: null } }, name: 'Grisha Yeager', slug: grisha-yeager }, 39821: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39821/original.jpg?1483096805', width: null } }, name: 'Gunther Schultz', slug: gunter-schulz }, 39807: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39807/original.jpg?1483096805', width: null } }, name: Gustav, slug: gustav-bb1524a1-58c3-484d-9da1-8fa5880a1e69 }, 39831: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39831/original.jpg?1483096805', width: null } }, name: 'Hange Zoë', slug: hange-zoe }, 39803: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39803/original.jpg?1483096805', width: null } }, name: Hannah, slug: hannah }, 39794: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39794/original.jpg?1483096805', width: null } }, name: Hannes, slug: hannes }, 52590: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52590/original.jpg?1483096805', width: null } }, name: 'Hitch Dreyse', slug: hitch-dreyse }, 39797: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39797/original.jpg?1483096805', width: null } }, name: Hugo, slug: hugo }, 39814: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39814/original.jpg?1483096805', width: null } }, name: 'Ian Dietrich', slug: ian-dietrich }, 39805: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39805/original.jpg?1483096805', width: null } }, name: Instructor, slug: megane-no-kyoukan }, 38510: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38510/original.jpg?1483096805', width: null } }, name: 'Jean Kirstein', slug: jean-kirschtein }, 72984: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/72984/original.jpg?1485079775', width: null } }, name: Jurgen, slug: jurgen }, 52585: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52585/original.jpg?1483096805', width: null } }, name: Keiji, slug: keiji }, 39822: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39822/original.jpg?1483096805', width: null } }, name: 'Keith Shardis', slug: keith-shardis }, 39825: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39825/original.jpg?1483096805', width: null } }, name: 'Kitts Verman', slug: kitts-verman }, 38512: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38512/original.jpg?1483096805', width: null } }, name: 'Krista Lenz', slug: christa-renz }, 39556: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39556/original.jpg?1483096805', width: null } }, name: Levi, slug: levi }, 52596: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52596/original.jpg?1483096805', width: null } }, name: 'Luke Siss', slug: luke-siss }, 38508: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38508/original.jpg?1483096805', width: null } }, name: 'Marco Bott', slug: marco-bodt }, 52591: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52591/original.jpg?1483096805', width: null } }, name: 'Marlo Freudenberg', slug: marlo-freudenberg }, 39829: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39829/original.jpg?1483096805', width: null } }, name: 'Mike Zacharias', slug: mike-zacharias }, 39830: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39830/original.jpg?1483096805', width: null } }, name: 'Millius Zermusky', slug: millius-zermusky }, 39813: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39813/original.jpg?1483096805', width: null } }, name: 'Mina Carolina', slug: mina-carolina }, 39817: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39817/original.jpg?1483096805', width: null } }, name: 'Mitabi Jarnach', slug: mitabi-jarnach }, 52587: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52587/original.jpg?1483096805', width: null } }, name: 'Moblit Berner', slug: moblit-berner }, 39798: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39798/original.jpg?1483096805', width: null } }, name: Moses, slug: moses }, 39799: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39799/original.jpg?1483096805', width: null } }, name: 'Moses''s Mother', slug: moses-s-mother }, 39810: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39810/original.jpg?1483096805', width: null } }, name: 'Mother Ackerman', slug: mother-ackerman }, 86508: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/86508/original.jpg?1485084880', width: null } }, name: 'Mother Bozado', slug: mother-bozado }, 67384: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/67384/original.jpg?1485077794', width: null } }, name: 'Mother Jinn', slug: mother-jinn }, 72049: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/72049/original.jpg?1485079414', width: null } }, name: 'Mother Schultz', slug: mother-schultz }, 39824: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39824/original.jpg?1483096805', width: null } }, name: 'Nack Tierce', slug: nack-tierce }, 52583: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52583/original.jpg?1483096805', width: null } }, name: Nanaba, slug: nanaba }, 39795: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39795/original.jpg?1483096805', width: null } }, name: Nick, slug: nick-77245a04-f2c1-40ce-b458-222d708e2fe1 }, 52589: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52589/original.jpg?1483096805', width: null } }, name: 'Nile Dok', slug: nile-dok }, 52588: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/52588/original.jpg?1483096805', width: null } }, name: 'Oluo Bozado', slug: oluo-bozado }, 92572: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/92572/original.jpg?1485087363', width: null } }, name: Pere, slug: pere }, 39819: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39819/original.jpg?1483096805', width: null } }, name: 'Petra Ral', slug: petra-ral }, 39811: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39811/original.jpg?1483096805', width: null } }, name: 'Reiner Braun', slug: reiner-braun }, 39812: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39812/original.jpg?1483096805', width: null } }, name: 'Riko Brzenska', slug: riko-brzenska }, 39801: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39801/original.jpg?1483096805', width: null } }, name: Samuel, slug: samuel }, 38509: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/38509/original.jpg?1483096805', width: null } }, name: 'Sasha Blouse', slug: sasha-braus }, 39826: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39826/original.jpg?1483096805', width: null } }, name: 'Thomas Wagner', slug: thomas-wagner }, 39808: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39808/original.jpg?1483096805', width: null } }, name: Tom, slug: tom-7c968172-923e-4d22-823a-251d8856bfb5 }, 39796: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/39796/original.jpg?1483096805', width: null } }, name: Ymir, slug: ymir-24b34432-0237-4b22-a800-2e1ac512db5c } } +links: + AniDB: 'https://anidb.net/anime/9541' + Anilist: 'https://anilist.co/anime/16498/' + Kitsu: 'https://kitsu.io/anime/attack-on-titan' + MyAnimeList: 'https://myanimelist.net/anime/16498' +staff: + 'ADR Director': [{ id: '466', name: 'Mike McFarland', image: { original: 'https://media.kitsu.io/people/images/466/original.jpg?1416260915' }, slug: mike-mcfarland }] + 'Animation Director': [{ id: '22734', name: 'Kana Miyai', image: { original: /images/original/missing.png }, slug: kana-miyai }, { id: '22705', name: 'Satoshi Sakai', image: { original: /images/original/missing.png }, slug: satoshi-sakai }] + 'Animation Director, Key Animation': [{ id: '24925', name: 'Yumiko Ishii', image: { original: /images/original/missing.png }, slug: yumiko-ishii }] + 'Assistant Director': [{ id: '21400', name: 'Masashi Koizuka', image: { original: 'https://media.kitsu.io/people/images/21400/original.jpg?1533270885' }, slug: masashi-koizuka }] + 'Background Art': [{ id: '23813', name: 'Jun Okabe', image: { original: /images/original/missing.png }, slug: jun-okabe }] + 'Character Design': [{ id: '3006', name: 'Kyouji Asano', image: { original: 'https://media.kitsu.io/people/images/3006/original.jpg?1533270886' }, slug: kyouji-asano }] + 'Color Design': [{ id: '23292', name: 'Satoshi Hashimoto', image: { original: /images/original/missing.png }, slug: satoshi-hashimoto-d5208a27-4ad0-4f06-b53d-eb95fa7105db }] + 'Color Setting': [{ id: '17186', name: 'Izumi Hirose', image: { original: /images/original/missing.png }, slug: izumi-hirose }] + Director: [{ id: '30444', name: 'Shuuhei Yabuta', image: { original: 'https://media.kitsu.io/people/images/30444/original.jpg?1533274624' }, slug: shuuhei-yabuta }, { id: '3976', name: 'Tetsurou Araki', image: { original: 'https://media.kitsu.io/people/images/3976/original.jpg?1416264991' }, slug: tetsurou-araki }] + 'Director of Photography': [{ id: '22537', name: 'Kazuhiro Yamada', image: { original: /images/original/missing.png }, slug: kazuhiro-yamada }] + Editing: [{ id: '22109', name: 'Aya Hida', image: { original: /images/original/missing.png }, slug: aya-hida }] + 'Episode Director': [{ id: '31841', name: 'Tatsuma Minamikawa', image: { original: 'https://media.kitsu.io/people/images/31841/original.jpg?1533274884' }, slug: tatsuma-minamikawa }] + 'Episode Director, Assistant Director': [{ id: '9220', name: 'Hiroyuki Tanaka', image: { original: 'https://media.kitsu.io/people/images/9220/original.jpg?1416270341' }, slug: hiroyuki-tanaka }] + 'Episode Director, Key Animation': [{ id: '21437', name: 'Yoshiyuki Fujiwara', image: { original: /images/original/missing.png }, slug: yoshiyuki-fujiwara }] + 'Episode Director, Storyboard': [{ id: '1460', name: 'Sayo Yamamoto', image: { original: 'https://media.kitsu.io/people/images/1460/original.jpg?1416262235' }, slug: sayo-yamamoto }, { id: '21476', name: 'Shinpei Ezaki', image: { original: /images/original/missing.png }, slug: shinpei-ezaki }, { id: '3982', name: 'Yuzuru Tachikawa', image: { original: 'https://media.kitsu.io/people/images/3982/original.jpg?1533272323' }, slug: yuzuru-tachikawa }] + 'Episode Director, Storyboard, Animation Director, Key Animation, Background Art': [{ id: '364', name: 'Masashi Ishihama', image: { original: 'https://media.kitsu.io/people/images/364/original.jpg?1416260777' }, slug: masashi-ishihama }] + 'Episode Director, Storyboard, Key Animation': [{ id: '21396', name: 'Daisuke Tokudo', image: { original: 'https://media.kitsu.io/people/images/21396/original.jpg?1533273728' }, slug: daisuke-tokudo }] + 'Executive Producer': [{ id: '435', name: 'Gen Fukunaga', image: { original: 'https://media.kitsu.io/people/images/435/original.jpg?1416260869' }, slug: gen-fukunaga }] + 'Inserted Song Performance': [{ id: '9221', name: 'Aimee Blackschleger', image: { original: 'https://media.kitsu.io/people/images/9221/original.jpg?1416270342' }, slug: aimee-blackschleger }, { id: '9111', name: Cyua, image: { original: 'https://media.kitsu.io/people/images/9111/original.jpg?1416270225' }, slug: cyua }, { id: '8161', name: 'Mika Kobayashi', image: { original: 'https://media.kitsu.io/people/images/8161/original.jpg?1416269452' }, slug: mika-kobayashi }] + 'Key Animation': [{ id: '9499', name: 'Akira Hamaguchi', image: { original: /images/original/missing.png }, slug: akira-hamaguchi }, { id: '33987', name: 'Akira Tabata', image: { original: /images/original/missing.png }, slug: akira-tabata }, { id: '23895', name: 'Arifumi Imai', image: { original: 'https://media.kitsu.io/people/images/23895/original.jpg?1486414118' }, slug: arifumi-imai }, { id: '8034', name: 'Atsushi Ikariya', image: { original: 'https://media.kitsu.io/people/images/8034/original.jpg?1416269308' }, slug: atsushi-ikariya }, { id: '23332', name: 'Hideki Takahashi', image: { original: /images/original/missing.png }, slug: hideki-takahashi-4e5a48eb-bac3-40a3-96ce-e19ebb50a6c3 }, { id: '2097', name: 'Hiromi Katou', image: { original: 'https://media.kitsu.io/people/images/2097/original.jpg?1533271648' }, slug: hiromi-katou }, { id: '254', name: 'Hironori Tanaka', image: { original: /images/original/missing.png }, slug: hironori-tanaka }, { id: '34384', name: 'Kazuhiko Wanibuchi', image: { original: /images/original/missing.png }, slug: kazuhiko-wanibuchi }, { id: '9486', name: 'Kazuhiro Miwa', image: { original: 'https://media.kitsu.io/people/images/9486/original.jpg?1533273224' }, slug: kazuhiro-miwa }, { id: '123', name: 'Kenichi Yoshida', image: { original: 'https://media.kitsu.io/people/images/123/original.jpg?1533271550' }, slug: kenichi-yoshida }, { id: '9490', name: 'Kouichi Arai', image: { original: 'https://media.kitsu.io/people/images/9490/original.jpg?1533272773' }, slug: kouichi-arai }, { id: '22444', name: 'Masami Gotou', image: { original: /images/original/missing.png }, slug: masami-gotou }, { id: '9491', name: 'Misao Abe', image: { original: /images/original/missing.png }, slug: misao-abe }, { id: '24522', name: 'Naoki Kobayashi', image: { original: /images/original/missing.png }, slug: naoki-kobayashi }, { id: '34806', name: 'Orie Tanaka', image: { original: /images/original/missing.png }, slug: orie-tanaka }, { id: '23566', name: 'Senbon Umishima', image: { original: /images/original/missing.png }, slug: senbon-umishima }, { id: '3414', name: 'Shirou Shibata', image: { original: /images/original/missing.png }, slug: shirou-shibata }, { id: '23609', name: 'Takashi Habe', image: { original: /images/original/missing.png }, slug: takashi-habe }, { id: '22605', name: 'Tatsuya Koyanagi', image: { original: 'https://media.kitsu.io/people/images/22605/original.jpg?1533274386' }, slug: tatsuya-koyanagi }, { id: '22417', name: 'Tatsuya Miki', image: { original: /images/original/missing.png }, slug: tatsuya-miki }, { id: '3577', name: 'Toshiyuki Komaru', image: { original: /images/original/missing.png }, slug: toshiyuki-komaru }, { id: '34195', name: 'You Moriyama', image: { original: 'https://media.kitsu.io/people/images/34195/original.jpg?1533275252' }, slug: you-moriyama }] + 'Key Animation, Animation Director, In-Between Animation': [{ id: '14999', name: 'Toshiyuki Satou', image: { original: /images/original/missing.png }, slug: toshiyuki-satou }] + 'Key Animation, Chief Animation Director, Animation Director': [{ id: '22549', name: 'Takaaki Chiba', image: { original: /images/original/missing.png }, slug: takaaki-chiba }] + Music: [{ id: '5377', name: 'Hiroyuki Sawano', image: { original: 'https://media.kitsu.io/people/images/5377/original.jpg?1416266441' }, slug: hiroyuki-sawano }] + 'Original Creator': [{ id: '8719', name: 'Hajime Isayama', image: { original: 'https://media.kitsu.io/people/images/8719/original.jpg?1416270073' }, slug: hajime-isayama }] + Producer: [{ id: '22220', name: 'Jouji Wada', image: { original: 'https://media.kitsu.io/people/images/22220/original.jpg?1533274286' }, slug: jouji-wada }] + Script: [{ id: '19526', name: 'Hiroshi Seko', image: { original: /images/original/missing.png }, slug: hiroshi-seko }, { id: '1216', name: 'John Burgmeier', image: { original: 'https://media.kitsu.io/people/images/1216/original.jpg?1416261888' }, slug: john-burgmeier }, { id: '440', name: 'John Michael Tatum', image: { original: 'https://media.kitsu.io/people/images/440/original.jpg?1416260875' }, slug: john-michael-tatum }, { id: '1461', name: 'Noboru Takagi', image: { original: 'https://media.kitsu.io/people/images/1461/original.jpg?1416262236' }, slug: noboru-takagi }, { id: '7687', name: 'Tyson Rinehart', image: { original: 'https://media.kitsu.io/people/images/7687/original.jpg?1416268918' }, slug: tyson-rinehart }] + 'Script, Series Composition': [{ id: '1918', name: 'Yasuko Kobayashi', image: { original: 'https://media.kitsu.io/people/images/1918/original.jpg?1416262710' }, slug: yasuko-kobayashi }] + 'Sound Director': [{ id: '431', name: 'Masafumi Mima', image: { original: 'https://media.kitsu.io/people/images/431/original.jpg?1416260864' }, slug: masafumi-mima }] + 'Sound Effects': [{ id: '23501', name: 'Naoto Yamatani', image: { original: /images/original/missing.png }, slug: naoto-yamatani }, { id: '5639', name: 'Shizuo Kurahashi', image: { original: /images/original/missing.png }, slug: shizuo-kurahashi }] + Storyboard: [{ id: '21610', name: 'Keiichi Sasajima', image: { original: /images/original/missing.png }, slug: keiichi-sasajima }, { id: '24043', name: 'Minoru Oohara', image: { original: /images/original/missing.png }, slug: minoru-oohara }] + 'Storyboard, Key Animation': [{ id: '21721', name: 'Tomohiro Hirata', image: { original: 'https://media.kitsu.io/people/images/21721/original.jpg?1533274009' }, slug: tomohiro-hirata }] + 'Theme Song Arrangement': [{ id: '34959', name: 'Seiji Kameda', image: { original: 'https://media.kitsu.io/people/images/34959/original.jpg?1533275373' }, slug: seiji-kameda }] + 'Theme Song Lyrics, Inserted Song Performance': [{ id: '17751', name: mpi, image: { original: 'https://media.kitsu.io/people/images/17751/original.jpg?1533270888' }, slug: mpi }] + 'Theme Song Lyrics, Theme Song Composition, Theme Song Arrangement': [{ id: '17299', name: Revo, image: { original: 'https://media.kitsu.io/people/images/17299/original.jpg?1533270886' }, slug: revo }] + 'Theme Song Performance': [{ id: '18196', name: 'Cinema Staff', image: { original: 'https://media.kitsu.io/people/images/18196/original.jpg?1533273064' }, slug: cinema-staff }, { id: '8718', name: 'Linked Horizon', image: { original: 'https://media.kitsu.io/people/images/8718/original.jpg?1416270072' }, slug: linked-horizon }, { id: '6847', name: 'Yoko Hikasa', image: { original: 'https://media.kitsu.io/people/images/6847/original.jpg?1416268029' }, slug: yoko-hikasa }] age_rating: R age_rating_guide: 'Violence, Profanity' -cover_image: 'https://media.kitsu.io/anime/poster_images/7442/small.jpg?1418580054' +cover_image: 'https://media.kitsu.io/anime/poster_images/7442/small.jpg?1597698856' episode_count: 25 -episode_length: 24 -genres: { } -id: 32344 -included: - categories: { 23: { name: 'Super Power', slug: super-power, description: null }, 11: { name: Fantasy, slug: fantasy, description: '' }, 4: { name: Drama, slug: drama, description: '' }, 1: { name: Action, slug: action, description: '' } } - mappings: { 5686: { externalSite: myanimelist/anime, externalId: '16498', relationships: { media: { links: { self: 'https://kitsu.io/api/edge/mappings/5686/relationships/media', related: 'https://kitsu.io/api/edge/mappings/5686/media' } } } }, 14153: { externalSite: thetvdb/series, externalId: '267440', relationships: { media: { links: { self: 'https://kitsu.io/api/edge/mappings/14153/relationships/media', related: 'https://kitsu.io/api/edge/mappings/14153/media' } } } }, 15073: { externalSite: thetvdb/season, externalId: '514060', relationships: { media: { links: { self: 'https://kitsu.io/api/edge/mappings/15073/relationships/media', related: 'https://kitsu.io/api/edge/mappings/15073/media' } } } } } - streamingLinks: { 103: { url: 'http://www.crunchyroll.com/attack-on-titan', subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/103/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/103/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/103/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/103/media' } } } }, 102: { url: 'http://www.hulu.com/attack-on-titan', subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/102/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/102/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/102/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/102/media' } } } }, 101: { url: 'http://www.funimation.com/shows/attack-on-titan/videos/episodes', subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/101/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/101/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/101/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/101/media' } } } }, 100: { url: t, subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/100/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/100/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/100/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/100/media' } } } } } +episode_length: 1440 +genres: + - Action + - Adventure + - 'Alternative Past' + - Angst + - Drama + - Fantasy + - Horror + - Military + - 'Post Apocalypse' + - Shounen + - 'Super Power' + - Violence +id: '7442' show_type: TV slug: attack-on-titan status: 'Finished Airing' streaming_links: - { meta: { name: Crunchyroll, link: true, image: streaming-logos/crunchyroll.svg }, link: 'http://www.crunchyroll.com/attack-on-titan', subs: [en], dubs: [ja] } - - { meta: { name: Funimation, link: true, image: streaming-logos/funimation.svg }, link: 'http://www.funimation.com/shows/attack-on-titan/videos/episodes', subs: [en], dubs: [ja] } - - { meta: { name: Hulu, link: true, image: streaming-logos/hulu.svg }, link: 'http://www.hulu.com/attack-on-titan', subs: [en], dubs: [ja] } - - { meta: { name: Netflix, link: false, image: streaming-logos/netflix.svg }, link: t, subs: [en], dubs: [ja] } + - { meta: { name: Funimation, link: true, image: streaming-logos/funimation.svg }, link: 'https://www.funimation.com/shows/attack-on-titan/', subs: [en], dubs: [ja] } + - { meta: { name: Hulu, link: true, image: streaming-logos/hulu.svg }, link: 'https://www.hulu.com/attack-on-titan', subs: [en], dubs: [ja] } + - { meta: { name: Netflix, link: false, image: streaming-logos/netflix.svg }, link: 'https://www.netflix.com/title/70299043', subs: [en], dubs: [ja] } + - { meta: { name: TubiTV, link: true, image: streaming-logos/tubitv.svg }, link: 'https://tubitv.com/series/2318', subs: [en], dubs: [ja] } synopsis: | - Several hundred years ago, humans were nearly exterminated by titans. Titans are typically several stories tall, seem to have no intelligence, devour human beings and, worst of all, seem to do it for the pleasure rather than as a food source. A small percentage of humanity survived by enclosing themselves in a city protected by extremely high walls, even taller than the biggest of titans. Flash forward to the present and the city has not seen a titan in over 100 years. Teenage boy Eren and his foster sister Mikasa witness something horrific as the city walls are destroyed by a colossal titan that appears out of thin air. As the smaller titans flood the city, the two kids watch in horror as their mother is eaten alive. Eren vows that he will murder every single titan and take revenge for all of mankind. + Centuries ago, mankind was slaughtered to near extinction by monstrous humanoid creatures called titans, forcing humans to hide in fear behind enormous concentric walls. What makes these giants truly terrifying is that their taste for human flesh is not born out of hunger but what appears to be out of pleasure. To ensure their survival, the remnants of humanity began living within defensive barriers, resulting in one hundred years without a single titan encounter. However, that fragile calm is soon shattered when a colossal titan manages to breach the supposedly impregnable outer wall, reigniting the fight for survival against the man-eating abominations. - (Source: ANN) + After witnessing a horrific personal loss at the hands of the invading creatures, Eren Yeager dedicates his life to their eradication by enlisting into the Survey Corps, an elite military unit that combats the merciless humanoids outside the protection of the walls. Based on Hajime Isayama's award-winning manga, Shingeki no Kyojin follows Eren, along with his adopted sister Mikasa Ackerman and his childhood friend Armin Arlert, as they join the brutal war against the titans and race to discover a way of defeating them before the last walls are breached. + + (Source: MAL Rewrite) title: 'Attack on Titan' titles: - - 'Attack on Titan' + 2: 'Shingeki no Kyojin' + 4: 進撃の巨人 +titles_more: + - AoT - 'Shingeki no Kyojin' - 進撃の巨人 -titles_more: - 2: 'Shingeki no Kyojin' - 3: 進撃の巨人 -trailer_id: n4Nj6Y_SNYI +trailer_id: LHtdKWJdif4 +total_length: 36000 url: 'https://kitsu.io/anime/attack-on-titan' diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml index 7e670c63..e8d67ce4 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml @@ -1,60 +1,24 @@ - empty: false - id: '15084773' - mal_id: '26769' - chapters: { read: 67, total: '-' } + id: '15288185' + mal_id: '28091' + chapters: { read: 94, total: '-' } volumes: { read: '-', total: '-' } - manga: { empty: false, genres: [Comedy, Romance, School, 'Slice of Life', Thriller], id: '20286', image: 'https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999', slug: bokura-wa-minna-kawaisou, title: 'Bokura wa Minna Kawaisou', titles: { }, type: Manga, url: 'https://kitsu.io/manga/bokura-wa-minna-kawaisou' } - reading_status: current - notes: '' - rereading: false - reread: 0 - user_rating: 9 -- - empty: false - id: '15085607' - mal_id: '16' - chapters: { read: 17, total: 120 } - volumes: { read: '-', total: 14 } - manga: { empty: false, genres: [Comedy, Ecchi, Harem, Romance, Sports], id: '47', image: 'https://media.kitsu.io/manga/poster_images/47/small.jpg?1434249493', slug: love-hina, title: 'Love Hina', titles: { }, type: Manga, url: 'https://kitsu.io/manga/love-hina' } - reading_status: current - notes: '' - rereading: false - reread: 0 - user_rating: 7 -- - empty: false - id: '15084529' - mal_id: '35003' - chapters: { read: 16, total: '-' } - volumes: { read: '-', total: '-' } - manga: { empty: false, genres: [Comedy, Ecchi, 'Gender Bender', Romance, School, Sports, Supernatural], id: '11777', image: 'https://media.kitsu.io/manga/poster_images/11777/small.jpg?1438784325', slug: yamada-kun-to-7-nin-no-majo, title: 'Yamada-kun to 7-nin no Majo', titles: ['Yamada-kun and the Seven Witches'], type: Manga, url: 'https://kitsu.io/manga/yamada-kun-to-7-nin-no-majo' } - reading_status: current - notes: '' - rereading: false - reread: 0 - user_rating: 9 -- - empty: false - id: '15312827' - mal_id: '78523' - chapters: { read: 68, total: '-' } - volumes: { read: '-', total: '-' } - manga: { empty: false, genres: [Romance, School, 'Slice of Life'], id: '27175', image: 'https://media.kitsu.io/manga/poster_images/27175/small.jpg?1464379411', slug: relife, title: ReLIFE, titles: { }, type: Manga, url: 'https://kitsu.io/manga/relife' } - reading_status: current - notes: '' - rereading: false - reread: 0 - user_rating: '-' -- - empty: false - id: '15084769' - mal_id: '60815' - chapters: { read: 43, total: '-' } - volumes: { read: '-', total: '-' } - manga: { empty: false, genres: [Comedy, School, 'Slice of Life'], id: '25491', image: 'https://media.kitsu.io/manga/poster_images/25491/small.jpg?1434305043', slug: joshikausei, title: Joshikausei, titles: { }, type: Manga, url: 'https://kitsu.io/manga/joshikausei' } + manga: { empty: false, genres: { }, id: '21733', image: 'https://media.kitsu.io/manga/poster_images/21733/small.jpg?1496845097', slug: tonari-no-seki-kun, title: 'Tonari no Seki-kun', titles: ['My Neighbour Seki', となりの関くん], type: Manga, url: 'https://kitsu.io/manga/tonari-no-seki-kun' } reading_status: current notes: '' rereading: false reread: 0 user_rating: 8 +- + empty: false + id: '15084769' + mal_id: '60815' + chapters: { read: 87, total: '-' } + volumes: { read: '-', total: '-' } + manga: { empty: false, genres: { }, id: '25491', image: 'https://media.kitsu.io/manga/poster_images/25491/small.jpg?1499026452', slug: joshikausei, title: Joshikausei, titles: [女子かう生], type: Manga, url: 'https://kitsu.io/manga/joshikausei' } + reading_status: current + notes: 'Wordless, and it works.' + rereading: false + reread: 0 + user_rating: 8 diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php deleted file mode 100644 index fc87bc9f..00000000 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php +++ /dev/null @@ -1,86 +0,0 @@ - - array ( - ), - 'chapter_count' => '-', - 'cover_image' => 'https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999', - 'genres' => - array ( - ), - 'id' => '20286', - 'included' => - array ( - 'genres' => - array ( - 3 => - array ( - 'attributes' => - array ( - 'name' => 'Comedy', - 'slug' => 'comedy', - 'description' => NULL, - ), - ), - 24 => - array ( - 'attributes' => - array ( - 'name' => 'School', - 'slug' => 'school', - 'description' => NULL, - ), - ), - 16 => - array ( - 'attributes' => - array ( - 'name' => 'Slice of Life', - 'slug' => 'slice-of-life', - 'description' => '', - ), - ), - 14 => - array ( - 'attributes' => - array ( - 'name' => 'Romance', - 'slug' => 'romance', - 'description' => '', - ), - ), - 18 => - array ( - 'attributes' => - array ( - 'name' => 'Thriller', - 'slug' => 'thriller', - 'description' => NULL, - ), - ), - ), - 'mappings' => - array ( - 48014 => - array ( - 'attributes' => - array ( - 'externalSite' => 'myanimelist/manga', - 'externalId' => '26769', - ), - ), - ), - ), - 'manga_type' => 'manga', - 'staff' => - array ( - ), - 'synopsis' => 'Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well! -(Source: Kirei Cake)', - 'title' => 'Bokura wa Minna Kawaisou', - 'titles' => - array ( - 0 => NULL, - ), - 'url' => 'https://kitsu.io/manga/bokura-wa-minna-kawaisou', - 'volume_count' => '-', -)); diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml index 7ba6eb79..d30e7d36 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml @@ -1,19 +1,32 @@ empty: false -characters: { } -chapter_count: '-' +age_rating: PG +age_rating_guide: '' +characters: + main: { 40541: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/40541/original.jpg?1483096805', width: null } }, name: 'Kazunari Usa', slug: kazunari-usa }, 40540: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/40540/original.jpg?1483096805', width: null } }, name: 'Ritsu Kawai', slug: ritsu-kawai } } + background: { 62591: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/62591/original.jpg?1485073100', width: null } }, name: Chinatsu, slug: chinatsu }, 72839: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/72839/original.jpg?1485079724', width: null } }, name: Hayashi, slug: hayashi-ec3a2705-5d5c-493c-b172-bbee2d04b5b9 }, 78362: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/78362/original.jpg?1485081676', width: null } }, name: Houjou, slug: houjou }, 90353: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/90353/original.jpg?1485086356', width: null } }, name: Kurokawa, slug: kurokawa-a493ddf6-0f02-4abf-8b18-ab6ae2198b6e }, 77996: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/77996/original.jpg?1485081552', width: null } }, name: Maemura, slug: maemura }, 55132: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/55132/original.jpg?1483096805', width: null } }, name: 'Mayumi Nishikino', slug: mayumi-nishikino }, 71479: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/71479/original.jpg?1485079211', width: null } }, name: 'Miharu Tsuneda', slug: miharu-tsuneda }, 55134: { image: { original: { height: null, name: original, url: '/images/original/missing.png?1483096805', width: null } }, name: 'Mother Usa', slug: mother-usa }, 55135: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/55135/original.jpg?1483096805', width: null } }, name: 'Sayaka Watanabe', slug: sayaka-watanabe }, 95032: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/95032/original.jpg?1485088329', width: null } }, name: Shirosaki, slug: shirosaki-2ed2e15c-9cee-4756-92f1-027c4820e224 }, 55131: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/55131/original.jpg?1483096805', width: null } }, name: 'Sumiko Kawai', slug: sumiko-kawai }, 74335: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/74335/original.jpg?1485080245', width: null } }, name: 'Tae Shinohara', slug: tae-shinohara }, 55133: { image: { original: { height: null, name: original, url: 'https://media.kitsu.io/characters/images/55133/original.jpg?1483096805', width: null } }, name: Tagami, slug: tagami }, 83463: { image: { original: { height: null, name: original, url: /images/original/missing.png, width: null } }, name: 'Yoko Mabuchi', slug: yoko-mabuchi } } +chapter_count: 90 cover_image: 'https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999' -genres: { } +genres: + - Comedy + - Romance + - 'School Life' + - 'Slice of Life' +links: + Anilist: 'https://anilist.co/anime/56769/' + Kitsu: 'https://kitsu.io/manga/bokura-wa-minna-kawaisou' + MyAnimeList: 'https://myanimelist.net/manga/26769' id: '20286' -included: - genres: { 3: { attributes: { name: Comedy, slug: comedy, description: null } }, 24: { attributes: { name: School, slug: school, description: null } }, 16: { attributes: { name: 'Slice of Life', slug: slice-of-life, description: '' } }, 14: { attributes: { name: Romance, slug: romance, description: '' } }, 18: { attributes: { name: Thriller, slug: thriller, description: null } } } - mappings: { 48014: { attributes: { externalSite: myanimelist/manga, externalId: '26769' } } } -manga_type: manga -staff: { } -synopsis: | - Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well! - (Source: Kirei Cake) -title: 'Bokura wa Minna Kawaisou' +manga_type: MANGA +status: Completed +staff: + 'Story & Art': [{ id: '8712', slug: ruri-miyahara, name: 'Ruri Miyahara', image: { original: 'https://media.kitsu.io/people/images/8712/original.jpg?1533271952' } }] +synopsis: "Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well!\r\n(Source: Kirei Cake)" +title: 'Bokura wa Minna Kawai-sou' titles: - - null + 1: 'The Kawai Complex Guide to Manors and Hostel' + 4: 僕らはみんな河合荘 +titles_more: + - 'The Kawai Complex Guide to Manors and Hostel' + - 僕らはみんな河合荘 url: 'https://kitsu.io/manga/bokura-wa-minna-kawaisou' -volume_count: '-' +volume_count: 10 diff --git a/tests/AnimeClient/test_data/Kitsu/animeAfterTransform.json b/tests/AnimeClient/test_data/Kitsu/animeAfterTransform.json deleted file mode 100644 index 32c29e95..00000000 --- a/tests/AnimeClient/test_data/Kitsu/animeAfterTransform.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "title": "Attack on Titan", - "titles": ["Attack on Titan", "Shingeki no Kyojin", "\u9032\u6483\u306e\u5de8\u4eba"], - "status": "Finished Airing", - "cover_image": "https:\/\/media.kitsu.io\/anime\/poster_images\/7442\/small.jpg?1418580054", - "show_type": "TV", - "episode_count": 25, - "episode_length": 24, - "synopsis": "Several hundred years ago, humans were nearly exterminated by titans. Titans are typically several stories tall, seem to have no intelligence, devour human beings and, worst of all, seem to do it for the pleasure rather than as a food source. A small percentage of humanity survived by enclosing themselves in a city protected by extremely high walls, even taller than the biggest of titans. Flash forward to the present and the city has not seen a titan in over 100 years. Teenage boy Eren and his foster sister Mikasa witness something horrific as the city walls are destroyed by a colossal titan that appears out of thin air. As the smaller titans flood the city, the two kids watch in horror as their mother is eaten alive. Eren vows that he will murder every single titan and take revenge for all of mankind.\n\n(Source: ANN)", - "age_rating": "R", - "age_rating_guide": "Violence, Profanity", - "url": "https:\/\/kitsu.io\/anime\/attack-on-titan", - "genres": ["Action", "Drama", "Fantasy", "Super Power"], - "streaming_links": [{ - "meta": { - "name": "Crunchyroll", - "link": true, - "image": "streaming-logos\/crunchyroll.svg" - }, - "link": "http:\/\/www.crunchyroll.com\/attack-on-titan", - "subs": ["en"], - "dubs": ["ja"] - }, { - "meta": { - "name": "Hulu", - "link": true, - "image": "streaming-logos\/hulu.svg" - }, - "link": "http:\/\/www.hulu.com\/attack-on-titan", - "subs": ["en"], - "dubs": ["ja"] - }, { - "meta": { - "name": "Funimation", - "link": true, - "image": "streaming-logos\/funimation.svg" - }, - "link": "http:\/\/www.funimation.com\/shows\/attack-on-titan\/videos\/episodes", - "subs": ["en"], - "dubs": ["ja"] - }, { - "meta": { - "name": "Netflix", - "link": false, - "image": "streaming-logos\/netflix.svg" - }, - "link": "t", - "subs": ["en"], - "dubs": ["ja"] - }], - "slug": "attack-on-titan" -} \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/animeBeforeTransform.json b/tests/AnimeClient/test_data/Kitsu/animeBeforeTransform.json index 4e240b34..fd40fdcc 100644 --- a/tests/AnimeClient/test_data/Kitsu/animeBeforeTransform.json +++ b/tests/AnimeClient/test_data/Kitsu/animeBeforeTransform.json @@ -1,292 +1,3754 @@ { - "id": 32344, - "slug": "attack-on-titan", - "synopsis": "Several hundred years ago, humans were nearly exterminated by titans. Titans are typically several stories tall, seem to have no intelligence, devour human beings and, worst of all, seem to do it for the pleasure rather than as a food source. A small percentage of humanity survived by enclosing themselves in a city protected by extremely high walls, even taller than the biggest of titans. Flash forward to the present and the city has not seen a titan in over 100 years. Teenage boy Eren and his foster sister Mikasa witness something horrific as the city walls are destroyed by a colossal titan that appears out of thin air. As the smaller titans flood the city, the two kids watch in horror as their mother is eaten alive. Eren vows that he will murder every single titan and take revenge for all of mankind.\n\n(Source: ANN)", - "coverImageTopOffset": 263, - "titles": { - "en": "Attack on Titan", - "en_jp": "Shingeki no Kyojin", - "ja_jp": "\u9032\u6483\u306e\u5de8\u4eba" - }, - "canonicalTitle": "Attack on Titan", - "abbreviatedTitles": null, - "averageRating": 4.2678183033371, - "ratingFrequencies": { - "0.0": "3", - "0.5": "126", - "1.0": "292", - "1.5": "172", - "2.0": "394", - "2.5": "817", - "3.0": "2423", - "3.5": "3210", - "4.0": "5871", - "4.5": "6159", - "5.0": "13117", - "nil": "18571", - "0.479": "-1", - "4.658": "-3", - "4.726": "-1", - "4.932": "-1", - "2.05479452054794": "1", - "2.53424657534247": "1", - "4.10958904109589": "1", - "4.65753424657534": "3", - "4.72602739726027": "3", - "4.86301369863014": "1", - "4.93150684931507": "2", - "0.273972602739726": "1", - "0.410958904109589": "2", - "0.479452054794521": "1", - "0.684931506849315": "1" - }, - "startDate": "2013-04-07", - "endDate": "2013-09-28", - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/7442\/tiny.jpg?1418580054", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/7442\/small.jpg?1418580054", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/7442\/medium.jpg?1418580054", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/7442\/large.jpg?1418580054", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/7442\/original.jpg?1418580054" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/7442\/small.jpg?1471880659", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/7442\/large.jpg?1471880659", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/7442\/original.png?1471880659" - }, - "episodeCount": 25, - "episodeLength": 24, - "subtype": "TV", - "youtubeVideoId": "n4Nj6Y_SNYI", - "ageRating": "R", - "ageRatingGuide": "Violence, Profanity", - "showType": "TV", - "nsfw": false, - "included": [ - { - "id": "23", - "type": "categories", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/categories\/23" - }, - "attributes": { - "name": "Super Power", - "slug": "super-power", - "description": null - } - }, - { - "id": "11", - "type": "categories", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/categories\/11" - }, - "attributes": { - "name": "Fantasy", - "slug": "fantasy", - "description": "" - } - }, - { - "id": "4", - "type": "categories", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/categories\/4" - }, - "attributes": { - "name": "Drama", - "slug": "drama", - "description": "" - } - }, - { - "id": "1", - "type": "categories", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/categories\/1" - }, - "attributes": { - "name": "Action", - "slug": "action", - "description": "" - } - }, - { - "id": "5686", - "type": "mappings", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/mappings\/5686" - }, - "attributes": { - "externalSite": "myanimelist\/anime", - "externalId": "16498" - }, - "relationships": { - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/mappings\/5686\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/mappings\/5686\/media" - } - } - } - }, - { - "id": "14153", - "type": "mappings", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/mappings\/14153" - }, - "attributes": { - "externalSite": "thetvdb\/series", - "externalId": "267440" - }, - "relationships": { - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/mappings\/14153\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/mappings\/14153\/media" - } - } - } - }, - { - "id": "15073", - "type": "mappings", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/mappings\/15073" - }, - "attributes": { - "externalSite": "thetvdb\/season", - "externalId": "514060" - }, - "relationships": { - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/mappings\/15073\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/mappings\/15073\/media" - } - } - } - }, - { - "id": "103", - "type": "streamingLinks", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/103" - }, - "attributes": { - "url": "http:\/\/www.crunchyroll.com\/attack-on-titan", - "subs": [ - "en" - ], - "dubs": [ - "ja" - ] - }, - "relationships": { - "streamer": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/103\/relationships\/streamer", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/103\/streamer" - } - }, - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/103\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/103\/media" - } - } - } - }, - { - "id": "102", - "type": "streamingLinks", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/102" - }, - "attributes": { - "url": "http:\/\/www.hulu.com\/attack-on-titan", - "subs": [ - "en" - ], - "dubs": [ - "ja" - ] - }, - "relationships": { - "streamer": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/102\/relationships\/streamer", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/102\/streamer" - } - }, - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/102\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/102\/media" - } - } - } - }, - { - "id": "101", - "type": "streamingLinks", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/101" - }, - "attributes": { - "url": "http:\/\/www.funimation.com\/shows\/attack-on-titan\/videos\/episodes", - "subs": [ - "en" - ], - "dubs": [ - "ja" - ] - }, - "relationships": { - "streamer": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/101\/relationships\/streamer", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/101\/streamer" - } - }, - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/101\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/101\/media" - } - } - } - }, - { - "id": "100", - "type": "streamingLinks", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/100" - }, - "attributes": { - "url": "t", - "subs": [ - "en" - ], - "dubs": [ - "ja" - ] - }, - "relationships": { - "streamer": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/100\/relationships\/streamer", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/100\/streamer" - } - }, - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/100\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/streaming-links\/100\/media" - } - } - } - } - ] + "data": { + "findAnimeBySlug": { + "id": "7442", + "ageRating": "R", + "ageRatingGuide": "Violence, Profanity", + "posterImage": { + "original": { + "height": 1270, + "name": "original", + "url": "https://media.kitsu.io/anime/poster_images/7442/original.jpg?1597698856", + "width": 920 + }, + "views": [ + { + "height": 156, + "name": "tiny", + "url": "https://media.kitsu.io/anime/poster_images/7442/tiny.jpg?1597698856", + "width": 110 + }, + { + "height": 402, + "name": "small", + "url": "https://media.kitsu.io/anime/poster_images/7442/small.jpg?1597698856", + "width": 284 + }, + { + "height": 554, + "name": "medium", + "url": "https://media.kitsu.io/anime/poster_images/7442/medium.jpg?1597698856", + "width": 390 + }, + { + "height": 780, + "name": "large", + "url": "https://media.kitsu.io/anime/poster_images/7442/large.jpg?1597698856", + "width": 550 + } + ] + }, + "categories": { + "nodes": [ + { + "title": { + "en": "Shounen" + } + }, + { + "title": { + "en": "Post Apocalypse" + } + }, + { + "title": { + "en": "Violence" + } + }, + { + "title": { + "en": "Action" + } + }, + { + "title": { + "en": "Adventure" + } + }, + { + "title": { + "en": "Fantasy" + } + }, + { + "title": { + "en": "Alternative Past" + } + }, + { + "title": { + "en": "Angst" + } + }, + { + "title": { + "en": "Horror" + } + }, + { + "title": { + "en": "Drama" + } + }, + { + "title": { + "en": "Military" + } + }, + { + "title": { + "en": "Super Power" + } + } + ] + }, + "characters": { + "nodes": [ + { + "character": { + "id": "38506", + "names": { + "alternatives": [], + "canonical": "Armin Arlert", + "localized": { + "en": "Armin Arlert", + "ja_jp": "アルミン・アルレルト" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38506/original.jpg?1483096805", + "width": null + } + }, + "slug": "armin-arelet" + }, + "role": "MAIN" + }, + { + "character": { + "id": "38507", + "names": { + "alternatives": [], + "canonical": "Eren Yeager", + "localized": { + "en": "Eren Yeager", + "ja_jp": "エレン・イェーガー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38507/original.jpg?1483096805", + "width": null + } + }, + "slug": "eren-jager" + }, + "role": "MAIN" + }, + { + "character": { + "id": "39810", + "names": { + "alternatives": [], + "canonical": "Mother Ackerman", + "localized": { + "en": "Mother Ackerman", + "ja_jp": "ミカサの母" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39810/original.jpg?1483096805", + "width": null + } + }, + "slug": "mother-ackerman" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39809", + "names": { + "alternatives": [], + "canonical": "Father Ackerman", + "localized": { + "en": "Father Ackerman", + "ja_jp": "ミカサの父" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39809/original.jpg?1483096805", + "width": null + } + }, + "slug": "father-ackerman" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39800", + "names": { + "alternatives": [], + "canonical": "Grandfather Arlert", + "localized": { + "en": "Grandfather Arlert", + "ja_jp": "アルミンの祖父" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39800/original.jpg?1483096805", + "width": null + } + }, + "slug": "armin-s-grandfather" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39806", + "names": { + "alternatives": [ + "Barto", + "Wald" + ], + "canonical": "Balto", + "localized": { + "en": "Balto", + "ja_jp": "バルト" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39806/original.jpg?1483096805", + "width": null + } + }, + "slug": "balto" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52587", + "names": { + "alternatives": [], + "canonical": "Moblit Berner", + "localized": { + "en": "Moblit Berner", + "ja_jp": "モブリット・バーナー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52587/original.jpg?1483096805", + "width": null + } + }, + "slug": "moblit-berner" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38509", + "names": { + "alternatives": [ + "Potato Girl" + ], + "canonical": "Sasha Blouse", + "localized": { + "en": "Sasha Blouse", + "ja_jp": "サシャ・ブラウス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38509/original.jpg?1483096805", + "width": null + } + }, + "slug": "sasha-braus" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38508", + "names": { + "alternatives": [], + "canonical": "Marco Bott", + "localized": { + "en": "Marco Bott", + "ja_jp": "マルコ・ボット" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38508/original.jpg?1483096805", + "width": null + } + }, + "slug": "marco-bodt" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "86508", + "names": { + "alternatives": [], + "canonical": "Mother Bozado", + "localized": { + "en": "Mother Bozado", + "ja_jp": "オルオ母" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/86508/original.jpg?1485084880", + "width": null + } + }, + "slug": "mother-bozado" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "88007", + "names": { + "alternatives": [], + "canonical": "Father Bozado", + "localized": { + "en": "Father Bozado", + "ja_jp": "オルオ父" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/88007/original.jpg?1485085456", + "width": null + } + }, + "slug": "father-bozado" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52588", + "names": { + "alternatives": [], + "canonical": "Oluo Bozado", + "localized": { + "en": "Oluo Bozado", + "ja_jp": "オルオ・ボザド" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52588/original.jpg?1483096805", + "width": null + } + }, + "slug": "oluo-bozado" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39811", + "names": { + "alternatives": [], + "canonical": "Reiner Braun", + "localized": { + "en": "Reiner Braun", + "ja_jp": "ライナー・ブラウン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39811/original.jpg?1483096805", + "width": null + } + }, + "slug": "reiner-braun" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39812", + "names": { + "alternatives": [], + "canonical": "Riko Brzenska", + "localized": { + "en": "Riko Brzenska", + "ja_jp": "リコ・ブレツェンスカ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39812/original.jpg?1483096805", + "width": null + } + }, + "slug": "riko-brzenska" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39813", + "names": { + "alternatives": [], + "canonical": "Mina Carolina", + "localized": { + "en": "Mina Carolina", + "ja_jp": "ミーナ・カロライナ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39813/original.jpg?1483096805", + "width": null + } + }, + "slug": "mina-carolina" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39804", + "names": { + "alternatives": [], + "canonical": "Dazz", + "localized": { + "en": "Dazz", + "ja_jp": "ダズ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39804/original.jpg?1483096805", + "width": null + } + }, + "slug": "dazz" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "78275", + "names": { + "alternatives": [], + "canonical": "Dieter", + "localized": { + "en": "Dieter", + "ja_jp": "ディター" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/78275/original.jpg?1485081646", + "width": null + } + }, + "slug": "dieter" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39814", + "names": { + "alternatives": [], + "canonical": "Ian Dietrich", + "localized": { + "en": "Ian Dietrich", + "ja_jp": "イアン・ディートリッヒ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39814/original.jpg?1483096805", + "width": null + } + }, + "slug": "ian-dietrich" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52589", + "names": { + "alternatives": [], + "canonical": "Nile Dok", + "localized": { + "en": "Nile Dok", + "ja_jp": "ナイル・ドーク" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52589/original.jpg?1483096805", + "width": null + } + }, + "slug": "nile-dok" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52590", + "names": { + "alternatives": [], + "canonical": "Hitch Dreyse", + "localized": { + "en": "Hitch Dreyse", + "ja_jp": "ヒッチ・ドリス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52590/original.jpg?1483096805", + "width": null + } + }, + "slug": "hitch-dreyse" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "80627", + "names": { + "alternatives": [], + "canonical": "Dennis Eibringer", + "localized": { + "en": "Dennis Eibringer", + "ja_jp": "デニス・アイブリンガ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/80627/original.jpg?1485082510", + "width": null + } + }, + "slug": "dennis-eibringer" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "83223", + "names": { + "alternatives": [], + "canonical": "Eld's lover", + "localized": { + "en": "Eld's lover", + "ja_jp": "エルド恋人" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/83223/original.jpg?1485083597", + "width": null + } + }, + "slug": "eld-s-lover" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "72418", + "names": { + "alternatives": [], + "canonical": "Boris Feulner", + "localized": { + "en": "Boris Feulner", + "ja_jp": "ボリス・フォイルナー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/72418/original.jpg?1485079569", + "width": null + } + }, + "slug": "boris-feulner" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39802", + "names": { + "alternatives": [], + "canonical": "Franz", + "localized": { + "en": "Franz", + "ja_jp": "フランツ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39802/original.jpg?1483096805", + "width": null + } + }, + "slug": "franz-06354328-6618-42d4-be45-3fcff7b57e8a" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52591", + "names": { + "alternatives": [], + "canonical": "Marlo Freudenberg", + "localized": { + "en": "Marlo Freudenberg", + "ja_jp": "マルロ・フロイデンベルク" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52591/original.jpg?1483096805", + "width": null + } + }, + "slug": "marlo-freudenberg" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39807", + "names": { + "alternatives": [], + "canonical": "Gustav", + "localized": { + "en": "Gustav", + "ja_jp": "グスタフ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39807/original.jpg?1483096805", + "width": null + } + }, + "slug": "gustav-bb1524a1-58c3-484d-9da1-8fa5880a1e69" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39803", + "names": { + "alternatives": [], + "canonical": "Hannah", + "localized": { + "en": "Hannah", + "ja_jp": "ハンナ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39803/original.jpg?1483096805", + "width": null + } + }, + "slug": "hannah" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39794", + "names": { + "alternatives": [], + "canonical": "Hannes", + "localized": { + "en": "Hannes", + "ja_jp": "ハンネス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39794/original.jpg?1483096805", + "width": null + } + }, + "slug": "hannes" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39816", + "names": { + "alternatives": [], + "canonical": "Bertolt Hoover", + "localized": { + "en": "Bertolt Hoover", + "ja_jp": "ベルトルト・フーバー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39816/original.jpg?1483096805", + "width": null + } + }, + "slug": "bertolt-hoover" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39797", + "names": { + "alternatives": [], + "canonical": "Hugo", + "localized": { + "en": "Hugo", + "ja_jp": "フーゴ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39797/original.jpg?1483096805", + "width": null + } + }, + "slug": "hugo" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39817", + "names": { + "alternatives": [], + "canonical": "Mitabi Jarnach", + "localized": { + "en": "Mitabi Jarnach", + "ja_jp": "ミタビ・ヤルナッハ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39817/original.jpg?1483096805", + "width": null + } + }, + "slug": "mitabi-jarnach" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39815", + "names": { + "alternatives": [], + "canonical": "Eld Jinn", + "localized": { + "en": "Eld Jinn", + "ja_jp": "エルド・ジン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39815/original.jpg?1483096805", + "width": null + } + }, + "slug": "erd-gin" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "67384", + "names": { + "alternatives": [], + "canonical": "Mother Jinn", + "localized": { + "en": "Mother Jinn", + "ja_jp": "エルド母" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/67384/original.jpg?1485077794", + "width": null + } + }, + "slug": "mother-jinn" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "72984", + "names": { + "alternatives": [], + "canonical": "Jurgen", + "localized": { + "en": "Jurgen", + "ja_jp": "ユルゲン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/72984/original.jpg?1485079775", + "width": null + } + }, + "slug": "jurgen" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38510", + "names": { + "alternatives": [], + "canonical": "Jean Kirstein", + "localized": { + "en": "Jean Kirstein", + "ja_jp": "ジャン・キルシュタイン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38510/original.jpg?1483096805", + "width": null + } + }, + "slug": "jean-kirschtein" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38512", + "names": { + "alternatives": [], + "canonical": "Krista Lenz", + "localized": { + "en": "Krista Lenz", + "ja_jp": "クリスタ・レンズ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38512/original.jpg?1483096805", + "width": null + } + }, + "slug": "christa-renz" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "90705", + "names": { + "alternatives": [], + "canonical": "Father Leonhart", + "localized": { + "en": "Father Leonhart", + "ja_jp": "アニの父" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/90705/original.jpg?1485086503", + "width": null + } + }, + "slug": "father-leonhart" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38511", + "names": { + "alternatives": [], + "canonical": "Annie Leonhart", + "localized": { + "en": "Annie Leonhart", + "ja_jp": "アニ・レオンハート" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38511/original.jpg?1483096805", + "width": null + } + }, + "slug": "annie-leonhardt" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39556", + "names": { + "alternatives": [], + "canonical": "Levi", + "localized": { + "en": "Levi", + "ja_jp": "リヴァイ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39556/original.jpg?1483096805", + "width": null + } + }, + "slug": "levi" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39805", + "names": { + "alternatives": [], + "canonical": "Instructor", + "localized": { + "en": "Instructor", + "ja_jp": "眼鏡の教官" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39805/original.jpg?1483096805", + "width": null + } + }, + "slug": "megane-no-kyoukan" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39798", + "names": { + "alternatives": [ + "Brown" + ], + "canonical": "Moses", + "localized": { + "en": "Moses", + "ja_jp": "モーゼス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39798/original.jpg?1483096805", + "width": null + } + }, + "slug": "moses" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39799", + "names": { + "alternatives": [], + "canonical": "Moses's Mother", + "localized": { + "en": "Moses's Mother", + "ja_jp": "モーゼスの母" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39799/original.jpg?1483096805", + "width": null + } + }, + "slug": "moses-s-mother" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52583", + "names": { + "alternatives": [], + "canonical": "Nanaba", + "localized": { + "en": "Nanaba", + "ja_jp": "ナナバ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52583/original.jpg?1483096805", + "width": null + } + }, + "slug": "nanaba" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52593", + "names": { + "alternatives": [], + "canonical": "Dita Ness", + "localized": { + "en": "Dita Ness", + "ja_jp": "ディータ・ネス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52593/original.jpg?1483096805", + "width": null + } + }, + "slug": "dita-ness" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39795", + "names": { + "alternatives": [ + "Minister Nick" + ], + "canonical": "Nick", + "localized": { + "en": "Nick", + "ja_jp": "ニック" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39795/original.jpg?1483096805", + "width": null + } + }, + "slug": "nick-77245a04-f2c1-40ce-b458-222d708e2fe1" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "92572", + "names": { + "alternatives": [], + "canonical": "Pere", + "localized": { + "en": "Pere", + "ja_jp": "ペール" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/92572/original.jpg?1485087363", + "width": null + } + }, + "slug": "pere" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39818", + "names": { + "alternatives": [], + "canonical": "Dot Pixis", + "localized": { + "en": "Dot Pixis", + "ja_jp": "ドット・ピクシス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39818/original.jpg?1483096805", + "width": null + } + }, + "slug": "dot-pixis" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39819", + "names": { + "alternatives": [], + "canonical": "Petra Ral", + "localized": { + "en": "Petra Ral", + "ja_jp": "ペトラ・ラル" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39819/original.jpg?1483096805", + "width": null + } + }, + "slug": "petra-ral" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "91050", + "names": { + "alternatives": [], + "canonical": "Father Ral", + "localized": { + "en": "Father Ral", + "ja_jp": "ペトラ父" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/91050/original.jpg?1485086660", + "width": null + } + }, + "slug": "father-ral" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52595", + "names": { + "alternatives": [], + "canonical": "Dimo Reeves", + "localized": { + "en": "Dimo Reeves", + "ja_jp": "ディモ・リーブス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52595/original.jpg?1483096805", + "width": null + } + }, + "slug": "dimo-reeves" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39820", + "names": { + "alternatives": [], + "canonical": "Anka Rheinberger", + "localized": { + "en": "Anka Rheinberger", + "ja_jp": "アンカ・ラインベルガー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39820/original.jpg?1483096805", + "width": null + } + }, + "slug": "anka-rheinberger" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39801", + "names": { + "alternatives": [], + "canonical": "Samuel", + "localized": { + "en": "Samuel", + "ja_jp": "サムエル" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39801/original.jpg?1483096805", + "width": null + } + }, + "slug": "samuel" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39821", + "names": { + "alternatives": [], + "canonical": "Gunther Schultz", + "localized": { + "en": "Gunther Schultz", + "ja_jp": "グンタ・シュルツ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39821/original.jpg?1483096805", + "width": null + } + }, + "slug": "gunter-schulz" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "72049", + "names": { + "alternatives": [], + "canonical": "Mother Schultz", + "localized": { + "en": "Mother Schultz", + "ja_jp": "グンタ母" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/72049/original.jpg?1485079414", + "width": null + } + }, + "slug": "mother-schultz" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "88409", + "names": { + "alternatives": [], + "canonical": "Grandfather Schultz", + "localized": { + "en": "Grandfather Schultz", + "ja_jp": "グンタ祖父" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/88409/original.jpg?1485085615", + "width": null + } + }, + "slug": "grandfather-schultz" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39822", + "names": { + "alternatives": [], + "canonical": "Keith Shardis", + "localized": { + "en": "Keith Shardis", + "ja_jp": "キース・シャーディス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39822/original.jpg?1483096805", + "width": null + } + }, + "slug": "keith-shardis" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52596", + "names": { + "alternatives": [], + "canonical": "Luke Siss", + "localized": { + "en": "Luke Siss", + "ja_jp": "ルーク・シス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52596/original.jpg?1483096805", + "width": null + } + }, + "slug": "luke-siss" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39823", + "names": { + "alternatives": [], + "canonical": "Erwin Smith", + "localized": { + "en": "Erwin Smith", + "ja_jp": "エルヴィン・スミス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39823/original.jpg?1483096805", + "width": null + } + }, + "slug": "erwin-smith" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38513", + "names": { + "alternatives": [], + "canonical": "Connie Springer", + "localized": { + "en": "Connie Springer", + "ja_jp": "コニー・スプリンガー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38513/original.jpg?1483096805", + "width": null + } + }, + "slug": "conny-springer" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39824", + "names": { + "alternatives": [], + "canonical": "Nack Tierce", + "localized": { + "en": "Nack Tierce", + "ja_jp": "ナック・ティアス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39824/original.jpg?1483096805", + "width": null + } + }, + "slug": "nack-tierce" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39808", + "names": { + "alternatives": [], + "canonical": "Tom", + "localized": { + "en": "Tom", + "ja_jp": "トム" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39808/original.jpg?1483096805", + "width": null + } + }, + "slug": "tom-7c968172-923e-4d22-823a-251d8856bfb5" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "77248", + "names": { + "alternatives": [], + "canonical": "Darius Baer Varbrun", + "localized": { + "en": "Darius Baer Varbrun", + "ja_jp": "ダリウス・ベーア=ヴァルブルン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/77248/original.jpg?1485081285", + "width": null + } + }, + "slug": "darius-baer-varbrun" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39825", + "names": { + "alternatives": [], + "canonical": "Kitts Verman", + "localized": { + "en": "Kitts Verman", + "ja_jp": "キッツ・ヴェールマン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39825/original.jpg?1483096805", + "width": null + } + }, + "slug": "kitts-verman" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39826", + "names": { + "alternatives": [], + "canonical": "Thomas Wagner", + "localized": { + "en": "Thomas Wagner", + "ja_jp": "トーマス・ワグナー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39826/original.jpg?1483096805", + "width": null + } + }, + "slug": "thomas-wagner" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39828", + "names": { + "alternatives": [], + "canonical": "Grisha Yeager", + "localized": { + "en": "Grisha Yeager", + "ja_jp": "グリシャ・イェーガー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39828/original.jpg?1483096805", + "width": null + } + }, + "slug": "grisha-yeager" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39827", + "names": { + "alternatives": [], + "canonical": "Carla Yeager", + "localized": { + "en": "Carla Yeager", + "ja_jp": "カルラ・イェーガー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39827/original.jpg?1483096805", + "width": null + } + }, + "slug": "carla-yeager" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39796", + "names": { + "alternatives": [], + "canonical": "Ymir", + "localized": { + "en": "Ymir", + "ja_jp": "ユミル" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39796/original.jpg?1483096805", + "width": null + } + }, + "slug": "ymir-24b34432-0237-4b22-a800-2e1ac512db5c" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39829", + "names": { + "alternatives": [], + "canonical": "Mike Zacharias", + "localized": { + "en": "Mike Zacharias", + "ja_jp": "ミケ・ザカリアス" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39829/original.jpg?1483096805", + "width": null + } + }, + "slug": "mike-zacharias" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52597", + "names": { + "alternatives": [], + "canonical": "Darius Zackly", + "localized": { + "en": "Darius Zackly", + "ja_jp": "ダリス・ザックレー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52597/original.jpg?1483096805", + "width": null + } + }, + "slug": "darius-zackly" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39830", + "names": { + "alternatives": [], + "canonical": "Millius Zermusky", + "localized": { + "en": "Millius Zermusky", + "ja_jp": "ミリウス・ゼルムスキー" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39830/original.jpg?1483096805", + "width": null + } + }, + "slug": "millius-zermusky" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "39831", + "names": { + "alternatives": [], + "canonical": "Hange Zoë", + "localized": { + "en": "Hange Zoë", + "ja_jp": "ハンジ・ゾエ" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/39831/original.jpg?1483096805", + "width": null + } + }, + "slug": "hange-zoe" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "38505", + "names": { + "alternatives": [], + "canonical": "Mikasa Ackerman", + "localized": { + "en": "Mikasa Ackerman", + "ja_jp": "ミカサ・アッカーマン" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/38505/original.jpg?1483096805", + "width": null + } + }, + "slug": "mikasa-ackerman" + }, + "role": "MAIN" + }, + { + "character": { + "id": "95639", + "names": { + "alternatives": [], + "canonical": "Abel", + "localized": { + "en": "Abel", + "ja_jp": "ゴーグル" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/95639/original.jpg?1533149500", + "width": null + } + }, + "slug": "goggles" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52585", + "names": { + "alternatives": [], + "canonical": "Keiji", + "localized": { + "en": "Keiji", + "ja_jp": null + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52585/original.jpg?1483096805", + "width": null + } + }, + "slug": "keiji" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "52591", + "names": { + "alternatives": [], + "canonical": "Marlo Freudenberg", + "localized": { + "en": "Marlo Freudenberg", + "ja_jp": "マルロ・フロイデンベルク" + } + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/52591/original.jpg?1483096805", + "width": null + } + }, + "slug": "marlo-freudenberg" + }, + "role": "BACKGROUND" + } + ], + "pageInfo": { + "endCursor": "NzU", + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "MQ" + } + }, + "description": { + "en": "Centuries ago, mankind was slaughtered to near extinction by monstrous humanoid creatures called titans, forcing humans to hide in fear behind enormous concentric walls. What makes these giants truly terrifying is that their taste for human flesh is not born out of hunger but what appears to be out of pleasure. To ensure their survival, the remnants of humanity began living within defensive barriers, resulting in one hundred years without a single titan encounter. However, that fragile calm is soon shattered when a colossal titan manages to breach the supposedly impregnable outer wall, reigniting the fight for survival against the man-eating abominations.\n\nAfter witnessing a horrific personal loss at the hands of the invading creatures, Eren Yeager dedicates his life to their eradication by enlisting into the Survey Corps, an elite military unit that combats the merciless humanoids outside the protection of the walls. Based on Hajime Isayama's award-winning manga, Shingeki no Kyojin follows Eren, along with his adopted sister Mikasa Ackerman and his childhood friend Armin Arlert, as they join the brutal war against the titans and race to discover a way of defeating them before the last walls are breached.\n\n(Source: MAL Rewrite)" + }, + "startDate": "2013-04-07", + "endDate": "2013-09-29", + "episodeCount": 25, + "episodeLength": 1440, + "totalLength": 36000, + "season": "SPRING", + "sfw": true, + "slug": "attack-on-titan", + "mappings": { + "nodes": [ + { + "externalId": "9541", + "externalSite": "ANIDB" + }, + { + "externalId": "16498", + "externalSite": "ANILIST_ANIME" + }, + { + "externalId": "HgLInLJMbE", + "externalSite": "AOZORA" + }, + { + "externalId": "50011596", + "externalSite": "HULU" + }, + { + "externalId": "16498", + "externalSite": "MYANIMELIST_ANIME" + }, + { + "externalId": "267440/1", + "externalSite": "THETVDB" + }, + { + "externalId": "514060", + "externalSite": "THETVDB_SEASON" + }, + { + "externalId": "267440", + "externalSite": "THETVDB_SERIES" + }, + { + "externalId": "1420", + "externalSite": "TRAKT" + } + ] + }, + "staff": { + "nodes": [ + { + "person": { + "id": "22220", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/22220/original.jpg?1533274286", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Jouji Wada", + "ja_jp": "和田 丈嗣" + } + }, + "slug": "jouji-wada" + }, + "role": "Producer" + }, + { + "person": { + "id": "3976", + "birthday": "1976-11-05", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/3976/original.jpg?1416264991", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Tetsurou Araki", + "ja_jp": "荒木 哲郎" + } + }, + "slug": "tetsurou-araki" + }, + "role": "Director" + }, + { + "person": { + "id": "431", + "birthday": "1962-05-20", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/431/original.jpg?1416260864", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Masafumi Mima", + "ja_jp": "三間 雅文" + } + }, + "slug": "masafumi-mima" + }, + "role": "Sound Director" + }, + { + "person": { + "id": "21476", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Shinpei Ezaki", + "ja_jp": "江崎 慎平" + } + }, + "slug": "shinpei-ezaki" + }, + "role": "Episode Director, Storyboard" + }, + { + "person": { + "id": "21437", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Yoshiyuki Fujiwara", + "ja_jp": "藤原 佳幸" + } + }, + "slug": "yoshiyuki-fujiwara" + }, + "role": "Episode Director, Key Animation" + }, + { + "person": { + "id": "364", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/364/original.jpg?1416260777", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Masashi Ishihama", + "ja_jp": "石浜 真史" + } + }, + "slug": "masashi-ishihama" + }, + "role": "Episode Director, Storyboard, Animation Director, Key Animation, Background Art" + }, + { + "person": { + "id": "3982", + "birthday": "1981-12-02", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/3982/original.jpg?1533272323", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Yuzuru Tachikawa", + "ja_jp": "立川 譲" + } + }, + "slug": "yuzuru-tachikawa" + }, + "role": "Episode Director, Storyboard" + }, + { + "person": { + "id": "9220", + "birthday": "1971-04-22", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/9220/original.jpg?1416270341", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hiroyuki Tanaka", + "ja_jp": "田中 洋之" + } + }, + "slug": "hiroyuki-tanaka" + }, + "role": "Episode Director, Assistant Director" + }, + { + "person": { + "id": "21396", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/21396/original.jpg?1533273728", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Daisuke Tokudo", + "ja_jp": "徳土 大介" + } + }, + "slug": "daisuke-tokudo" + }, + "role": "Episode Director, Storyboard, Key Animation" + }, + { + "person": { + "id": "1460", + "birthday": "1977-04-13", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/1460/original.jpg?1416262235", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Sayo Yamamoto", + "ja_jp": "山本 沙代" + } + }, + "slug": "sayo-yamamoto" + }, + "role": "Episode Director, Storyboard" + }, + { + "person": { + "id": "1216", + "birthday": "1974-10-24", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/1216/original.jpg?1416261888", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "John Burgmeier" + } + }, + "slug": "john-burgmeier" + }, + "role": "Script" + }, + { + "person": { + "id": "1918", + "birthday": "1965-04-07", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/1918/original.jpg?1416262710", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Yasuko Kobayashi", + "ja_jp": "小林 靖子" + } + }, + "slug": "yasuko-kobayashi" + }, + "role": "Script, Series Composition" + }, + { + "person": { + "id": "7687", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/7687/original.jpg?1416268918", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Tyson Rinehart" + } + }, + "slug": "tyson-rinehart" + }, + "role": "Script" + }, + { + "person": { + "id": "19526", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hiroshi Seko", + "ja_jp": "瀬古 浩司" + } + }, + "slug": "hiroshi-seko" + }, + "role": "Script" + }, + { + "person": { + "id": "1461", + "birthday": "1968-07-06", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/1461/original.jpg?1416262236", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Noboru Takagi", + "ja_jp": "高木 登" + } + }, + "slug": "noboru-takagi" + }, + "role": "Script" + }, + { + "person": { + "id": "440", + "birthday": "1976-05-25", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/440/original.jpg?1416260875", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "John Michael Tatum" + } + }, + "slug": "john-michael-tatum" + }, + "role": "Script" + }, + { + "person": { + "id": "21721", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/21721/original.jpg?1533274009", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Tomohiro Hirata", + "ja_jp": "平田 智浩" + } + }, + "slug": "tomohiro-hirata" + }, + "role": "Storyboard, Key Animation" + }, + { + "person": { + "id": "24043", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Minoru Oohara", + "ja_jp": "大原 実" + } + }, + "slug": "minoru-oohara" + }, + "role": "Storyboard" + }, + { + "person": { + "id": "21610", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Keiichi Sasajima", + "ja_jp": "笹嶋 啓一" + } + }, + "slug": "keiichi-sasajima" + }, + "role": "Storyboard" + }, + { + "person": { + "id": "18196", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/18196/original.jpg?1533273064", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Cinema Staff" + } + }, + "slug": "cinema-staff" + }, + "role": "Theme Song Performance" + }, + { + "person": { + "id": "6847", + "birthday": "1985-07-16", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/6847/original.jpg?1416268029", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Yoko Hikasa", + "ja_jp": "日笠 陽子" + } + }, + "slug": "yoko-hikasa" + }, + "role": "Theme Song Performance" + }, + { + "person": { + "id": "8718", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/8718/original.jpg?1416270072", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Linked Horizon" + } + }, + "slug": "linked-horizon" + }, + "role": "Theme Song Performance" + }, + { + "person": { + "id": "17299", + "birthday": "1978-06-19", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/17299/original.jpg?1533270886", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Revo", + "ja_jp": "Revo " + } + }, + "slug": "revo" + }, + "role": "Theme Song Lyrics, Theme Song Composition, Theme Song Arrangement" + }, + { + "person": { + "id": "17751", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/17751/original.jpg?1533270888", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "mpi", + "ja_jp": "mpi " + } + }, + "slug": "mpi" + }, + "role": "Theme Song Lyrics, Inserted Song Performance" + }, + { + "person": { + "id": "9491", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Misao Abe", + "ja_jp": "阿部 美佐緒" + } + }, + "slug": "misao-abe" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "9490", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/9490/original.jpg?1533272773", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kouichi Arai", + "ja_jp": "新井 浩一" + } + }, + "slug": "kouichi-arai" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "3006", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/3006/original.jpg?1533270886", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kyouji Asano", + "ja_jp": "浅野 恭司" + } + }, + "slug": "kyouji-asano" + }, + "role": "Character Design" + }, + { + "person": { + "id": "9221", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/9221/original.jpg?1416270342", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Aimee Blackschleger" + } + }, + "slug": "aimee-blackschleger" + }, + "role": "Inserted Song Performance" + }, + { + "person": { + "id": "22549", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Takaaki Chiba", + "ja_jp": "千葉 崇明" + } + }, + "slug": "takaaki-chiba" + }, + "role": "Key Animation, Chief Animation Director, Animation Director" + }, + { + "person": { + "id": "9111", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/9111/original.jpg?1416270225", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Cyua" + } + }, + "slug": "cyua" + }, + "role": "Inserted Song Performance" + }, + { + "person": { + "id": "435", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/435/original.jpg?1416260869", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Gen Fukunaga", + "ja_jp": "フクナガ ゲン" + } + }, + "slug": "gen-fukunaga" + }, + "role": "Executive Producer" + }, + { + "person": { + "id": "22444", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Masami Gotou", + "ja_jp": "後藤 雅巳" + } + }, + "slug": "masami-gotou" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "23609", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Takashi Habe", + "ja_jp": "波部 崇" + } + }, + "slug": "takashi-habe" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "9499", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Akira Hamaguchi", + "ja_jp": "浜口 明" + } + }, + "slug": "akira-hamaguchi" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "23292", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Satoshi Hashimoto", + "ja_jp": "橋本 賢" + } + }, + "slug": "satoshi-hashimoto-d5208a27-4ad0-4f06-b53d-eb95fa7105db" + }, + "role": "Color Design" + }, + { + "person": { + "id": "22109", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Aya Hida", + "ja_jp": "肥田 文" + } + }, + "slug": "aya-hida" + }, + "role": "Editing" + }, + { + "person": { + "id": "17186", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Izumi Hirose", + "ja_jp": "広瀬 いづみ" + } + }, + "slug": "izumi-hirose" + }, + "role": "Color Setting" + }, + { + "person": { + "id": "8034", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/8034/original.jpg?1416269308", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Atsushi Ikariya", + "ja_jp": "碇谷 敦" + } + }, + "slug": "atsushi-ikariya" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "23895", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/23895/original.jpg?1486414118", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Arifumi Imai", + "ja_jp": "今井 有文" + } + }, + "slug": "arifumi-imai" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "8719", + "birthday": "1986-08-29", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/8719/original.jpg?1416270073", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hajime Isayama", + "ja_jp": "諫山 創" + } + }, + "slug": "hajime-isayama" + }, + "role": "Original Creator" + }, + { + "person": { + "id": "2097", + "birthday": "1964-04-28", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/2097/original.jpg?1533271648", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hiromi Katou", + "ja_jp": "加藤 裕美" + } + }, + "slug": "hiromi-katou" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "8161", + "birthday": "1978-05-31", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/8161/original.jpg?1416269452", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Mika Kobayashi", + "ja_jp": "小林 未郁" + } + }, + "slug": "mika-kobayashi" + }, + "role": "Inserted Song Performance" + }, + { + "person": { + "id": "24522", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Naoki Kobayashi", + "ja_jp": "小林 直樹" + } + }, + "slug": "naoki-kobayashi" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "21400", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/21400/original.jpg?1533270885", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Masashi Koizuka", + "ja_jp": "肥塚 正史" + } + }, + "slug": "masashi-koizuka" + }, + "role": "Assistant Director" + }, + { + "person": { + "id": "22605", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/22605/original.jpg?1533274386", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Tatsuya Koyanagi", + "ja_jp": "小柳 達也" + } + }, + "slug": "tatsuya-koyanagi" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "5639", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Shizuo Kurahashi", + "ja_jp": "倉橋 静男" + } + }, + "slug": "shizuo-kurahashi" + }, + "role": "Sound Effects" + }, + { + "person": { + "id": "466", + "birthday": "1970-07-14", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/466/original.jpg?1416260915", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Mike McFarland" + } + }, + "slug": "mike-mcfarland" + }, + "role": "ADR Director" + }, + { + "person": { + "id": "22417", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Tatsuya Miki", + "ja_jp": "三木 達也" + } + }, + "slug": "tatsuya-miki" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "9486", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/9486/original.jpg?1533273224", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kazuhiro Miwa", + "ja_jp": "三輪 和宏" + } + }, + "slug": "kazuhiro-miwa" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "22734", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kana Miyai", + "ja_jp": "宮井 加奈" + } + }, + "slug": "kana-miyai" + }, + "role": "Animation Director" + }, + { + "person": { + "id": "23813", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Jun Okabe", + "ja_jp": "岡部 順" + } + }, + "slug": "jun-okabe" + }, + "role": "Background Art" + }, + { + "person": { + "id": "22705", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Satoshi Sakai", + "ja_jp": "酒井 智史" + } + }, + "slug": "satoshi-sakai" + }, + "role": "Animation Director" + }, + { + "person": { + "id": "5377", + "birthday": "1980-09-12", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/5377/original.jpg?1416266441", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hiroyuki Sawano", + "ja_jp": "澤野 弘之" + } + }, + "slug": "hiroyuki-sawano" + }, + "role": "Music" + }, + { + "person": { + "id": "3414", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Shirou Shibata", + "ja_jp": "柴田 志朗" + } + }, + "slug": "shirou-shibata" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "23332", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hideki Takahashi", + "ja_jp": "高橋 英樹" + } + }, + "slug": "hideki-takahashi-4e5a48eb-bac3-40a3-96ce-e19ebb50a6c3" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "254", + "birthday": "1984-06-01", + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Hironori Tanaka", + "ja_jp": "田中 宏紀" + } + }, + "slug": "hironori-tanaka" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "22537", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kazuhiro Yamada", + "ja_jp": "山田 和弘" + } + }, + "slug": "kazuhiro-yamada" + }, + "role": "Director of Photography" + }, + { + "person": { + "id": "23501", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Naoto Yamatani", + "ja_jp": "山谷 尚人" + } + }, + "slug": "naoto-yamatani" + }, + "role": "Sound Effects" + }, + { + "person": { + "id": "24925", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Yumiko Ishii", + "ja_jp": "石井 ゆみこ" + } + }, + "slug": "yumiko-ishii" + }, + "role": "Animation Director, Key Animation" + }, + { + "person": { + "id": "3577", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Toshiyuki Komaru", + "ja_jp": "小丸 敏之" + } + }, + "slug": "toshiyuki-komaru" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "14999", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Toshiyuki Satou", + "ja_jp": "佐藤 利幸" + } + }, + "slug": "toshiyuki-satou" + }, + "role": "Key Animation, Animation Director, In-Between Animation" + }, + { + "person": { + "id": "23566", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Senbon Umishima", + "ja_jp": "海島 千本" + } + }, + "slug": "senbon-umishima" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "123", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/123/original.jpg?1533271550", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kenichi Yoshida", + "ja_jp": "吉田 健一" + } + }, + "slug": "kenichi-yoshida" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "30444", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/30444/original.jpg?1533274624", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Shuuhei Yabuta", + "ja_jp": "薮田 修平" + } + }, + "slug": "shuuhei-yabuta" + }, + "role": "Director" + }, + { + "person": { + "id": "31841", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/31841/original.jpg?1533274884", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Tatsuma Minamikawa", + "ja_jp": "南川 達馬" + } + }, + "slug": "tatsuma-minamikawa" + }, + "role": "Episode Director" + }, + { + "person": { + "id": "34959", + "birthday": "1964-06-03", + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/34959/original.jpg?1533275373", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Seiji Kameda", + "ja_jp": "亀田 誠治" + } + }, + "slug": "seiji-kameda" + }, + "role": "Theme Song Arrangement" + }, + { + "person": { + "id": "34195", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/34195/original.jpg?1533275252", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "You Moriyama", + "ja_jp": "森山 洋" + } + }, + "slug": "you-moriyama" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "33987", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Akira Tabata", + "ja_jp": "田畑 昭" + } + }, + "slug": "akira-tabata" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "34806", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Orie Tanaka", + "ja_jp": "田中 織枝" + } + }, + "slug": "orie-tanaka" + }, + "role": "Key Animation" + }, + { + "person": { + "id": "34384", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Kazuhiko Wanibuchi", + "ja_jp": "鰐淵 和彦" + } + }, + "slug": "kazuhiko-wanibuchi" + }, + "role": "Key Animation" + } + ], + "pageInfo": { + "endCursor": "NzA", + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "MQ" + } + }, + "status": "FINISHED", + "streamingLinks": { + "nodes": [ + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "8", + "siteName": "TubiTV" + }, + "url": "https://tubitv.com/series/2318" + }, + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "3", + "siteName": "Crunchyroll" + }, + "url": "http://www.crunchyroll.com/attack-on-titan" + }, + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "6", + "siteName": "Netflix" + }, + "url": "https://www.netflix.com/title/70299043" + }, + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "2", + "siteName": "Funimation" + }, + "url": "https://www.funimation.com/shows/attack-on-titan/" + }, + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "1", + "siteName": "Hulu" + }, + "url": "https://www.hulu.com/attack-on-titan" + } + ] + }, + "subtype": "TV", + "titles": { + "alternatives": [ + "AoT" + ], + "canonical": "Attack on Titan", + "canonicalLocale": "en", + "localized": { + "en": "Attack on Titan", + "en_jp": "Shingeki no Kyojin", + "en_us": "Attack on Titan", + "ja_jp": "進撃の巨人" + } + }, + "youtubeTrailerVideoId": "LHtdKWJdif4" + } + } } \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/animeListItemAfterTransform.json b/tests/AnimeClient/test_data/Kitsu/animeListItemAfterTransform.json deleted file mode 100644 index fddd2a4a..00000000 --- a/tests/AnimeClient/test_data/Kitsu/animeListItemAfterTransform.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "15839442", - "mal_id": "33206", - "episodes": { - "watched": 0, - "total": "-", - "length": null - }, - "airing": { - "status": "Currently Airing", - "started": "2017-01-12", - "ended": null - }, - "anime": { - "age_rating": null, - "title": "Kobayashi-san Chi no Maid Dragon", - "titles": ["Kobayashi-san Chi no Maid Dragon", "Miss Kobayashi's Dragon Maid", "\u5c0f\u6797\u3055\u3093\u3061\u306e\u30e1\u30a4\u30c9\u30e9\u30b4\u30f3"], - "slug": "kobayashi-san-chi-no-maid-dragon", - "type": "TV", - "image": "https:\/\/media.kitsu.io\/anime\/poster_images\/12243\/small.jpg?1481144116", - "genres": ["Comedy", "Fantasy", "Slice of Life"], - "streaming_links": [] - }, - "watching_status": "current", - "notes": null, - "rewatching": false, - "rewatched": 0, - "user_rating": "-", - "private": false -} \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/animeListItemBeforeTransform.json b/tests/AnimeClient/test_data/Kitsu/animeListItemBeforeTransform.json index 223ce859..5a520570 100644 --- a/tests/AnimeClient/test_data/Kitsu/animeListItemBeforeTransform.json +++ b/tests/AnimeClient/test_data/Kitsu/animeListItemBeforeTransform.json @@ -1,1097 +1,178 @@ { - "id": "15839442", - "type": "libraryEntries", - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442" - }, - "attributes": { - "status": "current", - "progress": 0, - "reconsuming": false, - "reconsumeCount": 0, - "notes": null, - "private": false, - "rating": null, - "ratingTwenty": null, - "updatedAt": "2017-01-13T01:32:31.832Z" - }, - "relationships": { - "user": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/user", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/user" - } - }, - "anime": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/anime", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/anime" - } - }, - "manga": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/manga", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/manga" - } - }, - "drama": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/drama", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/drama" - } - }, - "review": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/review", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/review" - } - }, - "media": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/media", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/media" - }, - "data": { - "type": "anime", - "id": "12243" - } - }, - "unit": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/unit", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/unit" - } - }, - "nextUnit": { - "links": { - "self": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/relationships\/next-unit", - "related": "https:\/\/kitsu.io\/api\/edge\/library-entries\/15839442\/next-unit" - } - } - }, - "included": { - "anime": { - "12243": { - "slug": "kobayashi-san-chi-no-maid-dragon", - "synopsis": "Kobayashi lives alone in an apartment, until one day, Tooru appeared and they ended up living together. Tooru looks down on humans as inferior and foolish, but having been saved by Kobayashi-san, she does everything she can to repay the debt and help her with various things, although not everything goes according to plan.\r\n\r\nA mythical everyday life comedy about a hard working office lady living with a dragon girl.", - "coverImageTopOffset": 0, - "titles": { - "en": "Miss Kobayashi's Dragon Maid", - "en_jp": "Kobayashi-san Chi no Maid Dragon", - "ja_jp": "\u5c0f\u6797\u3055\u3093\u3061\u306e\u30e1\u30a4\u30c9\u30e9\u30b4\u30f3" - }, - "canonicalTitle": "Kobayashi-san Chi no Maid Dragon", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "0", - "1.0": "1", - "1.5": "0", - "2.0": "2", - "2.5": "2", - "3.0": "6", - "3.5": "10", - "4.0": "8", - "4.5": "1", - "5.0": "15", - "nil": "214" - }, - "startDate": "2017-01-12", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12243\/tiny.jpg?1481144116", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12243\/small.jpg?1481144116", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12243\/medium.jpg?1481144116", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12243\/large.jpg?1481144116", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12243\/original.jpg?1481144116" - }, - "coverImage": null, - "episodeCount": null, - "episodeLength": null, - "subtype": "TV", - "youtubeVideoId": "Vx-cdrHiGd0", - "ageRating": null, - "ageRatingGuide": "", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "11": { - "title": "Fantasy", - "slug": "fantasy", - "description": "" - }, - "16": { - "title": "Slice of Life", - "slug": "slice-of-life", - "description": "" - } - }, - "mappings": { - "10780": { - "externalSite": "myanimelist\/anime", - "externalId": "33206", - "relationships": [] - } - } - } - }, - "6687": { - "slug": "smile-precure", - "synopsis": "Once upon a time, there was a kingdom of fairy tales called \"M\u00e4rchenland\", where many fairy tale characters live together in joy. Suddenly, the evil emperor Pierrot made an invasion on M\u00e4rchenland, sealing its Queen in the process. To revive the Queen, the symbol of happiness called Cure Decor, \"the Queen's scattered power of light of happiness\", is required. To collect the Cure Decor, a fairy named Candy searches for the Pretty Cures on Earth. There, Candy meets a girl, who decides to collect the Cure Decor. Now, will the world earn a \"happy ending\"?", - "coverImageTopOffset": 100, - "titles": { - "en": "Glitter Force", - "en_jp": "Smile Precure!", - "ja_jp": "\u30b9\u30de\u30a4\u30eb\u30d7\u30ea\u30ad\u30e5\u30a2\uff01" - }, - "canonicalTitle": "Smile Precure!", - "abbreviatedTitles": null, - "averageRating": 3.6674651842659, - "ratingFrequencies": { - "0.5": "4", - "1.0": "8", - "1.5": "3", - "2.0": "17", - "2.5": "30", - "3.0": "54", - "3.5": "69", - "4.0": "96", - "4.5": "42", - "5.0": "57", - "nil": "594" - }, - "startDate": "2012-02-05", - "endDate": "2013-01-27", - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/6687\/tiny.jpg?1408459122", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/6687\/small.jpg?1408459122", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/6687\/medium.jpg?1408459122", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/6687\/large.jpg?1408459122", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/6687\/original.jpg?1408459122" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/6687\/small.jpg?1452609041", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/6687\/large.jpg?1452609041", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/6687\/original.png?1452609041" - }, - "episodeCount": 48, - "episodeLength": 24, - "subtype": "TV", - "youtubeVideoId": "", - "ageRating": "PG", - "ageRatingGuide": "Children", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "8": { - "title": "Magic", - "slug": "magic", - "description": null - }, - "40": { - "title": "Kids", - "slug": "kids", - "description": null - }, - "47": { - "title": "Mahou Shoujo", - "slug": "mahou-shoujo", - "description": "Magical Girls" - }, - "11": { - "title": "Fantasy", - "slug": "fantasy", - "description": "" - } - }, - "mappings": { - "778": { - "externalSite": "myanimelist\/anime", - "externalId": "12191", - "relationships": [] - }, - "12547": { - "externalSite": "thetvdb\/series", - "externalId": "255904", - "relationships": [] - } - } - } - }, - "12596": { - "slug": "idol-jihen", - "synopsis": "", - "coverImageTopOffset": 0, - "titles": { - "en": null, - "en_jp": "Idol Jihen", - "ja_jp": null - }, - "canonicalTitle": "Idol Jihen", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "1", - "2.0": "2", - "2.5": "2", - "3.0": "3", - "3.5": "2", - "5.0": "1", - "nil": "19" - }, - "startDate": "2017-01-01", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12596\/tiny.jpg?1475248797", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12596\/small.jpg?1475248797", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12596\/medium.jpg?1475248797", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12596\/large.jpg?1475248797", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12596\/original.jpg?1475248797" - }, - "coverImage": null, - "episodeCount": null, - "episodeLength": 0, - "subtype": "TV", - "youtubeVideoId": null, - "ageRating": null, - "ageRatingGuide": null, - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "35": { - "title": "Music", - "slug": "music", - "description": null - } - }, - "mappings": { - "6246": { - "externalSite": "myanimelist\/anime", - "externalId": "34028", - "relationships": [] - } - } - } - }, - "12529": { - "slug": "demi-chan-wa-kataritai", - "synopsis": "Monsters of legend walk among us, going by the name \u201cdemi-humans.\u201d Ever since he's discovered the \u201cdemis,\u201d one young man has become obsessed with them. So when he gets a job as a teacher at a high school for demi-girls, it's a dream come true! But these demis, who include a rambunctious vampire, a bashful headless girl, and a succubus, have all the problems normal teenagers have, on top of their supernatural conditions. How to handle a classroom full of them?!\n\n(Source: Kodansha Comics)", - "coverImageTopOffset": 200, - "titles": { - "en": "", - "en_jp": "Demi-chan wa Kataritai", - "ja_jp": "" - }, - "canonicalTitle": "Demi-chan wa Kataritai", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "1.5": "1", - "3.0": "8", - "3.5": "15", - "4.0": "28", - "4.5": "9", - "5.0": "7", - "nil": "201" - }, - "startDate": "2017-01-08", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12529\/tiny.jpg?1480530358", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12529\/small.jpg?1480530358", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12529\/medium.jpg?1480530358", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12529\/large.jpg?1480530358", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12529\/original.png?1480530358" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/12529\/small.jpg?1480537767", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/12529\/large.jpg?1480537767", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/12529\/original.png?1480537767" - }, - "episodeCount": null, - "episodeLength": null, - "subtype": "TV", - "youtubeVideoId": "", - "ageRating": null, - "ageRatingGuide": "", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "9": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - }, - "24": { - "title": "School", - "slug": "school", - "description": null - } - }, - "mappings": { - "8667": { - "externalSite": "myanimelist\/anime", - "externalId": "33988", - "relationships": [] - } - } - } - }, - "11937": { - "slug": "kono-subarashii-sekai-ni-shukufuku-wo-2", - "synopsis": "Second season of Kono Subarashii Sekai ni Shukufuku wo!", - "coverImageTopOffset": 240, - "titles": { - "en": "KonoSuba: God's Blessing on This Wonderful World! Second Season", - "en_jp": "Kono Subarashii Sekai ni Shukufuku wo! 2", - "ja_jp": "\u3053\u306e\u7d20\u6674\u3089\u3057\u3044\u4e16\u754c\u306b\u795d\u798f\u3092! 2" - }, - "canonicalTitle": "Kono Subarashii Sekai ni Shukufuku wo! 2", - "abbreviatedTitles": null, - "averageRating": 4.2956263163849, - "ratingFrequencies": { - "0.5": "0", - "1.0": "1", - "1.5": "0", - "2.0": "1", - "2.5": "6", - "3.0": "4", - "3.5": "15", - "4.0": "14", - "4.5": "25", - "5.0": "85", - "nil": "1795" - }, - "startDate": "2017-01-11", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11937\/tiny.jpg?1480974549", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11937\/small.jpg?1480974549", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11937\/medium.jpg?1480974549", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11937\/large.jpg?1480974549", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11937\/original.jpg?1480974549" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/11937\/small.jpg?1480444804", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/11937\/large.jpg?1480444804", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/11937\/original.png?1480444804" - }, - "episodeCount": null, - "episodeLength": null, - "subtype": "TV", - "youtubeVideoId": "OAnW7RA3tIY", - "ageRating": "PG", - "ageRatingGuide": "Teens 13 or older", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "2": { - "title": "Adventure", - "slug": "adventure", - "description": null - }, - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "8": { - "title": "Magic", - "slug": "magic", - "description": null - }, - "9": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - }, - "11": { - "title": "Fantasy", - "slug": "fantasy", - "description": "" - } - }, - "mappings": { - "2826": { - "externalSite": "myanimelist\/anime", - "externalId": "32937", - "relationships": [] - } - } - } - }, - "12687": { - "slug": "nyanko-days", - "synopsis": "It's an everyday life of a shy girl called Tomoko Konagai and three \"cats\" Maa, Roo, Shii. These cats are girls with cats' ears and can speak human language.\n\n(Source: MAL News)", - "coverImageTopOffset": 0, - "titles": { - "en": null, - "en_jp": "Nyanko Days", - "ja_jp": "\u306b\u3083\u3093\u3053\u30c7\u30a4\u30ba" - }, - "canonicalTitle": "Nyanko Days", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "1", - "1.0": "1", - "1.5": "1", - "2.0": "1", - "2.5": "1", - "3.0": "6", - "3.5": "1", - "4.0": "3", - "4.5": "1", - "5.0": "2", - "nil": "39" - }, - "startDate": "2017-01-01", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12687\/tiny.jpg?1477621209", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12687\/small.jpg?1477621209", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12687\/medium.jpg?1477621209", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12687\/large.jpg?1477621209", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12687\/original.jpg?1477621209" - }, - "coverImage": null, - "episodeCount": null, - "episodeLength": null, - "subtype": "TV", - "youtubeVideoId": "", - "ageRating": null, - "ageRatingGuide": null, - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "16": { - "title": "Slice of Life", - "slug": "slice-of-life", - "description": "" - } - }, - "mappings": { - "10686": { - "externalSite": "myanimelist\/anime", - "externalId": "34148", - "relationships": [] - } - } - } - }, - "12267": { - "slug": "masamune-kun-no-revenge", - "synopsis": "As a child, Masamune Makabe once suffered greatly at the hands of a wealthy and beautiful girl named Aki Adagaki, who nicknamed him \"Piggy\" due to his chubby appearance. Seeking revenge against his tormentor, Masamune works hard to improve himself and returns as an incredibly handsome, albeit narcissistic, high school student. When he encounters Aki once again, he is prepared to exact vengeance.\r\n\r\nWith the aid of the rich girl's maid, Yoshino Koiwai, Masamune slowly begins to build his relationship with Aki, intending to break her heart when the time is right. However, as his friendship with Aki begins to grow, Masamune starts to question the objectives of his devious plans, and if bringing them to fruition is what his heart truly desires.\r\n\r\n(Source: MAL Rewrite)", - "coverImageTopOffset": 100, - "titles": { - "en": "Masamune-kun's Revenge", - "en_jp": "Masamune-kun no Revenge", - "ja_jp": "\u653f\u5b97\u304f\u3093\u306e\u30ea\u30d9\u30f3\u30b8" - }, - "canonicalTitle": "Masamune-kun no Revenge", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "0", - "1.5": "1", - "2.0": "5", - "2.5": "5", - "3.0": "14", - "3.5": "25", - "4.0": "33", - "4.5": "11", - "5.0": "22", - "nil": "569" - }, - "startDate": "2017-01-05", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12267\/tiny.jpg?1474666437", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12267\/small.jpg?1474666437", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12267\/medium.jpg?1474666437", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12267\/large.jpg?1474666437", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12267\/original.png?1474666437" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/12267\/small.jpg?1466985168", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/12267\/large.jpg?1466985168", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/12267\/original.jpg?1466985168" - }, - "episodeCount": null, - "episodeLength": null, - "subtype": "TV", - "youtubeVideoId": "XmfXcVLA1d8", - "ageRating": null, - "ageRatingGuide": "", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "24": { - "title": "School", - "slug": "school", - "description": null - }, - "34": { - "title": "Harem", - "slug": "harem", - "description": null - }, - "14": { - "title": "Romance", - "slug": "romance", - "description": "" - } - }, - "mappings": { - "7026": { - "externalSite": "myanimelist\/anime", - "externalId": "33487", - "relationships": [] - } - } - } - }, - "12497": { - "slug": "gabriel-dropout", - "synopsis": "Chief Angel has come to Earth! However, she became so used to the life on Earth that she skips school and keeps playing online games, thus into self-destruction. It's a school comedy that Gabriel turns into a lazy angel!\r\n\r\n(Source: MAL News)", - "coverImageTopOffset": 0, - "titles": { - "en": null, - "en_jp": "Gabriel DropOut", - "ja_jp": null - }, - "canonicalTitle": "Gabriel DropOut", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "1.5": "1", - "2.5": "1", - "3.0": "8", - "3.5": "11", - "4.0": "12", - "4.5": "3", - "5.0": "9", - "nil": "98" - }, - "startDate": "2017-01-09", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12497\/tiny.jpg?1477681044", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12497\/small.jpg?1477681044", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12497\/medium.jpg?1477681044", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12497\/large.jpg?1477681044", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12497\/original.jpg?1477681044" - }, - "coverImage": null, - "episodeCount": null, - "episodeLength": null, - "subtype": "TV", - "youtubeVideoId": "4eADGP3b9j0", - "ageRating": null, - "ageRatingGuide": null, - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "9": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - }, - "24": { - "title": "School", - "slug": "school", - "description": null - } - }, - "mappings": { - "9049": { - "externalSite": "myanimelist\/anime", - "externalId": "33731", - "relationships": [] - } - } - } - }, - "12710": { - "slug": "fate-grand-order-first-order", - "synopsis": "The story is set in the year 2015, during the final era over which magic still held sway. The humanity survival and security organization Caldea was established to observe the world that can only be seen by magic and the world that can only be measured by science \u2014 as well as to prevent the final extinction of mankind.\r\n\r\nThanks to the efforts of many researchers, the path of human history has been ensured for 100 years into the future. However, without warning, the realm of the future that was under constant observation by Caldea vanished. The extinction of humanity in 2017 was observed \u2014 no, confirmed.\r\n\r\nThe apparent cause of the extinction was in the Japanese city of Fuyuki in 2004. In that city, there was an \"unobservable realm\" which had never existed until now.\r\n\r\nCaldea issued the Grand Order for a \"Holy Grail Expedition,\" to investigate, uncover, and possibly destroy the singularity that apparently will cause the extinction of humanity.\r\n\r\n(Source: ANN)", - "coverImageTopOffset": 0, - "titles": { - "en": "", - "en_jp": "Fate\/Grand Order -First Order-", - "ja_jp": "" - }, - "canonicalTitle": "Fate\/Grand Order -First Order-", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "3", - "1.0": "9", - "1.5": "14", - "2.0": "13", - "2.5": "17", - "3.0": "53", - "3.5": "73", - "4.0": "57", - "4.5": "14", - "5.0": "20", - "nil": "120" - }, - "startDate": "2016-12-31", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12710\/tiny.jpg?1478137267", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12710\/small.jpg?1478137267", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12710\/medium.jpg?1478137267", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12710\/large.jpg?1478137267", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12710\/original.jpeg?1478137267" - }, - "coverImage": null, - "episodeCount": 1, - "episodeLength": null, - "subtype": "special", - "youtubeVideoId": "gd1gYH8g2Vg", - "ageRating": null, - "ageRatingGuide": "", - "showType": "special", - "nsfw": false, - "relationships": { - "categories": { - "8": { - "title": "Magic", - "slug": "magic", - "description": null - }, - "9": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - }, - "11": { - "title": "Fantasy", - "slug": "fantasy", - "description": "" - }, - "1": { - "title": "Action", - "slug": "action", - "description": "" - } - }, - "mappings": { - "6914": { - "externalSite": "myanimelist\/anime", - "externalId": "34321", - "relationships": [] - } - } - } - }, - "11172": { - "slug": "classicaloid", - "synopsis": "Kanae's got a two oddball houseguests in her beloved grandmother's mansion: Moz and Beetho-san. However, these guys, with their crazy antics and supernatural musical powers, claim to be Classicaloid versions of maestros Mozart and Beethoven! Their powerful \u201cmujik\u201d arrangements evoke more than just emotions: they can make the stars fall, spirits dance, or even summon\u2026 giant robots? Friend or foe, Kanae is stuck with them, even as more classicaloids begin to invade her life. Will their presence usher in a new musical renaissance in her sleepy town, or will their explosive euphonics cut the standing ovation short?\n\n(Source: Sentai Filmworks)", - "coverImageTopOffset": 0, - "titles": { - "en": null, - "en_jp": "Classicaloid", - "ja_jp": null - }, - "canonicalTitle": "Classicaloid", - "abbreviatedTitles": null, - "averageRating": 3.3375220536964, - "ratingFrequencies": { - "0.5": "5", - "1.0": "6", - "1.5": "8", - "2.0": "9", - "2.5": "19", - "3.0": "20", - "3.5": "13", - "4.0": "5", - "4.5": "3", - "5.0": "13", - "nil": "586" - }, - "startDate": "2016-10-08", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11172\/tiny.jpg?1473684531", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11172\/small.jpg?1473684531", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11172\/medium.jpg?1473684531", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11172\/large.jpg?1473684531", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11172\/original.jpg?1473684531" - }, - "coverImage": null, - "episodeCount": 25, - "episodeLength": 24, - "subtype": "TV", - "youtubeVideoId": "3U2YT9b4QjI", - "ageRating": null, - "ageRatingGuide": null, - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - }, - "35": { - "title": "Music", - "slug": "music", - "description": null - } - }, - "mappings": { - "1113": { - "externalSite": "myanimelist\/anime", - "externalId": "31157", - "relationships": [] - } - } - } - }, - "12260": { - "slug": "shuumatsu-no-izetta", - "synopsis": "The time is pre World War II that looks like Europe in an imaginary world. A large scale war abrupts and bloody battles are taking place through out the world. Eylstadt is a small country without a strong military force or natural resources. Fin\u00e9 who is the crown queen of Eylstadt decides to use a secret weapon against larger countries which was unheard of at that time to battle against larger countries. The secret weapon was using a witch named Izetta and her magical force to fight the war. Izetta is young (same age as Fin\u00e9) and the last surviving witch with burning red hair.\r\n\r\n(Source: Crunchyroll)", - "coverImageTopOffset": 0, - "titles": { - "en": "Izetta: The Last Witch", - "en_jp": "Shuumatsu no Izetta", - "ja_jp": "\u7d42\u672b\u306e\u30a4\u30bc\u30c3\u30bf" - }, - "canonicalTitle": "Shuumatsu no Izetta", - "abbreviatedTitles": null, - "averageRating": 3.6080106339216, - "ratingFrequencies": { - "0.5": "3", - "1.0": "10", - "1.5": "21", - "2.0": "48", - "2.5": "98", - "3.0": "169", - "3.5": "199", - "4.0": "143", - "4.5": "66", - "5.0": "77", - "nil": "2381" - }, - "startDate": "2016-10-01", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12260\/tiny.jpg?1475958976", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12260\/small.jpg?1475958976", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12260\/medium.jpg?1475958976", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12260\/large.jpg?1475958976", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12260\/original.png?1475958976" - }, - "coverImage": null, - "episodeCount": 12, - "episodeLength": 25, - "subtype": "TV", - "youtubeVideoId": "piEEGQdBho8", - "ageRating": null, - "ageRatingGuide": "", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "8": { - "title": "Magic", - "slug": "magic", - "description": null - }, - "27": { - "title": "Historical", - "slug": "historical", - "description": null - }, - "28": { - "title": "Military", - "slug": "military", - "description": null - }, - "4": { - "title": "Drama", - "slug": "drama", - "description": "" - }, - "1": { - "title": "Action", - "slug": "action", - "description": "" - } - }, - "mappings": { - "3376": { - "externalSite": "myanimelist\/anime", - "externalId": "33433", - "relationships": [] - } - } - } - }, - "11945": { - "slug": "nyanbo", - "synopsis": "NHK announced that \"Nyanbo,\" a cat version of the \"Danbo\" cardboard robot character within Kiyohiko Azuma's Yotsuba&! manga, is inspiring a television anime that will premiere on NHK-E TV in October.\r\n\r\n(Source: ANN)", - "coverImageTopOffset": 20, - "titles": { - "en": "", - "en_jp": "Nyanbo!", - "ja_jp": "\u306b\u3083\u3093\u307c\u30fc!" - }, - "canonicalTitle": "Nyanbo!", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "1", - "1.0": "1", - "1.5": "3", - "2.0": "3", - "2.5": "3", - "3.0": "12", - "3.5": "4", - "4.0": "5", - "4.5": "1", - "5.0": "5", - "nil": "146" - }, - "startDate": "2016-09-27", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11945\/tiny.jpg?1458335123", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11945\/small.jpg?1458335123", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11945\/medium.jpg?1458335123", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11945\/large.jpg?1458335123", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11945\/original.png?1458335123" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/11945\/small.jpg?1458335194", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/11945\/large.jpg?1458335194", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/11945\/original.jpg?1458335194" - }, - "episodeCount": 26, - "episodeLength": 5, - "subtype": "TV", - "youtubeVideoId": "", - "ageRating": "PG", - "ageRatingGuide": "Children", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "3": { - "title": "Comedy", - "slug": "comedy", - "description": null - } - }, - "mappings": { - "9580": { - "externalSite": "myanimelist\/anime", - "externalId": "32805", - "relationships": [] - } - } - } - }, - "11882": { - "slug": "bungou-stray-dogs-2", - "synopsis": "Second season of Bungou Stray Dogs.", - "coverImageTopOffset": 80, - "titles": { - "en": "", - "en_jp": "Bungou Stray Dogs 2nd Season", - "ja_jp": "" - }, - "canonicalTitle": "Bungou Stray Dogs 2nd Season", - "abbreviatedTitles": null, - "averageRating": 4.1712266171588, - "ratingFrequencies": { - "0.5": "1", - "1.0": "5", - "1.5": "2", - "2.0": "12", - "2.5": "15", - "3.0": "52", - "3.5": "119", - "4.0": "261", - "4.5": "173", - "5.0": "244", - "nil": "2175" - }, - "startDate": "2016-10-06", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11882\/tiny.jpg?1466782284", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11882\/small.jpg?1466782284", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11882\/medium.jpg?1466782284", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11882\/large.jpg?1466782284", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11882\/original.jpg?1466782284" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/11882\/small.jpg?1462734002", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/11882\/large.jpg?1462734002", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/11882\/original.jpg?1462734002" - }, - "episodeCount": 12, - "episodeLength": 24, - "subtype": "TV", - "youtubeVideoId": "aeX94e7V0_w", - "ageRating": "R", - "ageRatingGuide": "", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "7": { - "title": "Mystery", - "slug": "mystery", - "description": null - }, - "9": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - }, - "4": { - "title": "Drama", - "slug": "drama", - "description": "" - }, - "1": { - "title": "Action", - "slug": "action", - "description": "" - } - }, - "mappings": { - "3158": { - "externalSite": "myanimelist\/anime", - "externalId": "32867", - "relationships": [] - } - } - } - }, - "11363": { - "slug": "mahou-shoujo-ikusei-keikaku", - "synopsis": "The highly popular social network game \"Magical Girl Raising Project\" is a miraculous game that produces real Magical Girls with a chance of 1 in 10000 for each person. Girls who are lucky enough to gain the power of magic spend fulfilling days. But one day, the administration arbitrarily announces that \"There are too many magical girls so they will be halved\". The curtain will now be raised on the relentless and merciless survival game between 16 magical girls.\r\n\r\n(Source: Baka-Tsuki)", - "coverImageTopOffset": 300, - "titles": { - "en": "Magical Girl Raising Project", - "en_jp": "Mahou Shoujo Ikusei Keikaku", - "ja_jp": "" - }, - "canonicalTitle": "Mahou Shoujo Ikusei Keikaku", - "abbreviatedTitles": null, - "averageRating": 3.5054257833898, - "ratingFrequencies": { - "0.5": "4", - "1.0": "16", - "1.5": "13", - "2.0": "33", - "2.5": "54", - "3.0": "99", - "3.5": "141", - "4.0": "121", - "4.5": "55", - "5.0": "45", - "nil": "1458" - }, - "startDate": "2016-10-02", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11363\/tiny.jpg?1469134150", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11363\/small.jpg?1469134150", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11363\/medium.jpg?1469134150", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11363\/large.jpg?1469134150", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11363\/original.jpg?1469134150" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/11363\/small.jpg?1480567882", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/11363\/large.jpg?1480567882", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/11363\/original.jpg?1480567882" - }, - "episodeCount": 12, - "episodeLength": 24, - "subtype": "TV", - "youtubeVideoId": "p4YXswlZHrA", - "ageRating": "PG", - "ageRatingGuide": "Teens 13 or older", - "showType": "TV", - "nsfw": false, - "relationships": { - "categories": { - "9": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - }, - "21": { - "title": "Thriller", - "slug": "thriller", - "description": null - }, - "47": { - "title": "Mahou Shoujo", - "slug": "mahou-shoujo", - "description": "Magical Girls" - }, - "11": { - "title": "Fantasy", - "slug": "fantasy", - "description": "" - }, - "1": { - "title": "Action", - "slug": "action", - "description": "" - } - }, - "mappings": { - "342": { - "externalSite": "myanimelist\/anime", - "externalId": "33003", - "relationships": [] - } - } - } - } - } - } + "data": { + "findLibraryEntryById": { + "id": "435513", + "updatedAt": "2020-10-20T16:35:52Z", + "notes": "", + "nsfw": false, + "private": false, + "progress": 7, + "reconsumeCount": 0, + "reconsuming": false, + "status": "CURRENT", + "rating": null, + "media": { + "id": "185", + "slug": "r-o-d", + "ageRating": "PG", + "categories": { + "nodes": [ + { + "title": { + "en": "Science Fiction" + } + }, + { + "title": { + "en": "Japan" + } + }, + { + "title": { + "en": "Action" + } + }, + { + "title": { + "en": "Plot Continuity" + } + }, + { + "title": { + "en": "Present" + } + }, + { + "title": { + "en": "Super Power" + } + }, + { + "title": { + "en": "Adventure" + } + }, + { + "title": { + "en": "Comedy" + } + } + ] + }, + "mappings": { + "nodes": [ + { + "externalId": "894", + "externalSite": "ANIDB" + }, + { + "externalId": "209", + "externalSite": "ANILIST_ANIME" + }, + { + "externalId": "VP75muO4EK", + "externalSite": "AOZORA" + }, + { + "externalId": "209", + "externalSite": "MYANIMELIST_ANIME" + }, + { + "externalId": "82319/1", + "externalSite": "THETVDB" + }, + { + "externalId": "82319", + "externalSite": "THETVDB_SERIES" + }, + { + "externalId": "39995", + "externalSite": "TRAKT" + } + ] + }, + "posterImage": { + "views": [ + { + "width": 110, + "height": 156, + "url": "https://media.kitsu.io/anime/poster_images/185/tiny.jpg?1597697520" + }, + { + "width": 284, + "height": 402, + "url": "https://media.kitsu.io/anime/poster_images/185/small.jpg?1597697520" + }, + { + "width": 390, + "height": 554, + "url": "https://media.kitsu.io/anime/poster_images/185/medium.jpg?1597697520" + }, + { + "width": 550, + "height": 780, + "url": "https://media.kitsu.io/anime/poster_images/185/large.jpg?1597697520" + } + ], + "original": { + "width": 225, + "height": 314, + "url": "https://media.kitsu.io/anime/poster_images/185/original.jpg?1597697520" + } + }, + "startDate": "2003-09-01", + "endDate": "2004-03-16", + "titles": { + "canonical": "R.O.D the TV", + "localized": { + "en": "R.O.D -The TV-", + "en_jp": "R.O.D the TV", + "en_us": "R.O.D -The TV-", + "ja_jp": "アール・オー・ディー ザ・ティーヴィー" + }, + "canonicalLocale": "en_jp" + }, + "type": "Anime", + "episodeCount": 26, + "episodeLength": 1500, + "streamingLinks": { + "nodes": [ + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "3", + "siteName": "Crunchyroll" + }, + "url": "http://www.crunchyroll.com/rod" + }, + { + "dubs": [ + "ja" + ], + "subs": [ + "en" + ], + "regions": [ + "US" + ], + "streamer": { + "id": "1", + "siteName": "Hulu" + }, + "url": "http://www.hulu.com/rod-the-tv" + } + ] + }, + "subtype": "TV" + } + } + } } \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/mangaAfterTransform.json b/tests/AnimeClient/test_data/Kitsu/mangaAfterTransform.json deleted file mode 100644 index 2be310c8..00000000 --- a/tests/AnimeClient/test_data/Kitsu/mangaAfterTransform.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": "Bokura wa Minna Kawaisou", - "en_title": null, - "jp_title": "Bokura wa Minna Kawaisou", - "cover_image": "https:\/\/media.kitsu.io\/manga\/poster_images\/20286\/small.jpg?1434293999", - "manga_type": "manga", - "chapter_count": "-", - "volume_count": "-", - "synopsis": "Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well!\n(Source: Kirei Cake)", - "url": "https:\/\/kitsu.io\/manga\/bokura-wa-minna-kawaisou", - "genres": ["Comedy","Romance","School","Slice of Life","Thriller"] -} \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/mangaBeforeTransform.json b/tests/AnimeClient/test_data/Kitsu/mangaBeforeTransform.json index 6126fc64..4180c361 100644 --- a/tests/AnimeClient/test_data/Kitsu/mangaBeforeTransform.json +++ b/tests/AnimeClient/test_data/Kitsu/mangaBeforeTransform.json @@ -1,197 +1,465 @@ { - "data": [{ - "id": "20286", - "type": "manga", - "links": { - "self": "https://kitsu.io/api/edge/manga/20286" + "data": { + "findMangaBySlug": { + "id": "20286", + "ageRating": "PG", + "ageRatingGuide": "", + "posterImage": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/manga/poster_images/20286/original.jpg?1434293999", + "width": null }, - "attributes": { - "slug": "bokura-wa-minna-kawaisou", - "synopsis": "Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well!\n(Source: Kirei Cake)", - "coverImageTopOffset": 40, - "titles": { - "en_us": null, - "en_jp": "Bokura wa Minna Kawaisou" - }, - "canonicalTitle": "Bokura wa Minna Kawaisou", - "abbreviatedTitles": null, - "averageRating": 4.12281805954249, - "ratingFrequencies": { - "0.5": "0", - "1.0": "1", - "1.5": "0", - "2.0": "1", - "2.5": "2", - "3.0": "6", - "3.5": "21", - "4.0": "38", - "4.5": "35", - "5.0": "43", - "nil": "16" - }, - "favoritesCount": 0, - "startDate": "2010-01-01", - "endDate": null, - "popularityRank": 262, - "ratingRank": 127, - "ageRating": "PG", - "ageRatingGuide": null, - "posterImage": { - "tiny": "https://media.kitsu.io/manga/poster_images/20286/tiny.jpg?1434293999", - "small": "https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999", - "medium": "https://media.kitsu.io/manga/poster_images/20286/medium.jpg?1434293999", - "large": "https://media.kitsu.io/manga/poster_images/20286/large.jpg?1434293999", - "original": "https://media.kitsu.io/manga/poster_images/20286/original.jpg?1434293999" - }, - "coverImage": { - "small": "https://media.kitsu.io/manga/cover_images/20286/small.jpg?1430793688", - "large": "https://media.kitsu.io/manga/cover_images/20286/large.jpg?1430793688", - "original": "https://media.kitsu.io/manga/cover_images/20286/original.jpg?1430793688" - }, - "subtype": "manga", - "chapterCount": null, - "volumeCount": 0, - "serialization": "Young King Ours", - "mangaType": "manga" - }, - "relationships": { - "genres": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/genres", - "related": "https://kitsu.io/api/edge/manga/20286/genres" - }, - "data": [{ - "type": "genres", - "id": "3" - }, { - "type": "genres", - "id": "24" - }, { - "type": "genres", - "id": "16" - }, { - "type": "genres", - "id": "14" - }, { - "type": "genres", - "id": "18" - }] - }, - "castings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/castings", - "related": "https://kitsu.io/api/edge/manga/20286/castings" - } - }, - "installments": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/installments", - "related": "https://kitsu.io/api/edge/manga/20286/installments" - } - }, - "mappings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/mappings", - "related": "https://kitsu.io/api/edge/manga/20286/mappings" - }, - "data": [{ - "type": "mappings", - "id": "48014" - }] - }, - "reviews": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/reviews", - "related": "https://kitsu.io/api/edge/manga/20286/reviews" - } - }, - "mediaRelationships": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/media-relationships", - "related": "https://kitsu.io/api/edge/manga/20286/media-relationships" - } + "views": [ + { + "height": null, + "name": "tiny", + "url": "https://media.kitsu.io/manga/poster_images/20286/tiny.jpg?1434293999", + "width": null + }, + { + "height": null, + "name": "small", + "url": "https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999", + "width": null + }, + { + "height": null, + "name": "medium", + "url": "https://media.kitsu.io/manga/poster_images/20286/medium.jpg?1434293999", + "width": null + }, + { + "height": null, + "name": "large", + "url": "https://media.kitsu.io/manga/poster_images/20286/large.jpg?1434293999", + "width": null + } + ] + }, + "categories": { + "nodes": [ + { + "title": { + "en": "Comedy" } - } - }], - "included": [{ - "id": "3", - "type": "genres", - "links": { - "self": "https://kitsu.io/api/edge/genres/3" - }, - "attributes": { - "name": "Comedy", - "slug": "comedy", - "description": null - } - }, { - "id": "24", - "type": "genres", - "links": { - "self": "https://kitsu.io/api/edge/genres/24" - }, - "attributes": { - "name": "School", - "slug": "school", - "description": null - } - }, { - "id": "16", - "type": "genres", - "links": { - "self": "https://kitsu.io/api/edge/genres/16" - }, - "attributes": { - "name": "Slice of Life", - "slug": "slice-of-life", - "description": "" - } - }, { - "id": "14", - "type": "genres", - "links": { - "self": "https://kitsu.io/api/edge/genres/14" - }, - "attributes": { - "name": "Romance", - "slug": "romance", - "description": "" - } - }, { - "id": "18", - "type": "genres", - "links": { - "self": "https://kitsu.io/api/edge/genres/18" - }, - "attributes": { - "name": "Thriller", - "slug": "thriller", - "description": null - } - }, { - "id": "48014", - "type": "mappings", - "links": { - "self": "https://kitsu.io/api/edge/mappings/48014" - }, - "attributes": { - "externalSite": "myanimelist/manga", - "externalId": "26769" - }, - "relationships": { - "media": { - "links": { - "self": "https://kitsu.io/api/edge/mappings/48014/relationships/media", - "related": "https://kitsu.io/api/edge/mappings/48014/media" - } + }, + { + "title": { + "en": "School Life" } + }, + { + "title": { + "en": "Slice of Life" + } + }, + { + "title": { + "en": "Romance" + } + } + ] + }, + "chapterCount": 90, + "volumeCount": 10, + "characters": { + "nodes": [ + { + "character": { + "id": "83463", + "names": { + "canonical": "Yoko Mabuchi", + "alternatives": [ + "Yoko-chan" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png", + "width": null + } + }, + "slug": "yoko-mabuchi" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "40540", + "names": { + "canonical": "Ritsu Kawai", + "alternatives": [ + "Ricchan" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/40540/original.jpg?1483096805", + "width": null + } + }, + "slug": "ritsu-kawai" + }, + "role": "MAIN" + }, + { + "character": { + "id": "40541", + "names": { + "canonical": "Kazunari Usa", + "alternatives": [ + "Oddball handler" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/40541/original.jpg?1483096805", + "width": null + } + }, + "slug": "kazunari-usa" + }, + "role": "MAIN" + }, + { + "character": { + "id": "62591", + "names": { + "canonical": "Chinatsu", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/62591/original.jpg?1485073100", + "width": null + } + }, + "slug": "chinatsu" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "72839", + "names": { + "canonical": "Hayashi", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/72839/original.jpg?1485079724", + "width": null + } + }, + "slug": "hayashi-ec3a2705-5d5c-493c-b172-bbee2d04b5b9" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "78362", + "names": { + "canonical": "Houjou", + "alternatives": [ + "Yamamoto" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/78362/original.jpg?1485081676", + "width": null + } + }, + "slug": "houjou" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "55131", + "names": { + "canonical": "Sumiko Kawai", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/55131/original.jpg?1483096805", + "width": null + } + }, + "slug": "sumiko-kawai" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "90353", + "names": { + "canonical": "Kurokawa", + "alternatives": [ + "Saionji" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/90353/original.jpg?1485086356", + "width": null + } + }, + "slug": "kurokawa-a493ddf6-0f02-4abf-8b18-ab6ae2198b6e" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "77996", + "names": { + "canonical": "Maemura", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/77996/original.jpg?1485081552", + "width": null + } + }, + "slug": "maemura" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "55132", + "names": { + "canonical": "Mayumi Nishikino", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/55132/original.jpg?1483096805", + "width": null + } + }, + "slug": "mayumi-nishikino" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "74335", + "names": { + "canonical": "Tae Shinohara", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/74335/original.jpg?1485080245", + "width": null + } + }, + "slug": "tae-shinohara" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "95032", + "names": { + "canonical": "Shirosaki", + "alternatives": [ + "Shiro" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/95032/original.jpg?1485088329", + "width": null + } + }, + "slug": "shirosaki-2ed2e15c-9cee-4756-92f1-027c4820e224" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "55133", + "names": { + "canonical": "Tagami", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/55133/original.jpg?1483096805", + "width": null + } + }, + "slug": "tagami" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "71479", + "names": { + "canonical": "Miharu Tsuneda", + "alternatives": [ + "Tsuneko" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/71479/original.jpg?1485079211", + "width": null + } + }, + "slug": "miharu-tsuneda" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "55134", + "names": { + "canonical": "Mother Usa", + "alternatives": [] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "/images/original/missing.png?1483096805", + "width": null + } + }, + "slug": "mother-usa" + }, + "role": "BACKGROUND" + }, + { + "character": { + "id": "55135", + "names": { + "canonical": "Sayaka Watanabe", + "alternatives": [ + "Nabe" + ] + }, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/characters/images/55135/original.jpg?1483096805", + "width": null + } + }, + "slug": "sayaka-watanabe" + }, + "role": "BACKGROUND" + } + ], + "pageInfo": { + "endCursor": "MTY", + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "MQ" } - }], - "meta": { - "count": 1 - }, - "links": { - "first": "https://kitsu.io/api/edge/manga?filter%5Bslug%5D=bokura-wa-minna-kawaisou&include=genres%2Cmappings&page%5Blimit%5D=10&page%5Boffset%5D=0", - "last": "https://kitsu.io/api/edge/manga?filter%5Bslug%5D=bokura-wa-minna-kawaisou&include=genres%2Cmappings&page%5Blimit%5D=10&page%5Boffset%5D=0" + }, + "description": { + "en": "Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well!\r\n(Source: Kirei Cake)" + }, + "startDate": "2010-04-30", + "endDate": "2017-12-28", + "mappings": { + "nodes": [ + { + "externalId": "56769", + "externalSite": "ANILIST_MANGA" + }, + { + "externalId": "26769", + "externalSite": "MYANIMELIST_MANGA" + } + ] + }, + "sfw": true, + "slug": "bokura-wa-minna-kawaisou", + "staff": { + "nodes": [ + { + "person": { + "id": "8712", + "birthday": null, + "image": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/people/images/8712/original.jpg?1533271952", + "width": null + }, + "views": [] + }, + "names": { + "alternatives": [], + "canonical": "en", + "localized": { + "en": "Ruri Miyahara", + "ja_jp": "宮原 るり" + } + }, + "slug": "ruri-miyahara" + }, + "role": "Story \u0026 Art" + } + ], + "pageInfo": { + "endCursor": "MQ", + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "MQ" + } + }, + "status": "FINISHED", + "subtype": "MANGA", + "titles": { + "canonical": "Bokura wa Minna Kawai-sou", + "canonicalLocale": "en_jp", + "localized": { + "en": "The Kawai Complex Guide to Manors and Hostel", + "en_jp": "Bokura wa Minna Kawai-sou", + "en_us": "The Kawai Complex Guide to Manors and Hostel", + "ja_jp": "僕らはみんな河合荘" + } + } } + } } \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/mangaListAfterTransform.json b/tests/AnimeClient/test_data/Kitsu/mangaListAfterTransform.json deleted file mode 100644 index 50ab7a9c..00000000 --- a/tests/AnimeClient/test_data/Kitsu/mangaListAfterTransform.json +++ /dev/null @@ -1,126 +0,0 @@ -[{ - "id": "15084773", - "mal_id": "26769", - "chapters": { - "read": 67, - "total": "-" - }, - "volumes": { - "read": "-", - "total": "-" - }, - "manga": { - "titles": ["Bokura wa Minna Kawaisou"], - "alternate_title": null, - "slug": "bokura-wa-minna-kawaisou", - "url": "https:\/\/kitsu.io\/manga\/bokura-wa-minna-kawaisou", - "type": "manga", - "image": "https:\/\/media.kitsu.io\/manga\/poster_images\/20286\/small.jpg?1434293999", - "genres": ["Comedy", "Romance", "School", "Slice of Life", "Thriller"] - }, - "reading_status": "current", - "notes": "", - "rereading": false, - "reread": 0, - "user_rating": 9 -}, { - "id": "15085607", - "mal_id": "16", - "chapters": { - "read": 17, - "total": 120 - }, - "volumes": { - "read": "-", - "total": 14 - }, - "manga": { - "titles": ["Love Hina"], - "alternate_title": null, - "slug": "love-hina", - "url": "https:\/\/kitsu.io\/manga\/love-hina", - "type": "manga", - "image": "https:\/\/media.kitsu.io\/manga\/poster_images\/47\/small.jpg?1434249493", - "genres": ["Comedy", "Ecchi", "Harem", "Romance", "Sports"] - }, - "reading_status": "current", - "notes": "", - "rereading": false, - "reread": 0, - "user_rating": 7 -}, { - "id": "15084529", - "mal_id": "35003", - "chapters": { - "read": 16, - "total": "-" - }, - "volumes": { - "read": "-", - "total": "-" - }, - "manga": { - "titles": ["Yamada-kun to 7-nin no Majo", "Yamada-kun and the Seven Witches"], - "alternate_title": null, - "slug": "yamada-kun-to-7-nin-no-majo", - "url": "https:\/\/kitsu.io\/manga\/yamada-kun-to-7-nin-no-majo", - "type": "manga", - "image": "https:\/\/media.kitsu.io\/manga\/poster_images\/11777\/small.jpg?1438784325", - "genres": ["Comedy", "Ecchi", "Gender Bender", "Romance", "School", "Sports", "Supernatural"] - }, - "reading_status": "current", - "notes": "", - "rereading": false, - "reread": 0, - "user_rating": 9 -}, { - "id": "15312827", - "mal_id": "78523", - "chapters": { - "read": 68, - "total": "-" - }, - "volumes": { - "read": "-", - "total": "-" - }, - "manga": { - "titles": ["ReLIFE"], - "alternate_title": null, - "slug": "relife", - "url": "https:\/\/kitsu.io\/manga\/relife", - "type": "manga", - "image": "https:\/\/media.kitsu.io\/manga\/poster_images\/27175\/small.jpg?1464379411", - "genres": ["Romance", "School", "Slice of Life"] - }, - "reading_status": "current", - "notes": "", - "rereading": false, - "reread": 0, - "user_rating": "-" -}, { - "id": "15084769", - "mal_id": "60815", - "chapters": { - "read": 43, - "total": "-" - }, - "volumes": { - "read": "-", - "total": "-" - }, - "manga": { - "titles": ["Joshikausei"], - "alternate_title": null, - "slug": "joshikausei", - "url": "https:\/\/kitsu.io\/manga\/joshikausei", - "type": "manga", - "image": "https:\/\/media.kitsu.io\/manga\/poster_images\/25491\/small.jpg?1434305043", - "genres": ["Comedy", "School", "Slice of Life"] - }, - "reading_status": "current", - "notes": "", - "rereading": false, - "reread": 0, - "user_rating": 8 -}] \ No newline at end of file diff --git a/tests/AnimeClient/test_data/Kitsu/mangaListBeforeTransform.json b/tests/AnimeClient/test_data/Kitsu/mangaListBeforeTransform.json index 585921e5..4090e25c 100644 --- a/tests/AnimeClient/test_data/Kitsu/mangaListBeforeTransform.json +++ b/tests/AnimeClient/test_data/Kitsu/mangaListBeforeTransform.json @@ -1,1250 +1,189 @@ { - "data": [ - { - "id": "15084773", - "type": "libraryEntries", - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773" - }, - "attributes": { - "status": "current", - "progress": 67, - "reconsuming": false, - "reconsumeCount": 0, - "notes": "", - "private": false, - "rating": "4.5", - "ratingTwenty": "18", - "updatedAt": "2017-01-09T17:51:16.691Z" - }, - "relationships": { - "user": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/user", - "related": "https://kitsu.io/api/edge/library-entries/15084773/user" - } - }, - "anime": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/anime", - "related": "https://kitsu.io/api/edge/library-entries/15084773/anime" - } - }, - "manga": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/manga", - "related": "https://kitsu.io/api/edge/library-entries/15084773/manga" - } - }, - "drama": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/drama", - "related": "https://kitsu.io/api/edge/library-entries/15084773/drama" - } - }, - "review": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/review", - "related": "https://kitsu.io/api/edge/library-entries/15084773/review" - } - }, - "media": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/media", - "related": "https://kitsu.io/api/edge/library-entries/15084773/media" - }, - "data": { - "type": "manga", - "id": "20286" - } - }, - "unit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/unit", - "related": "https://kitsu.io/api/edge/library-entries/15084773/unit" - } - }, - "nextUnit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084773/relationships/next-unit", - "related": "https://kitsu.io/api/edge/library-entries/15084773/next-unit" - } - } - } - }, - { - "id": "15085607", - "type": "libraryEntries", - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607" - }, - "attributes": { - "status": "current", - "progress": 17, - "reconsuming": false, - "reconsumeCount": 0, - "notes": "", - "private": false, - "rating": "3.5", - "ratingTwenty": "14", - "updatedAt": "2017-01-09T17:50:19.594Z" - }, - "relationships": { - "user": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/user", - "related": "https://kitsu.io/api/edge/library-entries/15085607/user" - } - }, - "anime": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/anime", - "related": "https://kitsu.io/api/edge/library-entries/15085607/anime" - } - }, - "manga": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/manga", - "related": "https://kitsu.io/api/edge/library-entries/15085607/manga" - } - }, - "drama": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/drama", - "related": "https://kitsu.io/api/edge/library-entries/15085607/drama" - } - }, - "review": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/review", - "related": "https://kitsu.io/api/edge/library-entries/15085607/review" - } - }, - "media": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/media", - "related": "https://kitsu.io/api/edge/library-entries/15085607/media" - }, - "data": { - "type": "manga", - "id": "47" - } - }, - "unit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/unit", - "related": "https://kitsu.io/api/edge/library-entries/15085607/unit" - } - }, - "nextUnit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15085607/relationships/next-unit", - "related": "https://kitsu.io/api/edge/library-entries/15085607/next-unit" - } - } - } - }, - { - "id": "15084529", - "type": "libraryEntries", - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529" - }, - "attributes": { - "status": "current", - "progress": 16, - "reconsuming": false, - "reconsumeCount": 0, - "notes": "", - "private": false, - "rating": "4.5", - "ratingTwenty": "18", - "updatedAt": "2016-04-07T17:10:13.022Z" - }, - "relationships": { - "user": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/user", - "related": "https://kitsu.io/api/edge/library-entries/15084529/user" - } - }, - "anime": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/anime", - "related": "https://kitsu.io/api/edge/library-entries/15084529/anime" - } - }, - "manga": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/manga", - "related": "https://kitsu.io/api/edge/library-entries/15084529/manga" - } - }, - "drama": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/drama", - "related": "https://kitsu.io/api/edge/library-entries/15084529/drama" - } - }, - "review": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/review", - "related": "https://kitsu.io/api/edge/library-entries/15084529/review" - } - }, - "media": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/media", - "related": "https://kitsu.io/api/edge/library-entries/15084529/media" - }, - "data": { - "type": "manga", - "id": "11777" - } - }, - "unit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/unit", - "related": "https://kitsu.io/api/edge/library-entries/15084529/unit" - } - }, - "nextUnit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084529/relationships/next-unit", - "related": "https://kitsu.io/api/edge/library-entries/15084529/next-unit" - } - } - } - }, - { - "id": "15312827", - "type": "libraryEntries", - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827" - }, - "attributes": { - "status": "current", - "progress": 68, - "reconsuming": false, - "reconsumeCount": 0, - "notes": "", - "private": false, - "rating": null, - "ratingTwenty": null, - "updatedAt": "2016-03-08T15:45:45.818Z" - }, - "relationships": { - "user": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/user", - "related": "https://kitsu.io/api/edge/library-entries/15312827/user" - } - }, - "anime": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/anime", - "related": "https://kitsu.io/api/edge/library-entries/15312827/anime" - } - }, - "manga": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/manga", - "related": "https://kitsu.io/api/edge/library-entries/15312827/manga" - } - }, - "drama": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/drama", - "related": "https://kitsu.io/api/edge/library-entries/15312827/drama" - } - }, - "review": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/review", - "related": "https://kitsu.io/api/edge/library-entries/15312827/review" - } - }, - "media": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/media", - "related": "https://kitsu.io/api/edge/library-entries/15312827/media" - }, - "data": { - "type": "manga", - "id": "27175" - } - }, - "unit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/unit", - "related": "https://kitsu.io/api/edge/library-entries/15312827/unit" - } - }, - "nextUnit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15312827/relationships/next-unit", - "related": "https://kitsu.io/api/edge/library-entries/15312827/next-unit" - } - } - } - }, - { - "id": "15084769", - "type": "libraryEntries", - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769" - }, - "attributes": { - "status": "current", - "progress": 43, - "reconsuming": false, - "reconsumeCount": 0, - "notes": "", - "private": false, - "rating": "4.0", - "ratingTwenty": "16", - "updatedAt": "2016-02-02T15:06:07.166Z" - }, - "relationships": { - "user": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/user", - "related": "https://kitsu.io/api/edge/library-entries/15084769/user" - } - }, - "anime": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/anime", - "related": "https://kitsu.io/api/edge/library-entries/15084769/anime" - } - }, - "manga": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/manga", - "related": "https://kitsu.io/api/edge/library-entries/15084769/manga" - } - }, - "drama": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/drama", - "related": "https://kitsu.io/api/edge/library-entries/15084769/drama" - } - }, - "review": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/review", - "related": "https://kitsu.io/api/edge/library-entries/15084769/review" - } - }, - "media": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/media", - "related": "https://kitsu.io/api/edge/library-entries/15084769/media" - }, - "data": { - "type": "manga", - "id": "25491" - } - }, - "unit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/unit", - "related": "https://kitsu.io/api/edge/library-entries/15084769/unit" - } - }, - "nextUnit": { - "links": { - "self": "https://kitsu.io/api/edge/library-entries/15084769/relationships/next-unit", - "related": "https://kitsu.io/api/edge/library-entries/15084769/next-unit" - } - } - } - } - ], - "included": [ - { - "id": "20286", - "type": "manga", - "links": { - "self": "https://kitsu.io/api/edge/manga/20286" - }, - "attributes": { - "slug": "bokura-wa-minna-kawaisou", - "synopsis": "Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well!\n(Source: Kirei Cake)", - "coverImageTopOffset": 40, - "titles": { - "en": null, - "en_jp": "Bokura wa Minna Kawaisou" - }, - "canonicalTitle": "Bokura wa Minna Kawaisou", - "abbreviatedTitles": null, - "averageRating": 4.12518266974679, - "ratingFrequencies": { - "0.5": "0", - "1.0": "1", - "1.5": "0", - "2.0": "1", - "2.5": "2", - "3.0": "6", - "3.5": "22", - "4.0": "39", - "4.5": "39", - "5.0": "44", - "nil": "16" - }, - "favoritesCount": 32, - "startDate": "2010-01-01", - "endDate": null, - "popularityRank": 263, - "ratingRank": 124, - "ageRating": "PG", - "ageRatingGuide": null, - "subtype": "manga", - "posterImage": { - "tiny": "https://media.kitsu.io/manga/poster_images/20286/tiny.jpg?1434293999", - "small": "https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999", - "medium": "https://media.kitsu.io/manga/poster_images/20286/medium.jpg?1434293999", - "large": "https://media.kitsu.io/manga/poster_images/20286/large.jpg?1434293999", - "original": "https://media.kitsu.io/manga/poster_images/20286/original.jpg?1434293999" - }, - "coverImage": { - "tiny": "https://media.kitsu.io/manga/cover_images/20286/tiny.jpg?1430793688", - "small": "https://media.kitsu.io/manga/cover_images/20286/small.jpg?1430793688", - "large": "https://media.kitsu.io/manga/cover_images/20286/large.jpg?1430793688", - "original": "https://media.kitsu.io/manga/cover_images/20286/original.jpg?1430793688" - }, - "chapterCount": null, - "volumeCount": 0, - "serialization": "Young King Ours", - "mangaType": "manga" - }, - "relationships": { - "categories": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/categories", - "related": "https://kitsu.io/api/edge/manga/20286/categories" - }, - "data": [ - { - "type": "categories", - "id": "3" - }, - { - "type": "categories", - "id": "21" - }, - { - "type": "categories", - "id": "24" - }, - { - "type": "categories", - "id": "16" - }, - { - "type": "categories", - "id": "14" - } - ] - }, - "castings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/castings", - "related": "https://kitsu.io/api/edge/manga/20286/castings" - } - }, - "installments": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/installments", - "related": "https://kitsu.io/api/edge/manga/20286/installments" - } - }, - "mappings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/mappings", - "related": "https://kitsu.io/api/edge/manga/20286/mappings" - }, - "data": [ - { - "type": "mappings", - "id": "48014" - } - ] - }, - "reviews": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/reviews", - "related": "https://kitsu.io/api/edge/manga/20286/reviews" - } - }, - "mediaRelationships": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/media-relationships", - "related": "https://kitsu.io/api/edge/manga/20286/media-relationships" - } - }, - "mangaCharacters": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/manga-characters", - "related": "https://kitsu.io/api/edge/manga/20286/manga-characters" - } - }, - "mangaStaff": { - "links": { - "self": "https://kitsu.io/api/edge/manga/20286/relationships/manga-staff", - "related": "https://kitsu.io/api/edge/manga/20286/manga-staff" - } - } - } - }, - { - "id": "47", - "type": "manga", - "links": { - "self": "https://kitsu.io/api/edge/manga/47" - }, - "attributes": { - "slug": "love-hina", - "synopsis": "Keitaro has had great difficulty getting into the university of his choice and no luck in meeting women. In a desperate effort to go into seclusion and study for his entrance exams, he volunteers to take over running his grandmother's hotel. His plans are ruined when he discovers that the \"hotel\" is actually an all-girls dormitory ... and some serious distractions ensue.\r\n(Source: Tokyopop)", - "coverImageTopOffset": 75, - "titles": { - "en": null, - "en_jp": "Love Hina" - }, - "canonicalTitle": "Love Hina", - "abbreviatedTitles": null, - "averageRating": 3.90477702884008, - "ratingFrequencies": { - "0.5": "1", - "1.0": "6", - "1.5": "4", - "2.0": "16", - "2.5": "24", - "3.0": "40", - "3.5": "79", - "4.0": "93", - "4.5": "73", - "5.0": "104", - "nil": "19" - }, - "favoritesCount": 64, - "startDate": "1998-10-21", - "endDate": "2001-10-31", - "popularityRank": 145, - "ratingRank": 420, - "ageRating": "R", - "ageRatingGuide": "Ecchi", - "subtype": "manga", - "posterImage": { - "tiny": "https://media.kitsu.io/manga/poster_images/47/tiny.jpg?1434249493", - "small": "https://media.kitsu.io/manga/poster_images/47/small.jpg?1434249493", - "medium": "https://media.kitsu.io/manga/poster_images/47/medium.jpg?1434249493", - "large": "https://media.kitsu.io/manga/poster_images/47/large.jpg?1434249493", - "original": "https://media.kitsu.io/manga/poster_images/47/original.jpg?1434249493" - }, - "coverImage": { - "tiny": "https://media.kitsu.io/manga/cover_images/47/tiny.jpg?1446826380", - "small": "https://media.kitsu.io/manga/cover_images/47/small.jpg?1446826380", - "large": "https://media.kitsu.io/manga/cover_images/47/large.jpg?1446826380", - "original": "https://media.kitsu.io/manga/cover_images/47/original.jpg?1446826380" - }, - "chapterCount": 120, - "volumeCount": 14, - "serialization": "Shounen Magazine (Weekly)", - "mangaType": "manga" - }, - "relationships": { - "categories": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/categories", - "related": "https://kitsu.io/api/edge/manga/47/categories" - }, - "data": [ - { - "type": "categories", - "id": "3" - }, - { - "type": "categories", - "id": "13" - }, - { - "type": "categories", - "id": "34" - }, - { - "type": "categories", - "id": "14" - }, - { - "type": "categories", - "id": "25" - } - ] - }, - "castings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/castings", - "related": "https://kitsu.io/api/edge/manga/47/castings" - } - }, - "installments": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/installments", - "related": "https://kitsu.io/api/edge/manga/47/installments" - } - }, - "mappings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/mappings", - "related": "https://kitsu.io/api/edge/manga/47/mappings" - }, - "data": [ - { - "type": "mappings", - "id": "27633" - } - ] - }, - "reviews": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/reviews", - "related": "https://kitsu.io/api/edge/manga/47/reviews" - } - }, - "mediaRelationships": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/media-relationships", - "related": "https://kitsu.io/api/edge/manga/47/media-relationships" - } - }, - "mangaCharacters": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/manga-characters", - "related": "https://kitsu.io/api/edge/manga/47/manga-characters" - } - }, - "mangaStaff": { - "links": { - "self": "https://kitsu.io/api/edge/manga/47/relationships/manga-staff", - "related": "https://kitsu.io/api/edge/manga/47/manga-staff" - } - } - } - }, - { - "id": "11777", - "type": "manga", - "links": { - "self": "https://kitsu.io/api/edge/manga/11777" - }, - "attributes": { - "slug": "yamada-kun-to-7-nin-no-majo", - "synopsis": "Ryuu Yamada is a second-year student at Suzaku High. Ryuu is always late for school, naps in class and gets abysmal grades. His life is a dead bore. The beautiful Urara Shiraishi, on the other hand, is Suzaku High's brightest student. One day, without explanation, their bodies are swapped! Ryuu ends up in Urara's body, and Urara in Ryuu's.\r\n\r\n(Source: MU)", - "coverImageTopOffset": 75, - "titles": { - "en": "Yamada-kun and the Seven Witches", - "en_jp": "Yamada-kun to 7-nin no Majo" - }, - "canonicalTitle": "Yamada-kun to 7-nin no Majo", - "abbreviatedTitles": null, - "averageRating": 4.08701725994085, - "ratingFrequencies": { - "0.5": "3", - "1.0": "4", - "1.5": "2", - "2.0": "5", - "2.5": "20", - "3.0": "51", - "3.5": "98", - "4.0": "167", - "4.5": "146", - "5.0": "170", - "nil": "31" - }, - "favoritesCount": 156, - "startDate": "2012-02-22", - "endDate": null, - "popularityRank": 34, - "ratingRank": 156, - "ageRating": "R", - "ageRatingGuide": "Ecchi", - "subtype": "manga", - "posterImage": { - "tiny": "https://media.kitsu.io/manga/poster_images/11777/tiny.jpg?1438784325", - "small": "https://media.kitsu.io/manga/poster_images/11777/small.jpg?1438784325", - "medium": "https://media.kitsu.io/manga/poster_images/11777/medium.jpg?1438784325", - "large": "https://media.kitsu.io/manga/poster_images/11777/large.jpg?1438784325", - "original": "https://media.kitsu.io/manga/poster_images/11777/original.jpg?1438784325" - }, - "coverImage": { - "tiny": "https://media.kitsu.io/manga/cover_images/11777/tiny.jpg?1438784293", - "small": "https://media.kitsu.io/manga/cover_images/11777/small.jpg?1438784293", - "large": "https://media.kitsu.io/manga/cover_images/11777/large.jpg?1438784293", - "original": "https://media.kitsu.io/manga/cover_images/11777/original.jpg?1438784293" - }, - "chapterCount": null, - "volumeCount": 0, - "serialization": "Shounen Magazine (Weekly)", - "mangaType": "manga" - }, - "relationships": { - "categories": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/categories", - "related": "https://kitsu.io/api/edge/manga/11777/categories" - }, - "data": [ - { - "type": "categories", - "id": "3" - }, - { - "type": "categories", - "id": "9" - }, - { - "type": "categories", - "id": "13" - }, - { - "type": "categories", - "id": "24" - }, - { - "type": "categories", - "id": "45" - }, - { - "type": "categories", - "id": "14" - }, - { - "type": "categories", - "id": "25" - } - ] - }, - "castings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/castings", - "related": "https://kitsu.io/api/edge/manga/11777/castings" - } - }, - "installments": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/installments", - "related": "https://kitsu.io/api/edge/manga/11777/installments" - } - }, - "mappings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/mappings", - "related": "https://kitsu.io/api/edge/manga/11777/mappings" - }, - "data": [ - { - "type": "mappings", - "id": "19012" - } - ] - }, - "reviews": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/reviews", - "related": "https://kitsu.io/api/edge/manga/11777/reviews" - } - }, - "mediaRelationships": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/media-relationships", - "related": "https://kitsu.io/api/edge/manga/11777/media-relationships" - } - }, - "mangaCharacters": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/manga-characters", - "related": "https://kitsu.io/api/edge/manga/11777/manga-characters" - } - }, - "mangaStaff": { - "links": { - "self": "https://kitsu.io/api/edge/manga/11777/relationships/manga-staff", - "related": "https://kitsu.io/api/edge/manga/11777/manga-staff" - } - } - } - }, - { - "id": "27175", - "type": "manga", - "links": { - "self": "https://kitsu.io/api/edge/manga/27175" - }, - "attributes": { - "slug": "relife", - "synopsis": "The story follows Kaizaki Arata, a 27-year-old jobless man, who fails at every job interview he had after quitting his last company. His life changes after he met Yoake Ryou of the ReLife Research Institute, who offered him a drug that can change his appearance to 17-years-old and to become a subject in an experiment for one year. Thus, he begins his life as a high school student once more.\n\n(Source: MU)", - "coverImageTopOffset": 0, - "titles": { - "en": null, - "en_jp": "ReLIFE" - }, - "canonicalTitle": "ReLIFE", - "abbreviatedTitles": null, - "averageRating": 4.23866998116768, - "ratingFrequencies": { - "0.5": "0", - "1.0": "1", - "1.5": "1", - "2.0": "1", - "2.5": "10", - "3.0": "14", - "3.5": "41", - "4.0": "103", - "4.5": "95", - "5.0": "127", - "nil": "60" - }, - "favoritesCount": 127, - "startDate": "2013-10-12", - "endDate": null, - "popularityRank": 92, - "ratingRank": 58, - "ageRating": "PG", - "ageRatingGuide": null, - "subtype": "manga", - "posterImage": { - "tiny": "https://media.kitsu.io/manga/poster_images/27175/tiny.jpg?1464379411", - "small": "https://media.kitsu.io/manga/poster_images/27175/small.jpg?1464379411", - "medium": "https://media.kitsu.io/manga/poster_images/27175/medium.jpg?1464379411", - "large": "https://media.kitsu.io/manga/poster_images/27175/large.jpg?1464379411", - "original": "https://media.kitsu.io/manga/poster_images/27175/original.jpg?1464379411" - }, - "coverImage": { - "tiny": "https://media.kitsu.io/manga/cover_images/27175/tiny.jpg?1464379413", - "small": "https://media.kitsu.io/manga/cover_images/27175/small.jpg?1464379413", - "large": "https://media.kitsu.io/manga/cover_images/27175/large.jpg?1464379413", - "original": "https://media.kitsu.io/manga/cover_images/27175/original.jpg?1464379413" - }, - "chapterCount": null, - "volumeCount": 0, - "serialization": null, - "mangaType": "manga" - }, - "relationships": { - "categories": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/categories", - "related": "https://kitsu.io/api/edge/manga/27175/categories" - }, - "data": [ - { - "type": "categories", - "id": "24" - }, - { - "type": "categories", - "id": "16" - }, - { - "type": "categories", - "id": "14" - } - ] - }, - "castings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/castings", - "related": "https://kitsu.io/api/edge/manga/27175/castings" - } - }, - "installments": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/installments", - "related": "https://kitsu.io/api/edge/manga/27175/installments" - } - }, - "mappings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/mappings", - "related": "https://kitsu.io/api/edge/manga/27175/mappings" - }, - "data": [ - { - "type": "mappings", - "id": "19896" - } - ] - }, - "reviews": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/reviews", - "related": "https://kitsu.io/api/edge/manga/27175/reviews" - } - }, - "mediaRelationships": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/media-relationships", - "related": "https://kitsu.io/api/edge/manga/27175/media-relationships" - } - }, - "mangaCharacters": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/manga-characters", - "related": "https://kitsu.io/api/edge/manga/27175/manga-characters" - } - }, - "mangaStaff": { - "links": { - "self": "https://kitsu.io/api/edge/manga/27175/relationships/manga-staff", - "related": "https://kitsu.io/api/edge/manga/27175/manga-staff" - } - } - } - }, - { - "id": "25491", - "type": "manga", - "links": { - "self": "https://kitsu.io/api/edge/manga/25491" - }, - "attributes": { - "slug": "joshikausei", - "synopsis": "Who needs dialog when you're this cute? The beautiful (but unlucky) Momoko, the cool, collected Shibumi, and the refreshingly innocent Mayumi star in a \"silent manga.\" No speeches, no dialog! Just pictures, sound effects, and three high school girls living their daily lives.\r\n\r\n(Source: Crunchyroll)", - "coverImageTopOffset": 0, - "titles": { - "en": "Joshi Kausei", - "en_jp": "Joshikausei" - }, - "canonicalTitle": "Joshikausei", - "abbreviatedTitles": null, - "averageRating": 3.75321939030155, - "ratingFrequencies": { - "0.5": "0", - "1.0": "1", - "1.5": "0", - "2.0": "1", - "2.5": "5", - "3.0": "13", - "3.5": "17", - "4.0": "23", - "4.5": "11", - "5.0": "9", - "nil": "11" - }, - "favoritesCount": 3, - "startDate": "2013-09-27", - "endDate": null, - "popularityRank": 621, - "ratingRank": 750, - "ageRating": null, - "ageRatingGuide": null, - "subtype": "manga", - "posterImage": { - "tiny": "https://media.kitsu.io/manga/poster_images/25491/tiny.jpg?1434305043", - "small": "https://media.kitsu.io/manga/poster_images/25491/small.jpg?1434305043", - "medium": "https://media.kitsu.io/manga/poster_images/25491/medium.jpg?1434305043", - "large": "https://media.kitsu.io/manga/poster_images/25491/large.jpg?1434305043", - "original": "https://media.kitsu.io/manga/poster_images/25491/original.jpg?1434305043" - }, - "coverImage": null, - "chapterCount": null, - "volumeCount": 0, - "serialization": "Web Comic Action", - "mangaType": "manga" - }, - "relationships": { - "categories": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/categories", - "related": "https://kitsu.io/api/edge/manga/25491/categories" - }, - "data": [ - { - "type": "categories", - "id": "3" - }, - { - "type": "categories", - "id": "24" - }, - { - "type": "categories", - "id": "16" - } - ] - }, - "castings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/castings", - "related": "https://kitsu.io/api/edge/manga/25491/castings" - } - }, - "installments": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/installments", - "related": "https://kitsu.io/api/edge/manga/25491/installments" - } - }, - "mappings": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/mappings", - "related": "https://kitsu.io/api/edge/manga/25491/mappings" - }, - "data": [ - { - "type": "mappings", - "id": "29065" - } - ] - }, - "reviews": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/reviews", - "related": "https://kitsu.io/api/edge/manga/25491/reviews" - } - }, - "mediaRelationships": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/media-relationships", - "related": "https://kitsu.io/api/edge/manga/25491/media-relationships" - } - }, - "mangaCharacters": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/manga-characters", - "related": "https://kitsu.io/api/edge/manga/25491/manga-characters" - } - }, - "mangaStaff": { - "links": { - "self": "https://kitsu.io/api/edge/manga/25491/relationships/manga-staff", - "related": "https://kitsu.io/api/edge/manga/25491/manga-staff" - } - } - } - }, - { - "id": "3", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/3" - }, - "attributes": { - "title": "Comedy", - "slug": "comedy", - "description": null - } - }, - { - "id": "21", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/21" - }, - "attributes": { - "title": "Thriller", - "slug": "thriller", - "description": null - } - }, - { - "id": "24", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/24" - }, - "attributes": { - "title": "School", - "slug": "school", - "description": null - } - }, - { - "id": "16", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/16" - }, - "attributes": { - "title": "Slice of Life", - "slug": "slice-of-life", - "description": "" - } - }, - { - "id": "14", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/14" - }, - "attributes": { - "title": "Romance", - "slug": "romance", - "description": "" - } - }, - { - "id": "13", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/13" - }, - "attributes": { - "title": "Sports", - "slug": "sports", - "description": null - } - }, - { - "id": "34", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/34" - }, - "attributes": { - "title": "Harem", - "slug": "harem", - "description": null - } - }, - { - "id": "25", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/25" - }, - "attributes": { - "title": "Ecchi", - "slug": "ecchi", - "description": "" - } - }, - { - "id": "9", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/9" - }, - "attributes": { - "title": "Supernatural", - "slug": "supernatural", - "description": null - } - }, - { - "id": "45", - "type": "categories", - "links": { - "self": "https://kitsu.io/api/edge/categories/45" - }, - "attributes": { - "title": "Gender Bender", - "slug": "gender-bender", - "description": "" - } - }, - { - "id": "48014", - "type": "mappings", - "links": { - "self": "https://kitsu.io/api/edge/mappings/48014" - }, - "attributes": { - "externalSite": "myanimelist/manga", - "externalId": "26769" - }, - "relationships": { - "media": { - "links": { - "self": "https://kitsu.io/api/edge/mappings/48014/relationships/media", - "related": "https://kitsu.io/api/edge/mappings/48014/media" - } - } - } - }, - { - "id": "27633", - "type": "mappings", - "links": { - "self": "https://kitsu.io/api/edge/mappings/27633" - }, - "attributes": { - "externalSite": "myanimelist/manga", - "externalId": "16" - }, - "relationships": { - "media": { - "links": { - "self": "https://kitsu.io/api/edge/mappings/27633/relationships/media", - "related": "https://kitsu.io/api/edge/mappings/27633/media" - } - } - } - }, - { - "id": "19012", - "type": "mappings", - "links": { - "self": "https://kitsu.io/api/edge/mappings/19012" - }, - "attributes": { - "externalSite": "myanimelist/manga", - "externalId": "35003" - }, - "relationships": { - "media": { - "links": { - "self": "https://kitsu.io/api/edge/mappings/19012/relationships/media", - "related": "https://kitsu.io/api/edge/mappings/19012/media" - } - } - } - }, - { - "id": "19896", - "type": "mappings", - "links": { - "self": "https://kitsu.io/api/edge/mappings/19896" - }, - "attributes": { - "externalSite": "myanimelist/manga", - "externalId": "78523" - }, - "relationships": { - "media": { - "links": { - "self": "https://kitsu.io/api/edge/mappings/19896/relationships/media", - "related": "https://kitsu.io/api/edge/mappings/19896/media" - } - } - } - }, - { - "id": "29065", - "type": "mappings", - "links": { - "self": "https://kitsu.io/api/edge/mappings/29065" - }, - "attributes": { - "externalSite": "myanimelist/manga", - "externalId": "60815" - }, - "relationships": { - "media": { - "links": { - "self": "https://kitsu.io/api/edge/mappings/29065/relationships/media", - "related": "https://kitsu.io/api/edge/mappings/29065/media" - } - } - } - } - ], - "meta": { - "count": 5 - }, - "links": { - "first": "https://kitsu.io/api/edge/library-entries?fields%5Busers%5D=id&filter%5Bmedia_type%5D=Manga&filter%5Bstatus%5D=1&filter%5Buser_id%5D=2644&include=media%2Cmedia.categories%2Cmedia.mappings&page%5Blimit%5D=200&page%5Boffset%5D=0&sort=-updated_at", - "last": "https://kitsu.io/api/edge/library-entries?fields%5Busers%5D=id&filter%5Bmedia_type%5D=Manga&filter%5Bstatus%5D=1&filter%5Buser_id%5D=2644&include=media%2Cmedia.categories%2Cmedia.mappings&page%5Blimit%5D=200&page%5Boffset%5D=0&sort=-updated_at" + "data": { + "findProfileBySlug": { + "library": { + "all": { + "pageInfo": { + "endCursor": "Mg", + "hasNextPage": false, + "hasPreviousPage": false, + "startCursor": "MQ" + }, + "totalCount": 2, + "nodes": [ + { + "id": "15288185", + "notes": "", + "nsfw": false, + "private": false, + "progress": 94, + "progressedAt": "2020-10-12T15:52:01Z", + "rating": 16, + "reconsumeCount": 0, + "reconsuming": false, + "status": "CURRENT", + "media": { + "id": "21733", + "ageRating": null, + "ageRatingGuide": "", + "mappings": { + "nodes": [ + { + "externalId": "58091", + "externalSite": "ANILIST_MANGA" + }, + { + "externalId": "28091", + "externalSite": "MYANIMELIST_MANGA" + } + ] + }, + "posterImage": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/manga/poster_images/21733/original.jpg?1496845097", + "width": null + }, + "views": [ + { + "height": null, + "name": "tiny", + "url": "https://media.kitsu.io/manga/poster_images/21733/tiny.jpg?1496845097", + "width": null + }, + { + "height": null, + "name": "small", + "url": "https://media.kitsu.io/manga/poster_images/21733/small.jpg?1496845097", + "width": null + }, + { + "height": null, + "name": "medium", + "url": "https://media.kitsu.io/manga/poster_images/21733/medium.jpg?1496845097", + "width": null + }, + { + "height": null, + "name": "large", + "url": "https://media.kitsu.io/manga/poster_images/21733/large.jpg?1496845097", + "width": null + } + ] + }, + "sfw": true, + "slug": "tonari-no-seki-kun", + "status": "CURRENT", + "startDate": "2010-07-05", + "endDate": null, + "type": "Manga", + "titles": { + "canonical": "Tonari no Seki-kun", + "localized": { + "en": "My Neighbour Seki", + "en_jp": "Tonari no Seki-kun", + "en_us": "My Neighbour Seki", + "ja_jp": "となりの関くん" + }, + "alternatives": [] + }, + "chapterCount": null, + "volumeCount": 0, + "subtype": "MANGA" + } + }, + { + "id": "15084769", + "notes": "Wordless, and it works.", + "nsfw": false, + "private": false, + "progress": 87, + "progressedAt": "2020-08-04T13:18:45Z", + "rating": 16, + "reconsumeCount": 0, + "reconsuming": false, + "status": "CURRENT", + "media": { + "id": "25491", + "ageRating": null, + "ageRatingGuide": "", + "mappings": { + "nodes": [ + { + "externalId": "85178", + "externalSite": "ANILIST_MANGA" + }, + { + "externalId": "16567", + "externalSite": "ANIMENEWSNETWORK" + }, + { + "externalId": "60815", + "externalSite": "MYANIMELIST_MANGA" + } + ] + }, + "posterImage": { + "original": { + "height": null, + "name": "original", + "url": "https://media.kitsu.io/manga/poster_images/25491/original.jpg?1499026452", + "width": null + }, + "views": [ + { + "height": null, + "name": "tiny", + "url": "https://media.kitsu.io/manga/poster_images/25491/tiny.jpg?1499026452", + "width": null + }, + { + "height": null, + "name": "small", + "url": "https://media.kitsu.io/manga/poster_images/25491/small.jpg?1499026452", + "width": null + }, + { + "height": null, + "name": "medium", + "url": "https://media.kitsu.io/manga/poster_images/25491/medium.jpg?1499026452", + "width": null + }, + { + "height": null, + "name": "large", + "url": "https://media.kitsu.io/manga/poster_images/25491/large.jpg?1499026452", + "width": null + } + ] + }, + "sfw": true, + "slug": "joshikausei", + "status": "CURRENT", + "startDate": "2013-09-27", + "endDate": null, + "type": "Manga", + "titles": { + "canonical": "Joshikausei", + "localized": { + "en": "Joshi Kausei", + "en_jp": "Joshikausei", + "en_us": "Joshi Kausei", + "ja_jp": "女子かう生" + }, + "alternatives": [ + "Jyoshi Kausei" + ] + }, + "chapterCount": null, + "volumeCount": 0, + "subtype": "MANGA" + } + } + ] + } + } + } } } \ No newline at end of file From 0868fb43bc3d6ce17d1bdb7976a8be95cd6eae0e Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 21 Oct 2020 14:56:33 -0400 Subject: [PATCH 77/86] Add missing GraphQL query --- .../API/Kitsu/Queries/GetIdByMapping.graphql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/AnimeClient/API/Kitsu/Queries/GetIdByMapping.graphql diff --git a/src/AnimeClient/API/Kitsu/Queries/GetIdByMapping.graphql b/src/AnimeClient/API/Kitsu/Queries/GetIdByMapping.graphql new file mode 100644 index 00000000..172f8141 --- /dev/null +++ b/src/AnimeClient/API/Kitsu/Queries/GetIdByMapping.graphql @@ -0,0 +1,20 @@ +query ( + $id: ID!, + $site: MappingExternalSiteEnum!, +) { + lookupMapping(externalSite: $site, externalId: $id) { + __typename, + ...on Anime { + id + } + ...on Manga { + id + } + ...on Character { + id + } + ...on Person { + id + } + } +} \ No newline at end of file From b28e1f13ee3a9c3de4b4e856b9b4bc147f473493 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 21 Oct 2020 15:02:25 -0400 Subject: [PATCH 78/86] Remove old transformer classes --- src/AnimeClient/API/Kitsu/AnimeTrait.php | 9 - src/AnimeClient/API/Kitsu/MangaTrait.php | 6 - src/AnimeClient/API/Kitsu/Model.php | 4 - .../Transformer/OldAnimeListTransformer.php | 156 ------------------ .../Transformer/OldMangaListTransformer.php | 148 ----------------- src/AnimeClient/Controller/Anime.php | 4 +- src/AnimeClient/Controller/Manga.php | 4 +- 7 files changed, 4 insertions(+), 327 deletions(-) delete mode 100644 src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php delete mode 100644 src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php diff --git a/src/AnimeClient/API/Kitsu/AnimeTrait.php b/src/AnimeClient/API/Kitsu/AnimeTrait.php index 04141df2..88414035 100644 --- a/src/AnimeClient/API/Kitsu/AnimeTrait.php +++ b/src/AnimeClient/API/Kitsu/AnimeTrait.php @@ -21,7 +21,6 @@ use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeHistoryTransformer; -use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer; use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; use Aviat\AnimeClient\API\ParallelAPIRequest; @@ -34,14 +33,6 @@ use Aviat\Ion\Json; * Anime-related list methods */ trait AnimeTrait { - /** - * Class to map anime list items - * to a common format used by - * templates - * - * @var OldAnimeListTransformer - */ - protected OldAnimeListTransformer $oldListTransformer; /** * @var AnimeTransformer diff --git a/src/AnimeClient/API/Kitsu/MangaTrait.php b/src/AnimeClient/API/Kitsu/MangaTrait.php index 67406bbd..53c5d8e3 100644 --- a/src/AnimeClient/API/Kitsu/MangaTrait.php +++ b/src/AnimeClient/API/Kitsu/MangaTrait.php @@ -21,7 +21,6 @@ use Aviat\AnimeClient\Kitsu as K; use Aviat\AnimeClient\API\Enum\MangaReadingStatus\Kitsu as KitsuReadingStatus; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaHistoryTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; -use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; use Aviat\AnimeClient\API\Mapping\MangaReadingStatus; use Aviat\AnimeClient\API\ParallelAPIRequest; @@ -39,11 +38,6 @@ trait MangaTrait { */ protected MangaTransformer $mangaTransformer; - /** - * @var OldMangaListTransformer - */ - protected OldMangaListTransformer $mangaListTransformer; - // ------------------------------------------------------------------------- // ! Manga-specific methods // ------------------------------------------------------------------------- diff --git a/src/AnimeClient/API/Kitsu/Model.php b/src/AnimeClient/API/Kitsu/Model.php index bfcfe0e3..7817bd82 100644 --- a/src/AnimeClient/API/Kitsu/Model.php +++ b/src/AnimeClient/API/Kitsu/Model.php @@ -29,10 +29,8 @@ use Aviat\AnimeClient\API\{ }; use Aviat\AnimeClient\API\Kitsu\Transformer\{ AnimeTransformer, - OldAnimeListTransformer, LibraryEntryTransformer, MangaTransformer, - OldMangaListTransformer }; use Aviat\Banker\Exception\InvalidArgumentException; @@ -66,9 +64,7 @@ final class Model { public function __construct(ListItem $listItem) { $this->animeTransformer = new AnimeTransformer(); - $this->oldListTransformer = new OldAnimeListTransformer(); $this->mangaTransformer = new MangaTransformer(); - $this->mangaListTransformer = new OldMangaListTransformer(); $this->listItem = $listItem; } diff --git a/src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php deleted file mode 100644 index 0268eb16..00000000 --- a/src/AnimeClient/API/Kitsu/Transformer/OldAnimeListTransformer.php +++ /dev/null @@ -1,156 +0,0 @@ - - * @copyright 2015 - 2020 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 5.1 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\API\Kitsu\Transformer; - -use Aviat\AnimeClient\Kitsu; -use Aviat\AnimeClient\Types\{ - FormItem, - AnimeListItem -}; -use Aviat\Ion\Transformer\AbstractTransformer; -use Aviat\Ion\Type\StringType; - -/** - * Transformer for anime list - */ -final class OldAnimeListTransformer extends AbstractTransformer { - - /** - * Convert raw api response to a more - * logical and workable structure - * - * @param array $item API library item - * @return AnimeListItem - */ - public function transform($item): AnimeListItem - { - $included = $item['included']; - $animeId = $item['relationships']['media']['data']['id']; - $anime = $included['anime'][$animeId]; - - $genres = []; - - foreach($anime['relationships']['categories'] as $genre) - { - $genres[] = $genre['title']; - } - - sort($genres); - - $rating = (int) $item['attributes']['ratingTwenty'] !== 0 - ? $item['attributes']['ratingTwenty'] / 2 - : '-'; - - $total_episodes = array_key_exists('episodeCount', $anime) && (int) $anime['episodeCount'] !== 0 - ? (int) $anime['episodeCount'] - : '-'; - - $MALid = NULL; - - if (array_key_exists('mappings', $anime['relationships'])) - { - foreach ($anime['relationships']['mappings'] as $mapping) - { - if ($mapping['externalSite'] === 'myanimelist/anime') - { - $MALid = $mapping['externalId']; - break; - } - } - } - - $streamingLinks = array_key_exists('streamingLinks', $anime['relationships']) - ? Kitsu::parseListItemStreamingLinks($included, $animeId) - : []; - - $titles = Kitsu::filterTitles($anime); - $title = array_shift($titles); - - return AnimeListItem::from([ - 'id' => $item['id'], - 'mal_id' => $MALid, - 'episodes' => [ - 'watched' => (int) $item['attributes']['progress'] !== 0 - ? (int) $item['attributes']['progress'] - : '-', - 'total' => $total_episodes, - 'length' => $anime['episodeLength'], - ], - 'airing' => [ - 'status' => Kitsu::getAiringStatus($anime['startDate'], $anime['endDate']), - 'started' => $anime['startDate'], - 'ended' => $anime['endDate'] - ], - 'anime' => [ - 'id' => $animeId, - 'age_rating' => $anime['ageRating'], - 'title' => $title, - 'titles' => $titles, - 'slug' => $anime['slug'], - 'show_type' => (string)StringType::from($anime['subtype'])->upperCaseFirst(), - 'cover_image' => $anime['posterImage']['small'], - 'genres' => $genres, - 'streaming_links' => $streamingLinks, - ], - 'watching_status' => $item['attributes']['status'], - 'notes' => $item['attributes']['notes'], - 'rewatching' => (bool) $item['attributes']['reconsuming'], - 'rewatched' => (int) $item['attributes']['reconsumeCount'], - 'user_rating' => $rating, - 'private' => $item['attributes']['private'] ?? FALSE, - ]); - } - - /** - * Convert transformed data to - * api response format - * - * @param array $item Transformed library item - * @return FormItem API library item - */ - public function untransform($item): FormItem - { - $privacy = (array_key_exists('private', $item) && $item['private']); - $rewatching = (array_key_exists('rewatching', $item) && $item['rewatching']); - - $untransformed = FormItem::from([ - 'id' => $item['id'], - 'anilist_item_id' => $item['anilist_item_id'] ?? NULL, - 'mal_id' => $item['mal_id'] ?? NULL, - 'data' => [ - 'status' => $item['watching_status'], - 'reconsuming' => $rewatching, - 'reconsumeCount' => $item['rewatched'], - 'notes' => $item['notes'], - 'private' => $privacy - ] - ]); - - if (is_numeric($item['episodes_watched']) && $item['episodes_watched'] > 0) - { - $untransformed['data']['progress'] = (int) $item['episodes_watched']; - } - - if (is_numeric($item['user_rating']) && $item['user_rating'] > 0) - { - $untransformed['data']['ratingTwenty'] = $item['user_rating'] * 2; - } - - return $untransformed; - } -} -// End of AnimeListTransformer.php \ No newline at end of file diff --git a/src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php deleted file mode 100644 index 4f645f23..00000000 --- a/src/AnimeClient/API/Kitsu/Transformer/OldMangaListTransformer.php +++ /dev/null @@ -1,148 +0,0 @@ - - * @copyright 2015 - 2020 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 5.1 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\API\Kitsu\Transformer; - -use Aviat\AnimeClient\Kitsu; -use Aviat\AnimeClient\Types\{ - FormItem, FormItemData, - MangaListItem, MangaListItemDetail -}; -use Aviat\Ion\Transformer\AbstractTransformer; -use Aviat\Ion\Type\StringType; - -/** - * Data transformation class for zippered Hummingbird manga - */ -final class OldMangaListTransformer extends AbstractTransformer { - /** - * Remap zipped anime data to a more logical form - * - * @param array $item manga entry item - * @return MangaListItem - */ - public function transform($item): MangaListItem - { - $included = $item['included']; - $mangaId = $item['relationships']['media']['data']['id']; - $manga = $included['manga'][$mangaId]; - - $genres = []; - - foreach ($manga['relationships']['categories'] as $genre) - { - $genres[] = $genre['title']; - } - - sort($genres); - - $rating = (int) $item['attributes']['ratingTwenty'] !== 0 - ? $item['attributes']['ratingTwenty'] / 2 - : '-'; - - $totalChapters = ((int) $manga['chapterCount'] !== 0) - ? $manga['chapterCount'] - : '-'; - - $totalVolumes = ((int) $manga['volumeCount'] !== 0) - ? $manga['volumeCount'] - : '-'; - - $readChapters = ((int) $item['attributes']['progress'] !== 0) - ? $item['attributes']['progress'] - : '-'; - - $MALid = NULL; - - if (array_key_exists('mappings', $manga['relationships'])) - { - foreach ($manga['relationships']['mappings'] as $mapping) - { - if ($mapping['externalSite'] === 'myanimelist/manga') - { - $MALid = $mapping['externalId']; - break; - } - } - } - - $titles = Kitsu::filterTitles($manga); - $title = array_shift($titles); - - return MangaListItem::from([ - 'id' => $item['id'], - 'mal_id' => $MALid, - 'chapters' => [ - 'read' => $readChapters, - 'total' => $totalChapters - ], - 'volumes' => [ - 'read' => '-', //$item['attributes']['volumes_read'], - 'total' => $totalVolumes - ], - 'manga' => MangaListItemDetail::from([ - 'genres' => $genres, - 'id' => $mangaId, - 'image' => $manga['posterImage']['small'], - 'slug' => $manga['slug'], - 'title' => $title, - 'titles' => $titles, - 'type' => (string)StringType::from($manga['subtype'])->upperCaseFirst(), - 'url' => 'https://kitsu.io/manga/' . $manga['slug'], - ]), - 'reading_status' => $item['attributes']['status'], - 'notes' => $item['attributes']['notes'], - 'rereading' => (bool)$item['attributes']['reconsuming'], - 'reread' => $item['attributes']['reconsumeCount'], - 'user_rating' => $rating, - ]); - } - - /** - * Untransform data to update the api - * - * @param array $item - * @return FormItem - */ - public function untransform($item): FormItem - { - $rereading = array_key_exists('rereading', $item) && (bool)$item['rereading']; - - $map = FormItem::from([ - 'id' => $item['id'], - 'mal_id' => $item['mal_id'], - 'data' => FormItemData::from([ - 'status' => $item['status'], - 'reconsuming' => $rereading, - 'reconsumeCount' => (int)$item['reread_count'], - 'notes' => $item['notes'], - ]), - ]); - - if (is_numeric($item['chapters_read']) && $item['chapters_read'] > 0) - { - $map['data']['progress'] = (int)$item['chapters_read']; - } - - if (is_numeric($item['new_rating']) && $item['new_rating'] > 0) - { - $map['data']['ratingTwenty'] = $item['new_rating'] * 2; - } - - return $map; - } -} -// End of MangaListTransformer.php \ No newline at end of file diff --git a/src/AnimeClient/Controller/Anime.php b/src/AnimeClient/Controller/Anime.php index 1a5e17dc..41326edc 100644 --- a/src/AnimeClient/Controller/Anime.php +++ b/src/AnimeClient/Controller/Anime.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient\Controller; use Aura\Router\Exception\RouteNotFound; use Aviat\AnimeClient\Controller as BaseController; -use Aviat\AnimeClient\API\Kitsu\Transformer\OldAnimeListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Kitsu as KitsuWatchingStatus; use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus; use Aviat\AnimeClient\Model\Anime as AnimeModel; @@ -228,7 +228,7 @@ final class Anime extends BaseController { // Do some minor data manipulation for // large form-based updates - $transformer = new OldAnimeListTransformer(); + $transformer = new AnimeListTransformer(); $postData = $transformer->untransform($data); $fullResult = $this->model->updateLibraryItem(FormItem::from($postData)); diff --git a/src/AnimeClient/Controller/Manga.php b/src/AnimeClient/Controller/Manga.php index 55cb03ab..824d474f 100644 --- a/src/AnimeClient/Controller/Manga.php +++ b/src/AnimeClient/Controller/Manga.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient\Controller; use Aura\Router\Exception\RouteNotFound; use Aviat\AnimeClient\Controller; -use Aviat\AnimeClient\API\Kitsu\Transformer\OldMangaListTransformer; +use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; use Aviat\AnimeClient\API\Mapping\MangaReadingStatus; use Aviat\AnimeClient\Model\Manga as MangaModel; use Aviat\AnimeClient\Types\FormItem; @@ -229,7 +229,7 @@ final class Manga extends Controller { // Do some minor data manipulation for // large form-based updates - $transformer = new OldMangaListTransformer(); + $transformer = new MangaListTransformer(); $post_data = $transformer->untransform($data); $full_result = $this->model->updateLibraryItem(FormItem::from($post_data)); From 23d9fd0b40f1eef919f35a6f84ffb5befc51add2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 21 Oct 2020 15:45:30 -0400 Subject: [PATCH 79/86] Use GraphQL search endpoints, see #33 --- frontEndSrc/js/anime.js | 2 +- frontEndSrc/js/manga.js | 2 +- frontEndSrc/js/template-helpers.js | 26 +++++----- public/es/scripts.js | 30 ++++++----- public/js/scripts.min.js | 25 +++++----- public/js/scripts.min.js.map | 2 +- src/AnimeClient/API/Kitsu/Model.php | 50 +++++++++---------- .../API/Kitsu/Queries/SearchAnime.graphql | 19 +++++++ .../API/Kitsu/Queries/SearchManga.graphql | 19 +++++++ src/AnimeClient/API/Kitsu/RequestBuilder.php | 2 + 10 files changed, 106 insertions(+), 71 deletions(-) create mode 100644 src/AnimeClient/API/Kitsu/Queries/SearchAnime.graphql create mode 100644 src/AnimeClient/API/Kitsu/Queries/SearchManga.graphql diff --git a/frontEndSrc/js/anime.js b/frontEndSrc/js/anime.js index 3d92af9e..c0a7fad3 100644 --- a/frontEndSrc/js/anime.js +++ b/frontEndSrc/js/anime.js @@ -13,7 +13,7 @@ const search = (query) => { _.hide('.cssload-loader'); // Show the results - _.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults.data); + _.$('#series-list')[ 0 ].innerHTML = renderAnimeSearchResults(searchResults); }); }; diff --git a/frontEndSrc/js/manga.js b/frontEndSrc/js/manga.js index f46460fe..cb8ad8a7 100644 --- a/frontEndSrc/js/manga.js +++ b/frontEndSrc/js/manga.js @@ -6,7 +6,7 @@ const search = (query) => { return _.get(_.url('/manga/search'), { query }, (searchResults, status) => { searchResults = JSON.parse(searchResults); _.hide('.cssload-loader'); - _.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults.data); + _.$('#series-list')[ 0 ].innerHTML = renderMangaSearchResults(searchResults); }); }; diff --git a/frontEndSrc/js/template-helpers.js b/frontEndSrc/js/template-helpers.js index caf054b3..14ee6650 100644 --- a/frontEndSrc/js/template-helpers.js +++ b/frontEndSrc/js/template-helpers.js @@ -10,20 +10,19 @@ _.on('main', 'change', '.big-check', (e) => { export function renderAnimeSearchResults (data) { const results = []; - data.forEach(x => { - const item = x.attributes; + data.forEach(item => { const titles = item.titles.join('
'); results.push(`