[Enhancement]: Scan local download folder for existing media #1066

Open
opened 2026-04-24 23:47:36 +02:00 by adam · 11 comments
Owner

Originally created by @DrakeHamString on GitHub (Nov 4, 2024).

Describe the Feature/Enhancement

Scan the download folder for existing media and if found, then mark the corresponding audiobook as already downloaded and link it.

Why would this be helpful?

When having to reset the app and re-login, I don't want to download my audiobooks again, that are already on the phone.

I've set up a local folder containing all files. When selecting this folder again, ABS shows that there is no media (but the audiobook files are existing there). When downloading the audiobooks the app just overwrites the existing files.

Future Implementation (Screenshot)

In local folder option, add a new option to the three-dot-menu called "Scan folder for local media"
image

image

Of course in the correct languages

Audiobookshelf App Version

Android App - 0.9.76, Android App - 0.9.75

Current Implementation (Screenshot)

Local Folder with files in it:
image

App shows no dowloaded audiobooks:
image

App offers stream option and download option - no local play option:
image

Originally created by @DrakeHamString on GitHub (Nov 4, 2024). ### Describe the Feature/Enhancement Scan the download folder for existing media and if found, then mark the corresponding audiobook as already downloaded and link it. ### Why would this be helpful? When having to reset the app and re-login, I don't want to download my audiobooks again, that are already on the phone. I've set up a local folder containing all files. When selecting this folder again, ABS shows that there is no media (but the audiobook files are existing there). When downloading the audiobooks the app just overwrites the existing files. ### Future Implementation (Screenshot) In local folder option, add a new option to the three-dot-menu called "Scan folder for local media" ![image](https://github.com/user-attachments/assets/20f6421f-0fda-4aad-9f8f-2bd0fd5edf5c) ![image](https://github.com/user-attachments/assets/43a9de9f-3979-406a-a715-eb98b44c90a0) Of course in the correct languages ### Audiobookshelf App Version Android App - 0.9.76, Android App - 0.9.75 ### Current Implementation (Screenshot) Local Folder with files in it: ![image](https://github.com/user-attachments/assets/7985a3f5-1ae4-45e5-a89b-4e97a3eb29c8) App shows no dowloaded audiobooks: ![image](https://github.com/user-attachments/assets/8f1b5278-6768-4451-b86e-8eba96c52a26) App offers stream option and download option - no local play option: ![image](https://github.com/user-attachments/assets/6e6fec7e-67bc-449f-8bdd-595f994ff5a6)
adam added the enhancementandroid labels 2026-04-24 23:47:36 +02:00
Author
Owner

@nichwall commented on GitHub (Nov 4, 2024):

This functionality was removed in https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.67-beta

@nichwall commented on GitHub (Nov 4, 2024): This functionality was removed in https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.67-beta
Author
Owner

@DrakeHamString commented on GitHub (Nov 4, 2024):

Why?
This makes the user experience worse

Today I had to reset the app because it was crashing everytime when connecting to the server. After reset, I was able to use it again, but then I had to re-download every media...

@DrakeHamString commented on GitHub (Nov 4, 2024): Why? This makes the user experience worse Today I had to reset the app because it was crashing everytime when connecting to the server. After reset, I was able to use it again, but then I had to re-download every media...
Author
Owner

@realredknight commented on GitHub (Nov 10, 2024):

This is also useful when using more than one device - it would allow to push media files over USB instead of downloading over WAN one multiple devices.

@realredknight commented on GitHub (Nov 10, 2024): This is also useful when using more than one device - it would allow to push media files over USB instead of downloading over WAN one multiple devices.
Author
Owner

@Willt125 commented on GitHub (Nov 18, 2024):

I would've labeled this as a bug, because it's apparent that if the app has the ability to load local folders, and describes it as loading local media, that the app should load in the local media. I'm seeing this problem as well - Samsung Galaxy A15 5G, selecting a local folder with books does not register as containing books.
Screenshot_20241118_154409_Audiobookshelf
image

@Willt125 commented on GitHub (Nov 18, 2024): I would've labeled this as a bug, because it's apparent that if the app has the ability to load local folders, and describes it as loading local media, that the app should load in the local media. I'm seeing this problem as well - Samsung Galaxy A15 5G, selecting a local folder with books does not register as containing books. ![Screenshot_20241118_154409_Audiobookshelf](https://github.com/user-attachments/assets/08c94803-f777-4961-8b1b-23571348106a) ![image](https://github.com/user-attachments/assets/287dc47b-e899-4549-bd4e-11de147f5474)
Author
Owner

@nichwall commented on GitHub (Nov 18, 2024):

The "Local Books" folder is intended to allow you to download media from an ABS server and make the media available to other apps. The ABS app is not designed to play media from other sources (so added by other apps or manually editing the file system).

This functionality was removed due to complications in the backend. It may be added back in eventually, but likely not for a while.

@nichwall commented on GitHub (Nov 18, 2024): The "Local Books" folder is intended to allow you to download media from an ABS server and make the media available to other apps. The ABS app is not designed to play media from other sources (so added by other apps or manually editing the file system). This functionality was removed due to complications in the backend. It may be added back in eventually, but likely not for a while.
Author
Owner

@Willt125 commented on GitHub (Nov 18, 2024):

