From 518b648c428acd891a761d4160413b1370f293c0 Mon Sep 17 00:00:00 2001 From: SomeGuy <97603719+Commodore64user@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:59:16 +0000 Subject: [PATCH] Update filechooser.lua tidy-up --- frontend/ui/widget/filechooser.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index 22c0ca3ee..63f6e3104 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -235,18 +235,14 @@ 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.percent_finished = 1.0 + item.percent_finished = 1 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 + elseif summary and summary.status == "abandoned" then + item.percent_finished = 0 return end - percent_finished = doc_settings:readSetting("percent_finished") end -- smooth 2 decimal points (0.00) instead of 16 decimal numbers