From 582ba55324d612d8bdfd57f41c23d1b3d33e104e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 5 Jun 2026 10:48:58 -0300 Subject: sort: redirection overrides, sort by nameForSorting --- src/data/things/sorting-rule/ThingSortingRule.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/data/things/sorting-rule') diff --git a/src/data/things/sorting-rule/ThingSortingRule.js b/src/data/things/sorting-rule/ThingSortingRule.js index 6dbaccf7..363146a3 100644 --- a/src/data/things/sorting-rule/ThingSortingRule.js +++ b/src/data/things/sorting-rule/ThingSortingRule.js @@ -41,22 +41,24 @@ export class ThingSortingRule extends SortingRule { const get = thing => thing[property]; const lc = property.toLowerCase(); - if (lc.endsWith('date')) { + if (lc === 'date') { + sortByDate(sortable); + continue; + } else if (lc.endsWith('date')) { sortByDate(sortable, {getDate: get}); continue; } - if (lc.endsWith('directory')) { + if (lc === 'directory') { + sortByDirectory(sortable); + continue; + } else if (lc.endsWith('directory')) { sortByDirectory(sortable, {getDirectory: get}); continue; } if (lc === 'name') { - sortByName(sortable, { - getName: thing => - thing.nameForSorting ?? - thing.name, - }); + sortByName(sortable); continue; } else if (lc.endsWith('name')) { sortByName(sortable, {getName: get}); -- cgit 1.3.0-6-gf8a5