4.1 Beta...ish #12

Merged
timw4mail merged 88 commits from develop into master 2018-11-05 13:15:59 -05:00
2 changed files with 23 additions and 24 deletions
Showing only changes of commit 14be365a16 - Show all commits

View File

@ -45,17 +45,17 @@ final class Kitsu {
$isDoneAiring = $now > $endAirDate;
$isCurrentlyAiring = ($now > $startAirDate) && ! $isDoneAiring;
switch (TRUE)
if ($isCurrentlyAiring)
{
case $isCurrentlyAiring:
return AnimeAiringStatus::AIRING;
case $isDoneAiring:
return AnimeAiringStatus::FINISHED_AIRING;
default:
return AnimeAiringStatus::NOT_YET_AIRED;
return AnimeAiringStatus::AIRING;
}
if ($isDoneAiring)
{
return AnimeAiringStatus::FINISHED_AIRING;
}
return AnimeAiringStatus::NOT_YET_AIRED;
}
/**

View File

@ -839,23 +839,22 @@ final class Model {
$baseData = $this->listItem->get($listId);
$included = JsonAPI::organizeIncludes($baseData['included']);
switch (TRUE)
if (array_key_exists('anime', $included))
{
case array_key_exists('anime', $included): // in_array('anime', array_keys($included)):
$included = JsonAPI::inlineIncludedRelationships($included, 'anime');
$baseData['data']['included'] = $included;
return $this->animeListTransformer->transform($baseData['data']);
case array_key_exists('manga', $included): // in_array('manga', array_keys($included)):
$included = JsonAPI::inlineIncludedRelationships($included, 'manga');
$baseData['data']['included'] = $included;
$baseData['data']['manga'] = $baseData['included'][0];
return $this->mangaListTransformer->transform($baseData['data']);
default:
return $baseData['data'];
$included = JsonAPI::inlineIncludedRelationships($included, 'anime');
$baseData['data']['included'] = $included;
return $this->animeListTransformer->transform($baseData['data']);
}
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'];
}
/**