4
0

update 2023-06-22 10:54:57

This commit is contained in:
Robot 2023-06-22 10:54:57 +02:00
parent 82bd393f95
commit 52551e8b9a
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
2 changed files with 18 additions and 10 deletions

View File

@ -216,10 +216,10 @@ final class Watcher
// we load the next chapter // we load the next chapter
$next = $chapter + 1; $next = $chapter + 1;
// check if this books has this next chapter // 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], ['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $next],
'sha', 'chapter' 'sha', 'chapter'
)) !== null) ))
{ {
return $next; return $next;
} }
@ -432,7 +432,7 @@ final class Watcher
// check if we have values to insert // check if we have values to insert
if ($insert !== []) if ($insert !== [])
{ {
$this->insert->items($insert, 'verse') $this->insert->items($insert, 'verse');
} }
// update the local verses // update the local verses
@ -507,8 +507,12 @@ final class Watcher
private function hold(): bool private function hold(): bool
{ {
// Create DateTime objects from the strings // Create DateTime objects from the strings
$today = new \DateTime($this->today); try {
$created = new \DateTime($this->verse->created); $today = new \DateTime($this->today);
$created = new \DateTime($this->verse->created);
} catch (\Exception $e) {
return false;
}
// Calculate the difference // Calculate the difference
$interval = $today->diff($created); $interval = $today->diff($created);

View File

@ -185,10 +185,10 @@
// we load the next chapter // we load the next chapter
$next = $chapter + 1; $next = $chapter + 1;
// check if this books has this next chapter // 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], ['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $next],
'sha', 'chapter' 'sha', 'chapter'
)) !== null) ))
{ {
return $next; return $next;
} }
@ -401,7 +401,7 @@
// check if we have values to insert // check if we have values to insert
if ($insert !== []) if ($insert !== [])
{ {
$this->insert->items($insert, 'verse') $this->insert->items($insert, 'verse');
} }
// update the local verses // update the local verses
@ -476,8 +476,12 @@
private function hold(): bool private function hold(): bool
{ {
// Create DateTime objects from the strings // Create DateTime objects from the strings
$today = new \DateTime($this->today); try {
$created = new \DateTime($this->verse->created); $today = new \DateTime($this->today);
$created = new \DateTime($this->verse->created);
} catch (\Exception $e) {
return false;
}
// Calculate the difference // Calculate the difference
$interval = $today->diff($created); $interval = $today->diff($created);