mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-06 22:23:10 -04:00
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
This commit is contained in:
committed by
GitHub
parent
385e7f883a
commit
ef4a826e34
@@ -377,6 +377,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the entry has changed, there is a good chance for the full content to have changed as well.
|
||||
$entry->loadCompleteContent(true);
|
||||
|
||||
if (!$entryDAO->inTransaction()) {
|
||||
$entryDAO->beginTransaction();
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user