calvinaquino / LNReader-Android

Light novel reader for android test project collab
Apache License 2.0
119 stars 36 forks source link

Thumbs not showing on one of my phones #294

Open HYBRID-BEING opened 3 years ago

HYBRID-BEING commented 3 years ago

I'm trying to migrate BakaReader Ex from one of my phones (ASUS Zenfone 2, Android 5.1.1) to another (ASUS Zenfone Selfie, Android 6.0.1). Something seems to be wrong, though - no matter what i try, thumbs don't seem to work on my new phone and all i see is placeholders (sometimes with alt text, sometimes not).

I've tried:

I've also tried to relink images after every thing i tried, but it didn't help - it always said that 0 images were updated. I took a look in the log files (here's one), and i didn't see anything there concerning thumbs.

HYBRID-BEING commented 3 years ago

So, i've tried updating my Selfie to LineageOS 15.1 (Android 8.1) - made no difference.

I also checked the fresh installation and noticed that thumbs are placed into the /files/project/thumbs directory (sorted in single-character-named folders by filename's first character), unlike on my Zenfone 2. So i tried batch renaming the files into corresponding format and putting them in corresponding folders, but that didn't help either.

Here's what i have, every thumb is just like that. Covers are okay though, surprisingly. Screenshot_BakaReader_EX_20210212-045445

Nandaka commented 3 years ago

hiya, the apps not actively developed anymore. I'm using https://novelupdates.inverse.cc/ now

HYBRID-BEING commented 3 years ago

Yeah, i did notice that was the case, but i've got some novels downloaded that were C&D'd, and wanted to preserve those, at the very least. This seems very weird to me that everything works fine on old phone, yet fails to work on a newer one. Maybe there is some other log i can look at to try to figure this out?

HYBRID-BEING commented 3 years ago

Oh boy, i think i actually resolved my conundrum.

I've been juggling files around and it finally hit me that if BakaReader doesn't fix thumbs in the database for me, then i just need to do it myself. So i got myself DB Browser, opened up pages.db, found the table of interest (_novel_bookscontent), extracted it into CSV and instantly noticed that most of the thumbs have paths like _file:///storage/sdcard0/Android/data/com.erakk.lnreader/files/project/thumb.php_f=High_school_DxD_Volume_19_Cover-Mini.jpg&width=85, while few have something like file:///storage/emulated/0/Android/data/com.erakk.lnreader/files/project/thumb.php_f=C3_01-Cover.jpg&width=82. Turns out some of the thumbs actually worked on my Selfie! But latter work on the Zenfone 2 as well - i've checked directories and it seems that, unlike on Selfie, **/sdcard0/ and /emulated/0/** were symlinked. A few regexp replaces later, i have a CSV with paths changed to /emulated/0/ (also, changed weird php names to /thumbs/N/Name-XXpx.ext_, while at it), imported it into the db file in place of original table (don't forget to set attributes as they originally were, or BakaReader will slow down to a crawl!), and, voila, thumbs are present once again.

Though, i think there might be some weird files left like _file:///storage/emulated/0/Android/data/com.erakk.lnreader/files/project/thumbs/C/CtGv02%3F-84px.jpeg_. The actual file was saved as _CtG_v02_-84px.jpeg, so BakaReader doesn't pick it up.