From 01be02af72ad0938e4f9d620cef16f01b3dbda31 Mon Sep 17 00:00:00 2001 From: "Abdulmhsen B. A. A" Date: Thu, 26 May 2022 21:34:30 +0300 Subject: [PATCH] Do not commit backend cache changes if dry run mode is set. --- src/Libs/Servers/JellyfinServer.php | 4 ++++ src/Libs/Servers/PlexServer.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Libs/Servers/JellyfinServer.php b/src/Libs/Servers/JellyfinServer.php index 5bd487fb..3c7c7fd6 100644 --- a/src/Libs/Servers/JellyfinServer.php +++ b/src/Libs/Servers/JellyfinServer.php @@ -1002,6 +1002,10 @@ class JellyfinServer implements ServerInterface */ public function __destruct() { + if (true === (bool)ag($this->options, Options::DRY_RUN)) { + return; + } + if (!empty($this->cacheKey) && !empty($this->cache) && true === $this->initialized) { $this->cacheIO->set($this->cacheKey, $this->cache, new DateInterval('P3D')); } diff --git a/src/Libs/Servers/PlexServer.php b/src/Libs/Servers/PlexServer.php index 79454ae8..685fcc7e 100644 --- a/src/Libs/Servers/PlexServer.php +++ b/src/Libs/Servers/PlexServer.php @@ -1031,6 +1031,10 @@ class PlexServer implements ServerInterface */ public function __destruct() { + if (true === (bool)ag($this->options, Options::DRY_RUN)) { + return; + } + if (!empty($this->cacheKey) && !empty($this->cache) && true === $this->initialized) { $this->cacheIO->set($this->cacheKey, $this->cache, new DateInterval('P3D')); }