ソースを参照

Automatically correct cache number of unread articles

Alexandre Alapetite 11 年 前
コミット
300c508d9e
1 ファイル変更6 行追加0 行削除
  1. 6 0
      app/Controllers/indexController.php

+ 6 - 0
app/Controllers/indexController.php

@@ -126,6 +126,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 			// on essaye de récupérer tous les articles
 			if ($state === FreshRSS_Entry::STATE_NOT_READ && empty($entries) && ($state_param === null)) {
 				Minz_Log::record ('Conflicting information about nbNotRead!', Minz_Log::DEBUG);
+				$feedDAO = new FreshRSS_FeedDAO();
+				try {
+					$feedDAO->updateCachedValues();
+				} catch (Exception $ex) {
+					Minz_Log::record ('Failed to automatically correct nbNotRead! ' + $ex->getMessage(), Minz_Log::DEBUG);
+				}
 				$this->view->state = FreshRSS_Entry::STATE_ALL;
 				$entries = $entryDAO->listWhere($getType, $getId, $this->view->state, $order, $nb, $first, $filter, $date_min, true, $keepHistoryDefault);
 			}