diff options
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/CategoryDAO.php | 4 | ||||
| -rw-r--r-- | app/Models/Context.php | 3 | ||||
| -rw-r--r-- | app/Models/EntryDAO.php | 6 | ||||
| -rw-r--r-- | app/Models/Feed.php | 1 |
4 files changed, 7 insertions, 7 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 4c88e6b65..5520c39d6 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -302,12 +302,10 @@ SQL; . ($details ? 'f.* ' : 'f.id, f.name, f.url, f.kind, f.website, f.priority, f.error, f.attributes, f.`cache_nbEntries`, f.`cache_nbUnreads`, f.ttl ') . 'FROM `_category` c ' . 'LEFT OUTER JOIN `_feed` f ON f.category=c.id ' - . 'WHERE f.priority >= :priority ' . 'GROUP BY f.id, c_id ' . 'ORDER BY c.name, f.name'; $stm = $this->pdo->prepare($sql); - $values = [ ':priority' => FreshRSS_Feed::PRIORITY_CATEGORY ]; - if ($stm !== false && $stm->execute($values) && ($res = $stm->fetchAll(PDO::FETCH_ASSOC)) !== false) { + if ($stm !== false && $stm->execute() && ($res = $stm->fetchAll(PDO::FETCH_ASSOC)) !== false) { /** @var list<array{c_name:string,c_id:int,c_kind:int,c_last_update:int,c_error:int,c_attributes?:string, * id?:int,name?:string,url?:string,kind?:int,category?:int,website?:string,priority?:int,error?:int,attributes?:string,cache_nbEntries?:int,cache_nbUnreads?:int,ttl?:int}> $res */ return self::daoToCategoriesPrepopulated($res); diff --git a/app/Models/Context.php b/app/Models/Context.php index efe36f0e2..1dccff6f6 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -400,11 +400,12 @@ final class FreshRSS_Context { * @throws Minz_ConfigurationNamespaceException * @throws Minz_PDOConnectionException */ - public static function _get(string $get): void { + private static function _get(string $get): void { $type = $get[0]; $id = (int)substr($get, 2); if (empty(self::$categories)) { + // TODO: Check whether this section is used $catDAO = FreshRSS_Factory::createCategoryDao(); $details = $type === 'f'; // Load additional feed details in the case of feed view self::$categories = $catDAO->listCategories(prePopulateFeeds: true, details: $details); diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index ec3bde412..ad1cc4393 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -571,9 +571,9 @@ SQL; UPDATE `_entry` SET is_read = ? WHERE is_read <> ? AND id <= ? -AND id_feed IN (SELECT f.id FROM `_feed` f WHERE f.category=?) +AND id_feed IN (SELECT f.id FROM `_feed` f WHERE f.category=? AND f.priority >= ?) SQL; - $values = [$is_read ? 1 : 0, $is_read ? 1 : 0, $idMax, $id]; + $values = [$is_read ? 1 : 0, $is_read ? 1 : 0, $idMax, $id, FreshRSS_Feed::PRIORITY_CATEGORY]; [$searchValues, $search] = $this->sqlListEntriesWhere(alias: '', state: $state, filters: $filters); @@ -1340,7 +1340,7 @@ SQL; $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_MAIN_STREAM . ' '; break; case 'A': // All except PRIORITY_HIDDEN - $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_CATEGORY . ' '; + $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_FEED . ' '; break; case 'Z': // All including PRIORITY_HIDDEN $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_HIDDEN . ' '; diff --git a/app/Models/Feed.php b/app/Models/Feed.php index e368a6807..2b29f7b22 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -38,6 +38,7 @@ class FreshRSS_Feed extends Minz_Model { public const PRIORITY_IMPORTANT = 20; public const PRIORITY_MAIN_STREAM = 10; public const PRIORITY_CATEGORY = 0; + public const PRIORITY_FEED = -5; public const PRIORITY_HIDDEN = -10; /** @deprecated use PRIORITY_HIDDEN instead */ public const PRIORITY_ARCHIVED = -10; |
