Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
2 changed files with 9 additions and 3 deletions
Showing only changes of commit c23001e7b1 - Show all commits

View File

@ -44,6 +44,7 @@ use Aviat\Ion\{
use Generator; use Generator;
use function Amp\Promise\wait; use function Amp\Promise\wait;
use function Aviat\AnimeClient\getApiClient; use function Aviat\AnimeClient\getApiClient;
use const Aviat\AnimeClient\SESSION_SEGMENT;
/** /**
* Kitsu API Model * Kitsu API Model
@ -707,9 +708,14 @@ final class Model {
$rawData = Json::decode($json); $rawData = Json::decode($json);
$data = $rawData['data']['findProfileBySlug']['library']['all'] ?? []; $data = $rawData['data']['findProfileBySlug']['library']['all'] ?? [];
$page = $data['pageInfo']; $page = $data['pageInfo'] ?? [];
if (empty($data)) if (empty($data))
{ {
// Clear session, in case the error is an invalid token.
$segment = $this->container->get('session')
->getSegment(SESSION_SEGMENT);
$segment->clear();
// @TODO Proper Error logging // @TODO Proper Error logging
dump($rawData); dump($rawData);
die(); die();
@ -719,7 +725,7 @@ final class Model {
yield $emit($data['nodes']); yield $emit($data['nodes']);
if ($page['hasNextPage'] === FALSE) if ($page['hasNextPage'] !== TRUE)
{ {
break; break;
} }

View File

@ -136,7 +136,7 @@ final class AnimeTransformer extends AbstractTransformer {
'show_type' => $base['subtype'], 'show_type' => $base['subtype'],
'status' => Kitsu::getAiringStatus($base['startDate'], $base['endDate']), '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'], 'synopsis' => $base['description']['en'] ?? '',
'title' => $title, 'title' => $title,
'titles' => $titles, 'titles' => $titles,
'titles_more' => $titles_more, 'titles_more' => $titles_more,