aboutsummaryrefslogtreecommitdiff
path: root/app/Models/FeedDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-12-03 19:52:02 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-03 19:52:02 +0100
commitf0d4f2762d2b74eeadf2fb64ff83039b5cc16c26 (patch)
treeebdb0bcffeb4370d1fa08defe7313dbf5f02e47a /app/Models/FeedDAO.php
parenteb2c2d9a01ba54865b944f75d8436f933ed3ebfc (diff)
Rework keepmax (#5905)
* Rework keepmax fix https://github.com/FreshRSS/FreshRSS/issues/5702 fix https://github.com/FreshRSS/FreshRSS/issues/5870 * More WIP * Minor progress * Progress * Beta * Improved debug message * Revert noCommit * Fix variable reset * Remove debug syslogs
Diffstat (limited to 'app/Models/FeedDAO.php')
-rw-r--r--app/Models/FeedDAO.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index 82e33dd84..055ec60e4 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -373,7 +373,7 @@ SQL;
* @return array<FreshRSS_Feed>
*/
public function listFeedsOrderUpdate(int $defaultCacheDuration = 3600, int $limit = 0): array {
- $sql = 'SELECT id, url, kind, name, website, `lastUpdate`, `pathEntries`, `httpAuth`, ttl, attributes '
+ $sql = 'SELECT id, url, kind, name, website, `lastUpdate`, `pathEntries`, `httpAuth`, ttl, attributes, `cache_nbEntries`, `cache_nbUnreads` '
. 'FROM `_feed` '
. ($defaultCacheDuration < 0 ? '' : 'WHERE ttl >= ' . FreshRSS_Feed::TTL_DEFAULT
. ' AND `lastUpdate` < (' . (time() + 60)
@@ -468,7 +468,7 @@ SQL;
* Remember to call updateCachedValues() after calling this function
* @return int|false number of lines affected or false in case of error
*/
- public function keepMaxUnread(int $id, int $n) {
+ public function markAsReadMaxUnread(int $id, int $n) {
//Double SELECT for MySQL workaround ERROR 1093 (HY000)
$sql = <<<'SQL'
UPDATE `_entry` SET is_read=1
@@ -610,8 +610,8 @@ SQL;
$myFeed->_error($dao['error'] ?? 0);
$myFeed->_ttl($dao['ttl'] ?? FreshRSS_Feed::TTL_DEFAULT);
$myFeed->_attributes('', $dao['attributes'] ?? '');
- $myFeed->_nbNotRead($dao['cache_nbUnreads'] ?? 0);
- $myFeed->_nbEntries($dao['cache_nbEntries'] ?? 0);
+ $myFeed->_nbNotRead($dao['cache_nbUnreads'] ?? -1);
+ $myFeed->_nbEntries($dao['cache_nbEntries'] ?? -1);
if (isset($dao['id'])) {
$myFeed->_id($dao['id']);
}