advplyr / audiobookshelf-app

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

Downloaded m4b audiobooks are removed after scanning local folder #220

Closed whaddayakno closed 1 year ago

whaddayakno commented 2 years ago

Steps to reproduce

  1. Download an m4b audiobook
  2. Scan local folder
  3. Audiobook is removed from local books

Expected behaviour

Actual behaviour

Environment data

Audiobookshelf Version: Docker: v2.0.19 App: v0.9.48

Android Issue

Android version: 10

Device model: Samsung Galaxy Note 9

Stock or customized system: Stock

iOS Issue

iOS Version:

iPhone model:

hobesman commented 2 years ago

+1 I just tested and can confirm this happened for me too. I had 6 books downloaded and working. When I rescanned the local media folder, two of the books were removed.

Server 2.0.20, app version 0.9.48-beta. Android 9

advplyr commented 2 years ago

Are you sure this was working on older app versions? Scanning the media folder after downloading? I don't think anything was changed with the downloader.

hobesman commented 2 years ago

To be clear, it's not the downloader, it's the scanner. Books that were previously downloaded and added, have now been removed from the Local Media section upon rescan.

That being said I don't know that I consciously tested this specific scenario before (download an M4b book, then trigger manual rescan) so it might not be new.

advplyr commented 2 years ago

Fixed in v0.9.49-beta

hobesman commented 2 years ago

Updated to 0.9.49-beta and still seeing this (downloads succeed and appear under local media, but m4b books disappear upon manual scan).

whaddayakno commented 2 years ago

Same here, still doesn't work. Appreciate you taking a look at this so quickly though, never had a dev push an update the same day as a bug report lol

whaddayakno commented 2 years ago

And to answer your question, I'm not sure if this was working in previous versions. may be an old bug

advplyr commented 2 years ago

I've been testing on Android 9 and Android 10 on Pixel devices. Android 9 seems to be working well. Android 10 is not able to probe m4b audio files. When you first download an m4b and press play to play the local download, is it showing the correct duration of the audiobook?

After you download the m4b then close and re-open the app are the files being removed? There is a function that runs when the app starts the checks if the downloaded files are still there, that function on Android 10 in my tests is reporting that the files are no longer there when they are.

Let me know if you are experiencing these things as well.

hobesman commented 2 years ago

Android 9 here and not experiencing the issues you described except that the books disappear upon manual rescan. The books appear in the local media tray after downloading, and on the local media tab, even after I force close and reopen the app. The durations appear accurate. The local one doesn't list the file size though. And it's able to play the files just fine, until you rescan and they get dropped from the list.

advplyr commented 2 years ago

Unfortunately I wasn't able to reproduce the issue of the re-scan removing the audio files. If you are able to watch the logcat during the re-scan there a lot of logs that print info about what was found during the scan.

whaddayakno commented 2 years ago

After you download the m4b then close and re-open the app are the files being removed?

Just tried this on Android 10 and the files were still there after closing and reopening the app. The duration of the m4b is correct and works normally. until you do a manual scan, then it drops from the list.

To be clear, the re-scan doesn't actually remove the files. It just doesn't recognize the m4b files as audiobooks. As a workaround I've just been playing the same files with Smart Audiobook Player, works great.

hobesman commented 2 years ago

Screenshot_20220607-202209 FYI this is the toast I see when I scan. It's like it find the two m4b books but won't add them. Would it say this if it weren't finding the m4b files?

philipjholm commented 2 years ago

I have the same problem with offline books being completely removed when doing a manual scan from inside the app. Going into the folder with a external filemanager app the files are still there and seems to be as expected.

If I remove the book library/folder in audiobookshelf app and re-add the same folder it finds 1 book and says 6 are up-to-date.

OnePlus 5T, android 10

swann-martin commented 1 year ago

I have the same problem on a xiaomi note 8 pro with android 10. From the comments it looks like it only happens on android 10. Is there a fix? The files are in the folder but not showing in the app even though they were scanned. I want to move away from audible but this bug makes the app unreliable and quite unusable. Screenshot_2023-02-18-07-56-53-520_com audiobookshelf app

advplyr commented 1 year ago

This is a different issue now having to do with the update in folder paths on the last release. I just fixed it yesterday and should get a release out today.

advplyr commented 1 year ago

There was a fix in 0.9.62-beta with the re-scan but I'm not sure if this resolved any issues mentioned here. Let me know if this persists in the latest server and app.

hobesman commented 1 year ago

I'm still getting the same thing on rescan. Screenshot_20230310-192330_audiobookshelf

P.s. Also, look at those zig zag arrows on the right...