diff --git a/src/API/Backend/Webhooks.php b/src/API/Backend/Webhooks.php index 2d825a4d..ead7cce4 100644 --- a/src/API/Backend/Webhooks.php +++ b/src/API/Backend/Webhooks.php @@ -208,7 +208,8 @@ final class Webhooks $this->cache->set('requests', $items, new DateInterval('P3D')); - if (false === $metadataOnly && true === $entity->hasPlayProgress() && !$entity->isWatched()) { + $pEnabled = (bool)env('WS_CRON_PROGRESS', false); + if ($pEnabled && false === $metadataOnly && true === $entity->hasPlayProgress() && !$entity->isWatched()) { $progress = $this->cache->get('progress', []); $progress[str_replace($itemId, ':tainted@', ':untainted@')] = $entity; $this->cache->set('progress', $progress, new DateInterval('P3D')); @@ -223,7 +224,7 @@ final class Webhooks 'type' => $entity->type, 'played' => $entity->isWatched() ? 'Yes' : 'No', 'queue_id' => $itemId, - 'progress' => $entity->hasPlayProgress() ? $entity->getPlayProgress() : null, + 'progress' => $pEnabled && $entity->hasPlayProgress() ? $entity->getPlayProgress() : null, ] ] ); diff --git a/src/Libs/Mappers/Import/DirectMapper.php b/src/Libs/Mappers/Import/DirectMapper.php index f95c85fc..f9ce2e0d 100644 --- a/src/Libs/Mappers/Import/DirectMapper.php +++ b/src/Libs/Mappers/Import/DirectMapper.php @@ -740,7 +740,7 @@ final class DirectMapper implements iImport */ public function commit(): array { - if (count($this->progressItems) >= 1) { + if (true === (bool)env('WS_CRON_PROGRESS', false) && count($this->progressItems) >= 1) { try { $progress = $this->cache->get('progress', []); foreach ($this->progressItems as $itemId => $entity) { diff --git a/src/Libs/Mappers/Import/MemoryMapper.php b/src/Libs/Mappers/Import/MemoryMapper.php index 097a7c1a..3cf9cda4 100644 --- a/src/Libs/Mappers/Import/MemoryMapper.php +++ b/src/Libs/Mappers/Import/MemoryMapper.php @@ -543,7 +543,7 @@ final class MemoryMapper implements iImport public function commit(): mixed { if (true !== $this->inDryRunMode()) { - if (count($this->progressItems) >= 1) { + if (true === (bool)env('WS_CRON_PROGRESS', false) && count($this->progressItems) >= 1) { try { $progress = $this->cache->get('progress', []); foreach ($this->progressItems as $itemId => $entity) {