From 897e4a3f4a273d50c28157edb67612b2d7fa2e6f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 27 Dec 2024 12:03:59 +0100 Subject: Search in all feeds (#7144) * Search in all feeds Search in PRIORITY_ARCHIVED with `&get=A` fix https://github.com/FreshRSS/FreshRSS/discussions/7143 * Fix type * Search in PRIORITY_ARCHIVED with `&get=Z` * More * Fixes * One more fix * Extra features in user queries * Move i18n key * Fix overview * Enlarge query boxes * Revert i18n spelling * i18n: it Thanks @UserRoot-Luca Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com> --------- Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com> --- app/Models/EntryDAO.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index f9bf57220..525687c90 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1170,7 +1170,7 @@ SQL; } /** - * @phpstan-param 'a'|'A'|'i'|'s'|'S'|'c'|'f'|'t'|'T'|'ST' $type + * @phpstan-param 'a'|'A'|'i'|'s'|'S'|'c'|'f'|'t'|'T'|'ST'|'Z' $type * @param int $id category/feed/tag ID * @param 'ASC'|'DESC' $order * @return array{0:array,1:string} @@ -1185,13 +1185,16 @@ SQL; $where = ''; $values = []; switch ($type) { - case 'a': //All PRIORITY_MAIN_STREAM + case 'a': // All PRIORITY_MAIN_STREAM $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_MAIN_STREAM . ' '; break; - case 'A': //All except PRIORITY_ARCHIVED - $where .= 'f.priority > ' . FreshRSS_Feed::PRIORITY_ARCHIVED . ' '; + case 'A': // All except PRIORITY_ARCHIVED + $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_CATEGORY . ' '; + break; + case 'Z': // All including PRIORITY_ARCHIVED + $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_ARCHIVED . ' '; break; - case 'i': //Priority important feeds + case 'i': // Priority important feeds $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_IMPORTANT . ' '; break; case 's': //Starred. Deprecated: use $state instead @@ -1240,7 +1243,7 @@ SQL; } /** - * @phpstan-param 'a'|'A'|'s'|'S'|'i'|'c'|'f'|'t'|'T'|'ST' $type + * @phpstan-param 'a'|'A'|'s'|'S'|'i'|'c'|'f'|'t'|'T'|'ST'|'Z' $type * @param 'ASC'|'DESC' $order * @param int $id category/feed/tag ID * @throws FreshRSS_EntriesGetter_Exception @@ -1275,7 +1278,7 @@ SQL; } /** - * @phpstan-param 'a'|'A'|'s'|'S'|'i'|'c'|'f'|'t'|'T'|'ST' $type + * @phpstan-param 'a'|'A'|'s'|'S'|'i'|'c'|'f'|'t'|'T'|'ST'|'Z' $type * @param int $id category/feed/tag ID * @param 'ASC'|'DESC' $order * @return Traversable @@ -1341,7 +1344,7 @@ SQL; } /** - * @phpstan-param 'a'|'A'|'s'|'S'|'c'|'f'|'t'|'T'|'ST' $type + * @phpstan-param 'a'|'A'|'s'|'S'|'c'|'f'|'t'|'T'|'ST'|'Z' $type * @param int $id category/feed/tag ID * @param 'ASC'|'DESC' $order * @return array|null -- cgit v1.2.3