aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-10-15 00:12:19 +0200
committerGravatar GitHub <noreply@github.com> 2025-10-15 00:12:19 +0200
commit7e72033859f60f529d4d985da1e9cac0a691b2dc (patch)
treea37d63b30afaf78e259c065a367ed8ddeee22755 /app/Models/Entry.php
parente070c3ed2bec4ea4a6c2a216a5c836d1e02ab381 (diff)
Filter on last user modified (#8093)
Example: `userdate:PT1H` to select only articles modified by user during the last hour Fix https://github.com/FreshRSS/FreshRSS/issues/4280#issuecomment-3393078024 Useful for instance to bulk mark as unread recently marked articles by error: 1. Click on the toggle button to show the read articles (making sure the toggle for the unread articles is off) 2. Sort by *User modified 9→1* 3. Filter by *user modified date*, for instance to the last 3 hours by typing `userdate:PT3H` 4. Click in the drop-down menu *Mark selection as unread* P.S.: I have added at the same time a bunch of unit tests for date-related logic
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 1f99a8345..296c3860f 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -654,6 +654,18 @@ HTML;
if ($ok && $filter->getNotMaxPubdate() !== null) {
$ok &= $this->date > $filter->getNotMaxPubdate();
}
+ if ($ok && $filter->getMinUserdate() !== null) {
+ $ok &= $this->lastUserModified >= $filter->getMinUserdate();
+ }
+ if ($ok && $filter->getNotMinUserdate() !== null) {
+ $ok &= $this->lastUserModified < $filter->getNotMinUserdate();
+ }
+ if ($ok && $filter->getMaxUserdate() !== null) {
+ $ok &= $this->lastUserModified <= $filter->getMaxUserdate();
+ }
+ if ($ok && $filter->getNotMaxUserdate() !== null) {
+ $ok &= $this->lastUserModified > $filter->getNotMaxUserdate();
+ }
if ($ok && $filter->getFeedIds() !== null) {
$ok &= in_array($this->feedId, $filter->getFeedIds(), true);
}