diff options
| author | 2025-10-16 21:15:44 +0200 | |
|---|---|---|
| committer | 2025-10-16 21:15:44 +0200 | |
| commit | f08f7dcff988de90e899ce310246f0b552a4fe3d (patch) | |
| tree | 8a96a66aa59e3b1bf675757c5fc555e9187b8625 /app/Controllers/indexController.php | |
| parent | ca091fbef4823159060275a293eaa4e65ecaf1c0 (diff) | |
Sort by article length (#8119)
* Sort by article length
fix https://github.com/FreshRSS/Extensions/issues/378
Very basic using simply SQL `LENGTH()` function.
<img width="492" height="217" alt="image" src="https://github.com/user-attachments/assets/7cf37303-76c8-4411-b8b1-075e81535b60" />
* Improve content length retrieval
Diffstat (limited to 'app/Controllers/indexController.php')
| -rw-r--r-- | app/Controllers/indexController.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 405c7c5a8..8043e8f79 100644 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -285,7 +285,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController { $continuation_values = []; if (FreshRSS_Context::$continuation_id !== '0') { - if (in_array(FreshRSS_Context::$sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified'], true)) { + if (in_array(FreshRSS_Context::$sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified', 'length'], true)) { $pagingEntry = $entryDAO->searchById(FreshRSS_Context::$continuation_id); if ($pagingEntry !== null && in_array(FreshRSS_Context::$sort, ['c.name', 'f.name'], true)) { @@ -303,6 +303,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController { 'link' => $pagingEntry->link(true), 'title' => $pagingEntry->title(), 'lastUserModified' => $pagingEntry->lastUserModified(), + 'length' => $pagingEntry->sqlContentLength() ?? 0, }; if ($pagingEntry !== null && FreshRSS_Context::$sort === 'c.name') { // Secondary sort criterion |
