advplyr / audiobookshelf-app

Mobile application for Audiobookshelf
https://audiobookshelf.org
GNU General Public License v3.0
1.23k stars 164 forks source link

[Bug]: Cannot open downloaded epub files #1271

Open jveronese opened 2 months ago

jveronese commented 2 months ago

What was the Problem?

When I download an ebook (epub format is most of my library, including the current file I'm using) and I open the book, it just gives me a blank screen. When I delete the local item, I can read the book from the server. The issue happens on both my Android tablet and my iPhone (app installed through TestFlight).

Steps to Reproduce the Issue

  1. Go to ebook library
  2. Select book
  3. Download for offline reading
  4. Open book. The screen is blank until I go back to the main book page and delete the local item.

What was Expected?

To read the book the same way as if I stream the epub from the server

Phone Model

iPhone 15 Max/ Meebook M6

Phone OS

iPhone 18 beta (happened on iOS 17 as well)/Android 11

Audiobookshelf App Version

Android App - 0.9.74

Installation Source

Google Play Store

Additional Notes

I have tried on my Meedbook Android tablet, my iPhone, and my iPad Pro 11 (M2 on ios 17). All have the same result.

On checking ABS logs I am seeing an error when I download a book

[LibraryItemController]
Library file "bunch-of-numbers" does not exist for library item
nichwall commented 2 months ago

Is this true for all epub files, or only certain books?

Can you try scanning the library item again on the server? I'm not sure why it would work while connected to the server, but could be a permissions issue or something got moved around.

Screenshot_20240727-080912.png

jveronese commented 2 months ago

Thanks! A manual re-scan fixed it. I don't know why it popped up after a manual scan though, I have ABS scheduled to scan that library every 15 minutes so I know it's been scanned since I've been having the issue.

Maybe just to many updates in between a manual scan.

nichwall commented 2 months ago

If it stops working again later, there is probably something messed up in the database from moving files around or having a media file in a higher level directory.

Glad you got it figured out

SmackleFunky commented 2 months ago

This happens to me every time I do a local download, if I have both the ebook and audiobook. The audiobook will play, but the ebook will not show (It shows a blank page and Table of Contents is empty). If I have just an ebook it works fine.

Re-Scan does not fix.

nichwall commented 2 months ago

This may be a problem with specific ebook files. What file formats are you ebooks?

Do the ebooks load correctly when connected to the server? If epub, can you try doing an epub -> epub conversion using Calibre or another tool to make sure those specific epubs are not malformed?

SmackleFunky commented 2 months ago

Ok you are right, I had some sample biases, it is just some epub files don't work locally.

doing an epub->epub conversion seems to have fixed the issue with the ones I was working with.

nichwall commented 2 months ago

Yeah, many epub files are weird/don't confirm to spec (even from publishers), so running epub files through a more robust converter like Calibre will fix a lot of epub issues for ABS and other programs. ABS doesn't do any ebook conversions, but may eventually handle some more simple cases.