aboutsummaryrefslogtreecommitdiff
path: root/app/Models/FeedDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-06-16 16:11:16 +0200
committerGravatar GitHub <noreply@github.com> 2023-06-16 16:11:16 +0200
commit723f7577d0a388a90779930754c5aacb9f66b168 (patch)
treeaa863f67592d0795be83b533de981082e0713601 /app/Models/FeedDAO.php
parent228d7adfdb90c3fdd179f80fbfde565eb06e0cec (diff)
Refactor lastSeen and markReadAsGone (#5470)
* Refactor lastSeen and markReadAsGone Make the logic a bit more robust and explicit * Remove forgotten SQL param * Add test inTransaction * More robust transaction * Add a debug log * Add max timestamp to markAsReadUponGone * Reduce number of debug lines * typing * Better detection of when feed is empty * More explicit case for push
Diffstat (limited to 'app/Models/FeedDAO.php')
-rw-r--r--app/Models/FeedDAO.php4
1 files changed, 0 insertions, 4 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index ec51486a6..b9295abe0 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -503,16 +503,12 @@ WHERE id_feed=:id_feed1 AND is_read=0 AND (
`lastSeen` + 60 < (SELECT s1.maxlastseen FROM (
SELECT MAX(e2.`lastSeen`) AS maxlastseen FROM `_entry` e2 WHERE e2.id_feed = :id_feed2
) s1)
- OR `lastSeen` + 60 < (SELECT s2.lastcorrectupdate FROM (
- SELECT f2.`lastUpdate` AS lastcorrectupdate FROM `_feed` f2 WHERE f2.id = :id_feed3 AND f2.error = 0
- ) s2)
)
SQL;
if (($stm = $this->pdo->prepare($sql)) &&
$stm->bindParam(':id_feed1', $id, PDO::PARAM_INT) &&
$stm->bindParam(':id_feed2', $id, PDO::PARAM_INT) &&
- $stm->bindParam(':id_feed3', $id, PDO::PARAM_INT) &&
$stm->execute()) {
return $stm->rowCount();
} else {