aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-16 12:09:39 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-16 12:09:39 +0200
commitea503975d5967dd9605f8e8df8a77fc1e5bc2e3a (patch)
tree017e977d97e74c14a609eb033d458ea16bad5312 /app/Controllers/feedController.php
parent2038d50110468d95ff978ba2e8f997175f25ff3b (diff)
Fix again updateLastSeenUnchanged (#5404)
* Fix again updateLastSeenUnchanged https://github.com/FreshRSS/FreshRSS/pull/5382 was not good enough to fix markAsReadUponGone and introduced a regression in `entry.lastSeen`. New approach. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5315 * Minor change of mind * Fix handling of lastSeen entry.lastSeen was not always correctly initialised, and sometimes overriden
Diffstat (limited to 'app/Controllers/feedController.php')
-rw-r--r--app/Controllers/feedController.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index c007c3050..554725477 100644
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -465,6 +465,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
continue; //Skip subsequent articles with same GUID
}
$newGuids[$entry->guid()] = true;
+ $entry->_lastSeen($mtime);
if (isset($existingHashForGuids[$entry->guid()])) {
$existingHash = $existingHashForGuids[$entry->guid()];
@@ -521,7 +522,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if (!$entryDAO->inTransaction()) {
$entryDAO->beginTransaction();
}
- $entryDAO->addEntry($entry->toArray());
+ $entryDAO->addEntry($entry->toArray(), true);
if (!$entry->isRead()) {
$feed->incPendingUnread();
@@ -529,6 +530,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$nb_new_articles++;
}
}
+ // N.B.: Applies to _entry table and not _entrytmp:
$entryDAO->updateLastSeen($feed->id(), array_keys($newGuids), $mtime);
} elseif ($feedIsUnchanged) {
// Feed cache was unchanged, so mark as seen the same entries as last time