Commit ae8e573
authored
Fix crash and improve fractions in list view of library (#1602)
* library: correctly parse title in list view regardless of type
The title can be an object, a string or null. Setting a
label to null instead of "" is an uncatchable exception.
Thus, if this even happens, Foliate will crash.
Fixes: f1a1602 ("Update foliate-js")
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
* library: improve fraction calculation
With a zero-based index, this assumes if you are on a
page, that you read it partially exactly to the amount
of pages you read before relative to the amount of pages
before and after. That results in the first page being
considered unread and the last page being fully read of
you were on those pages.
While this is not accurate, there is no way to accurately
determine the current sub-page percentage a person read.
However, at least, this results in the percentage going
from 0 % to 100 % for any given book. Thus, opening a
book for the first time and not starting to read it marks
it as 0 %, which is the desired outcome of this change.
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
---------
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>1 parent 1a63d93 commit ae8e573
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
0 commit comments