diff options
author | Alexandre Alapetite <alexandre@alapetite.fr> | 2024-07-21 14:54:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-21 14:54:34 +0200 |
commit | 0eeac4a669e46fb6521ae1765b23656c9afc43de (patch) | |
tree | 7c5a08b80b628f855b11c8850aa993c0b509feb1 /p/api | |
parent | 47b5e40e7240b5ccb0d0b6c54e0a958243689c83 (diff) | |
download | freshrss-0eeac4a669e46fb6521ae1765b23656c9afc43de.tar.gz freshrss-0eeac4a669e46fb6521ae1765b23656c9afc43de.zip |
Revisit keepMaxUnreads (#6632)
* Revisit keepMaxUnreads
Again, follow-up of https://github.com/FreshRSS/FreshRSS/pull/5905
fix https://github.com/FreshRSS/FreshRSS/issues/6620
* Refactoring to address buggy cases
* Fix minor test
Diffstat (limited to 'p/api')
-rw-r--r-- | p/api/greader.php | 5 | ||||
-rw-r--r-- | p/api/pshb.php | 7 |
2 files changed, 3 insertions, 9 deletions
diff --git a/p/api/greader.php b/p/api/greader.php index 71cf40884..9c3479546 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -331,10 +331,7 @@ final class GReaderAPI { $importService = new FreshRSS_Import_Service($user); $importService->importOpml($opml); if ($importService->lastStatus()) { - [, , $nb_new_articles] = FreshRSS_feed_Controller::actualizeFeeds(); - if ($nb_new_articles > 0) { - FreshRSS_feed_Controller::commitNewEntries(); - } + FreshRSS_feed_Controller::actualizeFeedsAndCommit(); invalidateHttpCache($user); exit('OK'); } else { diff --git a/p/api/pshb.php b/p/api/pshb.php index 9f5b4822c..8fcc5ab34 100644 --- a/p/api/pshb.php +++ b/p/api/pshb.php @@ -133,11 +133,8 @@ foreach ($users as $userFilename) { Minz_ExtensionManager::enableByList(FreshRSS_Context::userConf()->extensions_enabled, 'user'); Minz_Translate::reset(FreshRSS_Context::userConf()->language); - [$updated_feeds, , $nb_new_articles] = FreshRSS_feed_Controller::actualizeFeeds(null, $self, null, $simplePie); - if ($nb_new_articles > 0) { - FreshRSS_feed_Controller::commitNewEntries(); - } - if ($updated_feeds > 0) { + [$nbUpdatedFeeds, ] = FreshRSS_feed_Controller::actualizeFeedsAndCommit(null, $self, null, $simplePie); + if ($nbUpdatedFeeds > 0) { $nb++; } else { Minz_Log::warning('Warning: User ' . $username . ' does not subscribe anymore to ' . $self, PSHB_LOG); |