From a6243e334e2ee4d34d5ac689897a6f2c70537397 Mon Sep 17 00:00:00 2001 From: SomeGuy <97603719+Commodore64user@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:06:53 +0000 Subject: [PATCH] Update filechooser.lua adds instruction for files labeled "on hold" to sorting function --- frontend/ui/widget/filechooser.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index 7bbfd03d4..22c0ca3ee 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, @@ -241,6 +241,12 @@ local FileChooser = Menu:extend{ return end + -- books marked as "on hold" should be considered the same as 0% + if summary and summary.status == "abandoned" then + item.percent_finished = 0.0 + return + end + percent_finished = doc_settings:readSetting("percent_finished") end -- smooth 2 decimal points (0.00) instead of 16 decimal numbers