Remove redundant updates on finishing a media item
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/head This commit looks good
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/head This commit looks good
This commit is contained in:
parent
81cffb9f4c
commit
f9eb3e137d
@ -30,6 +30,12 @@ query ($slug: String!) {
|
|||||||
canonical
|
canonical
|
||||||
localized
|
localized
|
||||||
}
|
}
|
||||||
|
...on Anime {
|
||||||
|
episodeCount
|
||||||
|
}
|
||||||
|
...on Manga {
|
||||||
|
chapterCount
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ abstract class HistoryTransformer {
|
|||||||
|
|
||||||
foreach ($base as $entry)
|
foreach ($base as $entry)
|
||||||
{
|
{
|
||||||
|
// Filter out other media types
|
||||||
if (strtolower($entry['media']['__typename']) !== $this->type)
|
if (strtolower($entry['media']['__typename']) !== $this->type)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -195,6 +196,19 @@ abstract class HistoryTransformer {
|
|||||||
return NULL;
|
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))
|
$action = ($this->isReconsuming($entry))
|
||||||
? "{$this->reconsumeAction} {$item}"
|
? "{$this->reconsumeAction} {$item}"
|
||||||
: "{$this->progressAction} {$item}";
|
: "{$this->progressAction} {$item}";
|
||||||
|
Loading…
Reference in New Issue
Block a user