From 52551e8b9a7df6c756b813a06660cd29749f9676 Mon Sep 17 00:00:00 2001 From: aB0t Date: Thu, 22 Jun 2023 10:54:57 +0200 Subject: [PATCH] update 2023-06-22 10:54:57 --- src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php | 14 +++++++++----- .../code.power | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php index 3857d56..8671033 100644 --- a/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php +++ b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php @@ -216,10 +216,10 @@ final class Watcher // we load the next chapter $next = $chapter + 1; // check if this books has this next chapter - if (($force || !$this->fresh) && ($chapter_sha = $this->load->value( + if (($force || !$this->fresh) && $this->load->value( ['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $next], 'sha', 'chapter' - )) !== null) + )) { return $next; } @@ -432,7 +432,7 @@ final class Watcher // check if we have values to insert if ($insert !== []) { - $this->insert->items($insert, 'verse') + $this->insert->items($insert, 'verse'); } // update the local verses @@ -507,8 +507,12 @@ final class Watcher private function hold(): bool { // Create DateTime objects from the strings - $today = new \DateTime($this->today); - $created = new \DateTime($this->verse->created); + try { + $today = new \DateTime($this->today); + $created = new \DateTime($this->verse->created); + } catch (\Exception $e) { + return false; + } // Calculate the difference $interval = $today->diff($created); diff --git a/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power index 5ec8f24..6ba61bb 100644 --- a/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power +++ b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power @@ -185,10 +185,10 @@ // we load the next chapter $next = $chapter + 1; // check if this books has this next chapter - if (($force || !$this->fresh) && ($chapter_sha = $this->load->value( + if (($force || !$this->fresh) && $this->load->value( ['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $next], 'sha', 'chapter' - )) !== null) + )) { return $next; } @@ -401,7 +401,7 @@ // check if we have values to insert if ($insert !== []) { - $this->insert->items($insert, 'verse') + $this->insert->items($insert, 'verse'); } // update the local verses @@ -476,8 +476,12 @@ private function hold(): bool { // Create DateTime objects from the strings - $today = new \DateTime($this->today); - $created = new \DateTime($this->verse->created); + try { + $today = new \DateTime($this->today); + $created = new \DateTime($this->verse->created); + } catch (\Exception $e) { + return false; + } // Calculate the difference $interval = $today->diff($created);