From 8227dcce25081fc1dee38a6e590ccce0edac2273 Mon Sep 17 00:00:00 2001 From: hasezoey Date: Tue, 26 Mar 2024 11:38:40 +0100 Subject: [PATCH] FileChooser: "percent - unopened - finished last" add "on-hold" handling Squashed commit of the following: commit dd618a4e426e4f2d73d740f3ee8f780e18cec13c Merge: 518b648c4 5414858b7 Author: SomeGuy <97603719+Commodore64user@users.noreply.github.com> Date: Tue Mar 12 23:23:59 2024 +0000 Merge branch 'koreader:master' into master commit 518b648c428acd891a761d4160413b1370f293c0 Author: SomeGuy <97603719+Commodore64user@users.noreply.github.com> Date: Thu Mar 7 10:59:16 2024 +0000 Update filechooser.lua tidy-up commit a6243e334e2ee4d34d5ac689897a6f2c70537397 Author: SomeGuy <97603719+Commodore64user@users.noreply.github.com> Date: Wed Mar 6 16:06:53 2024 +0000 Update filechooser.lua adds instruction for files labeled "on hold" to sorting function --- frontend/ui/widget/filechooser.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index 9dbb164fb..31062c6a4 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -207,7 +207,7 @@ local FileChooser = Menu:extend{ end, }, percent_natural = { - -- sort 90% > 50% > 0% > unopened > 100% or finished + -- sort 90% > 50% > 0% or on hold > unopened > 100% or finished text = _("percent - unopened - finished last"), menu_order = 90, can_collate_mixed = false, @@ -235,9 +235,11 @@ local FileChooser = Menu:extend{ local doc_settings = DocSettings:open(item.path) local summary = doc_settings:readSetting("summary") - -- books marked as "finished" should be considered the same as 100% + -- books marked as "finished" or "on hold" should be considered the same as 100% and 0% respectively if summary and summary.status == "complete" then item.sort_percent = 1.0 + elseif summary and summary.status == "abandoned" then + item.sort_percent = 0 end percent_finished = doc_settings:readSetting("percent_finished")