Skip to content

Commit e4ad67d

Browse files
committed
Prevent endless progress update loop.
1 parent a3b134b commit e4ad67d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Listeners/ProcessProgressEvent.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,15 @@ public function __invoke(DataEvent $e): DataEvent
6060
return $e;
6161
}
6262

63+
// -- prevent endless loop.
64+
if ($item->hasPlayProgress() && ($item->getPlayProgress() + 30) > $entity->getPlayProgress()) {
65+
return $e;
66+
}
67+
6368
$item = $item->apply($entity);
6469

6570
if (!$item->hasPlayProgress()) {
66-
$writer(Level::Notice, "Item '{title}' has no watch progress to export.", ['title' => $item->title]);
71+
$writer(Level::Info, "Item '{title}' has no watch progress to export.", ['title' => $item->title]);
6772
return $e;
6873
}
6974

0 commit comments

Comments
 (0)