Version 5.1 - All the GraphQL #32

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

View File

@ -30,6 +30,12 @@ query ($slug: String!) {
canonical
localized
}
...on Anime {
episodeCount
}
...on Manga {
chapterCount
}
}
updatedAt
}

View File

@ -65,6 +65,7 @@ abstract class HistoryTransformer {
foreach ($base as $entry)
{
// Filter out other media types
if (strtolower($entry['media']['__typename']) !== $this->type)
{
continue;
@ -195,6 +196,19 @@ abstract class HistoryTransformer {
return NULL;
}
// Hide the last episode update (Anime)
foreach (['episodeCount', 'chapterCount'] as $count)
{
if ( ! empty($entry['media'][$count]))
{
$update = $entry['changedData']['progress'][1] ?? 0;
if ($update === $entry['media'][$count])
{
return NULL;
}
}
}
$action = ($this->isReconsuming($entry))
? "{$this->reconsumeAction} {$item}"
: "{$this->progressAction} {$item}";