mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-18 05:14:34 -04:00
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
This commit is contained in:
committed by
GitHub
parent
ca091fbef4
commit
f08f7dcff9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user