advplyr / audiobookshelf-app

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

Android crash when attempting to download missing file #422

Open nichwall opened 2 years ago

nichwall commented 2 years ago

Steps to reproduce

  1. Turn off watcher
  2. Merge book to M4B on ABS
  3. Do not rescan directory image image
  4. Download book on Android (v0.9.57-beta)
  5. Android app crashes, download manager gives notifications that all audio files failed to download (the cover was successfully downloaded)

Expected behaviour

Some sort of warning/popup to say the file is missing or library needs to be rescanned.

Actual behaviour

Attempted to download book which has been merged (but library has not been rescanned) causes the Android app to crash when attempting to download the book. Download (of the same book) then behaves as expected after scanning the library.

Environment data

Audiobookshelf Version: 2.2.0 (Docker)

Android Issue

Android version: Android 13

Device model: Pixel 6a

Stock or customized system: Stock

nichwall commented 1 year ago

Update on this issue (Android 13, Pixel 6a, version 0.9.65, server 2.2.23), haven't checked the behavior since first posted. Test book downloads correctly to both filesystem and Internal App Storage after rescanning library files as mentioned before.

Android app no longer crashes when trying to download missing files from the server. The behavior is now as follows:

Downloading to the shared filesystem

Cover image is correctly downloaded, download "Completes successfully", then gives the error "Item download complete but failed to create library item." The android file system shows that only the cover was downloaded. The book is not marked as local and download button is still able to be pressed.

Downloading to Internal App Storage

Get the three toasts saying the download completed successfully (as mentioned in Discord by evequefou on July 4, 2023), item is marked as local and download button disappears. Pressing play gives "Playback Failed: Source error". Viewing local files shows the mp3 files exist, but I assume they are all 0 bytes since it downloaded them instantly and the mp3s do not exist on the server.