papyrix-reader icon indicating copy to clipboard operation
papyrix-reader copied to clipboard

(FB2) not correct total pages indexing

Open dial-888 opened this issue 7 months ago • 29 comments

In the FB2 format book - total pages indexing is not correct.

Image

dial-888 avatar Apr 27 '26 13:04 dial-888

@dial-888 Can you check it in 1.20.3

bigbag avatar Apr 29 '26 12:04 bigbag

I "Clear Book Cache", but now it's no "total pages" at all.

Image

dial-888 avatar Apr 29 '26 13:04 dial-888

@dial-888 Can you check on 1.21.0

bigbag avatar May 07 '26 16:05 bigbag

Now it's work kind of strange. At first page - there is a random total pages number. Image

By closing in to the last page - the total page number changes.

Image Image

And a few pages after that - changing and the current page number and the last page number.

Image

But the total pages number still not correct, and closer to the end it changes again.

Image

This was tested by jumping through chapters list. Maybe in real time reading there is different behavior.

dial-888 avatar May 07 '26 19:05 dial-888

@dial-888 This behavior is expected, until the entire book is fully cached, we don't know the exact page count, so it's provided as an approximate estimate (~). The more pages in the book are read (cached), the more accurate this estimate will be. Other options include an approximate number of pages per chapter or not including this metric at all.

bigbag avatar May 08 '26 03:05 bigbag

[@bigbag] This behavior is expected, until the entire book is fully cached, we don't know the exact page count, so it's provided as an approximate estimate (~). The more pages in the book are read (cached), the more accurate this estimate will be. Other options include an approximate number of pages per chapter or not including this metric at all.

So on the X4 it's impossible to cash the whole book? Is it memory limitation (compared to the big screen eReaders) or what?

dial-888 avatar May 08 '26 07:05 dial-888

@dial-888 It is possible, but not for one shot, it is main problem. We have 100-130 Kb memory and 1 core Cpu on X3/X4, not more.

Alternatively, you can convert books to XTH/XTCH format, then they will be displayed better on X3/X4 and will have all the meta information.

bigbag avatar May 08 '26 11:05 bigbag

[@bigbag] It is possible, but not for one shot, it is main problem. We have 100-130 Kb memory and 1 core Cpu on X3/X4, not more.

Well, if it possible, then better to do it (with "indexing..." logo on screen), instead of this kind of guessing of the pages number approach.

Alternatively, you can convert books to XTH/XTCH format, then they will be displayed better on X3/X4 and will have all the meta information.

The whole point of using papyrix is the native FB2 support, otherwise it's simpler to use EPUB-centered firmwares, I guess.

dial-888 avatar May 08 '26 18:05 dial-888

@dial-888 The main problem is the reader's resources and the size of the book. You can easily do it like in Crosspoint-Reader, showing total pages per chapter, or like here, an approximate number for the entire book. If you process the entire book at once, it can take minutes or tens of minutes.

bigbag avatar May 10 '26 08:05 bigbag

@dial-888 In version 1.22.1 I added option Full Book Process - with this one all book pre processes on open and you can see correct total pages count.

bigbag avatar May 10 '26 10:05 bigbag

Thanks! Although it seems like this process is causing the system to freeze (my attempt stuck dead with 32% indexing with no respond to buttons), but maybe there be found a way to optimise the process in the future.

upd. In fact I can't even reboot the system :( On the screen stuck indexing progress bar. I reflash the firmware but it not helped.

upd2. It helped to reinsert SD card. I rolled back to 1.22.0, but now issue #107 is back and I can't get rid of it by clearing book/device cache :(

dial-888 avatar May 10 '26 14:05 dial-888

@bigbag Testing Full Book Process on 1.22.2 and was not able to trigger device freezing (despite using cheap MicroSD which arrived with device, and FAT32 FS). Tested FB2 books up to 10 Mb in size/3509 pages in "small" text (opening took ~40sec, plus ~1.5min for indexing) Failed to test on EPUBs, few one I have don't open on device with "Invalid format" error.

@dial-888 you can try switching Settings -> Device Settings -> Startup Behavior to "Home" to prevent device from freezing after boot (attempting to open book which caused a freeze right after boot), upgrade again, trigger "Clear Device Cache" and try enabling and using Full Book Processagain (option value might be disabled or corrupted(?), after rollback to version which didn't had this feature). I worst case, if it would freeze again on attempt to index whole book, you'll be able to reboot device and disable this option until further notice.

I assume, part of reason for upd you mentioned is that device is rebooting, but after reboot it keeps trying to finish indexing book, due to Startup Behavior set to open last book. Therefore it looks stuck even after reboot.

Interested in this feature as well 🙂

Kelniimir avatar May 10 '26 20:05 Kelniimir

@Kelniimir I assume, part of reason for upd you mentioned is that device is rebooting, but after reboot it keeps trying to finish indexing book, due to Startup Behavior set to open last book. Therefore it looks stuck even after reboot. ... try switching Settings -> Device Settings -> Startup Behavior to "Home" to prevent device from freezing after boot (attempting to open book which caused a freeze right after boot)

You're right. This helps. Indexing stuck and rebooting just on the one book.zip I tried two other books and it worked fine.

dial-888 avatar May 10 '26 21:05 dial-888

@dial-888 Sorry for the troubles - I'll try to figure out the root cause of the problem.

bigbag avatar May 11 '26 13:05 bigbag

@Kelniimir Failed to test on EPUBs, few one I have don't open on device with "Invalid format" error. - If possible, please provide a link or attach the problematic book here in epub format.

bigbag avatar May 11 '26 14:05 bigbag

@Kelniimir Failed to test on EPUBs, few one I have don't open on device with "Invalid format" error. - If possible, please provide a link or attach the problematic book here in epub format.

Hello @bigbag

Was testing biggest books I have for Full Book Process. Tried these two, stopped after as other books I have in EPUB are small -> 1.5-4Mb. Thank you for concern, appreciate it.

Attached below: Book1.zip Book2.zip

Kelniimir avatar May 11 '26 14:05 Kelniimir

@dial-888 Fixed in 1.22.3 The reason for the errors is nested sections in the book.

bigbag avatar May 11 '26 16:05 bigbag

@Kelniimir I tested both books without any problems. Perhaps you have some specific settings?

bigbag avatar May 11 '26 16:05 bigbag

@Kelniimir I tested both books without any problems. Perhaps you have some specific settings?

@bigbag, at most, I have changed side buttons sequence, as it's more convenient to press top side buttons or power to scroll forward. 20260511_192332.jpg 20260511_192348.jpg

Re-tested, smaller books in same folder have same error. 20260511_192228.jpg

My best guess - too many nested folders or too long path+filename.

These EPUBs were on MicroSD by the path: Книги/[Новое]/Вторая жизнь известных книг, или истории про/Про Робина Гуда/На английском языке I assume if you create simar folder structure, you'll get simar error.

Kelniimir avatar May 11 '26 17:05 Kelniimir

@bigbag, yep. The moment I moved book to MicroSD root folder over WiFi Webserver, it's opened without issues.

With Full Book Process enabled.

So it's not a bug. Rather it's "Software doesn't have appropriate error message for situation when path is too long, while FAT32 FS in use, which has a path length limit". 20260511_205546.jpg 20260511_210331.jpg

Maybe worth mentioning on Git page to limit path+filename length, if vendor(XTEINK) provided MicroSD in use, or replacement MicroSD formatted to FAT32 in use.

And recommend to not be lazy and format MicroSD to ExFAT after flashing Papyrix, prior uploading whole library to it.

Kelniimir avatar May 11 '26 19:05 Kelniimir