partial downloads break downloading of an audiobook #21

Open
opened 2026-04-24 23:02:30 +02:00 by adam · 7 comments
Owner

Originally created by @zombiehoffa on GitHub (Nov 13, 2021).

This appears to be downloading to the download dir and then copying over to storage dir. If audiobook shelf app is interrupted between passing download to whatever is downloading and completing moving to the storage dir you will end up with a fully downloaded audiobook in your download dir but will not be able to play the local copy in the app or initiate a successful download because whatever is actually downloading the book appends -1, -2, etc depending how many copies are in the download dir and when audiobookshelf app tries to copy over the copy not associated with the download request, it fails. You can recreate this behaviour by starting a download but killing the app in between when the download of the audiobook itself is started and when it is finished.

from my previous bug where I figured out what was happening:
The issue appears to be the app downloads it expecting it to be named string.mp3 and when the android downloading mechanism finds string.mp3 already in the download dir it puts it in the download dir as string-1.mp3, at which points audiobookshelf app loses its mind and gives all this weird behavior.

Originally created by @zombiehoffa on GitHub (Nov 13, 2021). This appears to be downloading to the download dir and then copying over to storage dir. If audiobook shelf app is interrupted between passing download to whatever is downloading and completing moving to the storage dir you will end up with a fully downloaded audiobook in your download dir but will not be able to play the local copy in the app or initiate a successful download because whatever is actually downloading the book appends -1, -2, etc depending how many copies are in the download dir and when audiobookshelf app tries to copy over the copy not associated with the download request, it fails. You can recreate this behaviour by starting a download but killing the app in between when the download of the audiobook itself is started and when it is finished. from my previous bug where I figured out what was happening: The issue appears to be the app downloads it expecting it to be named string.mp3 and when the android downloading mechanism finds string.mp3 already in the download dir it puts it in the download dir as string-1.mp3, at which points audiobookshelf app loses its mind and gives all this weird behavior.
adam added the bug label 2026-04-24 23:02:30 +02:00
Author
Owner

@advplyr commented on GitHub (Nov 13, 2021):

Ah just commented on the other issue you closed basically saying that naming issue needs to be resolved. Thanks for opening another issue on that.

@advplyr commented on GitHub (Nov 13, 2021): Ah just commented on the other issue you closed basically saying that naming issue needs to be resolved. Thanks for opening another issue on that.
Author
Owner

@zombiehoffa commented on GitHub (Nov 13, 2021):

I figured I would try and save you having to read some of my ramblings by closing that one and opening a more concise one with the actual problem. ;)

@zombiehoffa commented on GitHub (Nov 13, 2021): I figured I would try and save you having to read some of my ramblings by closing that one and opening a more concise one with the actual problem. ;)
Author
Owner

@zombiehoffa commented on GitHub (Nov 15, 2021):

So, playing with this a bit more, it looks like it preallocates the file when the download starts so perhaps the fix is as easy as checking the existence of the file and deleting it in the download dir before download starts if it exists?

@zombiehoffa commented on GitHub (Nov 15, 2021): So, playing with this a bit more, it looks like it preallocates the file when the download starts so perhaps the fix is as easy as checking the existence of the file and deleting it in the download dir before download starts if it exists?
Author
Owner

@advplyr commented on GitHub (Nov 16, 2021):

That is basically the fix, but there are some other issues with the downloader I would like to resolve with that.

@advplyr commented on GitHub (Nov 16, 2021): That is basically the fix, but there are some other issues with the downloader I would like to resolve with that.
Author
Owner

@zombiehoffa commented on GitHub (Nov 20, 2021):

based on commits I see to the app, I am very excitedly awaiting closing this bug (and also s uper excited to see sync of progress for downloaded books working!! Nice work!)

@zombiehoffa commented on GitHub (Nov 20, 2021): based on commits I see to the app, I am very excitedly awaiting closing this bug (and also s uper excited to see sync of progress for downloaded books working!! Nice work!)
Author
Owner

@advplyr commented on GitHub (Nov 20, 2021):

Unfortunately my last release is stuck in review on the play store again, which was fixing some of the sync bugs. The current release available is going to buggy until they approve that release.

@advplyr commented on GitHub (Nov 20, 2021): Unfortunately my last release is stuck in review on the play store again, which was fixing some of the sync bugs. The current release available is going to buggy until they approve that release.
Author
Owner

@nichwall commented on GitHub (May 26, 2025):

I have been working on refactoring the Android download logic over the past few months (progress was a bit slow due to life getting in the way). This refactor was primarily focused on cleaning up the framework, and not specifically aimed at fixing any particular issue. However, it is possible that the changes may have resolved this issue as a side effect.

If you get a chance, please try sideloading the APK located at the end of the pull request and let me know if you run into other issues, whether this issue still occurs, or if this issue appears to be resolved. The APK can be downloaded from the "Build APK" workflow at the end of the page by clicking on "View Details", then clicking on "Summary", then downloading the APK. The PR is https://github.com/advplyr/audiobookshelf-app/pull/1587

I am requesting feedback on all of the open Android download issues, so apologies if you receive multiple notifications.

Workflow run
APK download

@nichwall commented on GitHub (May 26, 2025): I have been working on refactoring the Android download logic over the past few months (progress was a bit slow due to life getting in the way). This refactor was primarily focused on cleaning up the framework, and not specifically aimed at fixing any particular issue. However, it is possible that the changes may have resolved this issue as a side effect. If you get a chance, please try sideloading the APK located at the end of the pull request and let me know if you run into other issues, whether this issue still occurs, or if this issue appears to be resolved. The APK can be downloaded from the "Build APK" workflow at the end of the page by clicking on "View Details", then clicking on "Summary", then downloading the APK. The PR is https://github.com/advplyr/audiobookshelf-app/pull/1587 I am requesting feedback on all of the open Android download issues, so apologies if you receive multiple notifications. ![Workflow run](https://github.com/user-attachments/assets/ac386c0c-5a3c-4b10-98a1-1c5626358348) ![APK download](https://github.com/user-attachments/assets/ded054e4-0cc5-457c-bb59-f1651197fbbc)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#21