From ef4a826e345e2eb7c0013617b3f07cc53ef22ed8 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 9 Mar 2021 08:41:01 +0100 Subject: Reload full content when changed (#3506) * Reload full content when changed If an article is changed, reload also its full content when applicable. * Compute hash before getting full content * Revert mix two PRs * Update app/Controllers/feedController.php --- app/Models/Entry.php | 4 ++-- app/Models/Feed.php | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'app/Models') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 6e14d43b7..021ceedfb 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -433,9 +433,9 @@ class FreshRSS_Entry extends Minz_Model { $feed = $this->feed(true); if ($feed != null && trim($feed->pathEntries()) != '') { $entryDAO = FreshRSS_Factory::createEntryDao(); - $entry = $entryDAO->searchByGuid($this->feedId, $this->guid); + $entry = $force ? null : $entryDAO->searchByGuid($this->feedId, $this->guid); - if ($entry && !$force) { + if ($entry) { // l'article existe déjà en BDD, en se contente de recharger ce contenu $this->content = $entry->content(); } else { diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 795337b01..7f52ba52f 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -467,10 +467,8 @@ class FreshRSS_Feed extends Minz_Model { ); $entry->_tags($tags); $entry->_feed($this); - if ($this->pathEntries != '') { - // Optionally load full content for truncated feeds - $entry->loadCompleteContent(); - } + $entry->hash(); //Must be computed before loading full content + $entry->loadCompleteContent(); // Optionally load full content for truncated feeds yield $entry; } -- cgit v1.2.3