booooo, I solely downloaded this app with the intention of using it with local media (I don't feel like calling my ISP to try and get a static IP for this... yet)
One day, perhaps!

@Willt125 commented on GitHub (Nov 18, 2024): booooo, I solely downloaded this app with the intention of using it with local media (I don't feel like calling my ISP to try and get a static IP for this... yet) One day, perhaps!
Author
Owner

@DrakeHamString commented on GitHub (Nov 18, 2024):

The ABS app is not designed to play media from other sources

Thats not what I said - I want the app to show media that was previously downloaded by the app already! In my case I downloaded them, then had to reset the app and then had to download the media again!
The current situation is not what I want

@DrakeHamString commented on GitHub (Nov 18, 2024): > The ABS app is not designed to play media from other sources Thats not what I said - I want the app to show media that was previously downloaded by the app already! In my case I downloaded them, then had to reset the app and then had to download the media again! The current situation is not what I want
Author
Owner

@Willt125 commented on GitHub (Nov 18, 2024):

Oops, I might have caused that confusion there, sorry drake 😅

@Willt125 commented on GitHub (Nov 18, 2024): Oops, I might have caused that confusion there, sorry drake :sweat_smile:
Author
Owner

@dedors commented on GitHub (Jul 20, 2025):

The "Local Books" folder is intended to allow you to download media from an ABS server and make the media available to other apps. The ABS app is not designed to play media from other sources (so added by other apps or manually editing the file system).

I disagree that the sole intention to download media is to make it available to other apps. I download media so I can listen offline. This prevents playback interruptions in areas without cell reception and also consumes less battery.

For this reason, I definitely think the app should be able to re-import existing media that was previously downloaded by it. You could simply add a .json file with each download so the app can easily match the local file with the item on the server.

My audiobooks folder is filled with old downloads, all downloaded exclusively through the app. Since it's mixed with newly downloaded books, I can't just wipe the whole folder. This also becomes a problem when moving to a new phone, as the app data didn't transfer, leaving no way to import the old files (the files themself got transfered).

@dedors commented on GitHub (Jul 20, 2025): > The "Local Books" folder is intended to allow you to download media from an ABS server and make the media available to other apps. The ABS app is not designed to play media from other sources (so added by other apps or manually editing the file system). I disagree that the sole intention to download media is to make it available to other apps. I download media so I can listen offline. This prevents playback interruptions in areas without cell reception and also consumes less battery. For this reason, I definitely think the app should be able to re-import existing media that was previously downloaded by it. You could simply add a .json file with each download so the app can easily match the local file with the item on the server. My audiobooks folder is filled with old downloads, all downloaded exclusively through the app. Since it's mixed with newly downloaded books, I can't just wipe the whole folder. This also becomes a problem when moving to a new phone, as the app data didn't transfer, leaving no way to import the old files (the files themself got transfered).
Author
Owner

@mfulgo commented on GitHub (Oct 5, 2025):

I looked a bit into what it might take to implement support for this.

The best approach that I could come up with is along these lines:

  1. Before downloading the file(s), see if one(s) with the same name already exist in the local folder. If they do...
  2. Check the size in bytes of each file and compare it with what's returned from a HEAD request for the file's download URL. If those match, use the local file and add it to the item library tracking the downloads.

Unfortunately, the server returns a weak e-tag for each file, computed from a stat of the file, rather than a strong one from a hash that could better guarantee byte-for-byte-identical files... It also does not return an e-tag on the ZIP file that's given for the Item-level download stream (at least, on a HEAD request).

Another approach might be to scan the folders and pull out the items' UUIDs from the cover-{UUID}.jpg files. One could use those to link the folders with items from the server, with or without assuming that the rest of the files need to be checked against what's on the server.

@mfulgo commented on GitHub (Oct 5, 2025): I looked a bit into what it might take to implement support for this. The best approach that I could come up with is along these lines: 1. Before downloading the file(s), see if one(s) with the same name already exist in the local folder. If they do... 2. Check the size in bytes of each file and compare it with what's returned from a HEAD request for the file's download URL. If those match, use the local file and add it to the item library tracking the downloads. Unfortunately, the server returns a weak e-tag for each file, computed from a stat of the file, rather than a strong one from a hash that could better guarantee byte-for-byte-identical files... It also does not return an e-tag on the ZIP file that's given for the Item-level download stream (at least, on a HEAD request). Another approach might be to scan the folders and pull out the items' UUIDs from the `cover-{UUID}.jpg` files. One could use those to link the folders with items from the server, with or without assuming that the rest of the files need to be checked against what's on the server.
Author
Owner

@nichwall commented on GitHub (Oct 5, 2025):

The best approach that I could come up with is along these lines:

  1. Before downloading the file(s), see if one(s) with the same name already exist in the local folder. If they do...
  2. Check the size in bytes of each file and compare it with what's returned from a HEAD request for the file's download URL. If those match, use the local file and add it to the item library tracking the downloads.

This is the basic idea behind my rewrite of the download logic in https://github.com/advplyr/audiobookshelf-app/pull/1587, but there are still some bugs that need to be worked out and I haven't had time to revisit it.

@nichwall commented on GitHub (Oct 5, 2025): > The best approach that I could come up with is along these lines: > 1. Before downloading the file(s), see if one(s) with the same name already exist in the local folder. If they do... > 2. Check the size in bytes of each file and compare it with what's returned from a HEAD request for the file's download URL. If those match, use the local file and add it to the item library tracking the downloads. This is the basic idea behind my rewrite of the download logic in https://github.com/advplyr/audiobookshelf-app/pull/1587, but there are still some bugs that need to be worked out and I haven't had time to revisit it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1066