Skip to content

Commit 23033cd

Browse files
authored
Add background download support with notifications and concurrent queue
Add background download support with notifications and concurrent queue
2 parents 7b2fa64 + e0c5885 commit 23033cd

12 files changed

Lines changed: 777 additions & 6 deletions

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ As [Anna’s Archive](https://annas-archive.org/) Doesn't Have An API. The App W
5656
- Drag-to-reorder priority
5757
- Enable/disable instances
5858
- Automatic retry (2x per instance) with seamless fallback
59+
- **Background Downloads** - Download books in the background with progress notifications
60+
- Queue multiple books for simultaneous download
61+
- Progress notifications with real-time updates
62+
- Downloads continue even when app is in background
63+
- Visual download queue in Home, Search, and My Library pages
5964
- Trending Books
6065
- Download And Read Books With In-Built Viewer
6166
- Supports Epub And Pdf Formats
@@ -66,8 +71,6 @@ As [Anna’s Archive](https://annas-archive.org/) Doesn't Have An API. The App W
6671
## Roadmap 🎯
6772

6873
- Adding More Book Format supports (cbz,cbr,azw3,etc...)
69-
- Adding Support For Background Downloads
70-
- Adding Support For Multiple Downloads
7174
- Move existing books when changing the storage path
7275

7376
## Building from Source

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
>
44
<uses-permission android:name="android.permission.INTERNET" />
55
<uses-permission android:name="android.permission.WAKE_LOCK" />
6+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
7+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
8+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
69

710
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
811
<uses-permission android:name="android.permission.READ_MEDIA_VIDEOS" />

lib/main.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import 'package:openlib/ui/themes.dart';
2020

2121
import 'package:openlib/services/files.dart'
2222
show moveFilesToAndroidInternalStorage;
23+
import 'package:openlib/services/download_manager.dart';
2324
import 'package:openlib/state/state.dart'
2425
show
2526
selectedIndexProvider,
@@ -38,6 +39,8 @@ void main() async {
3839
}
3940

4041
MyLibraryDb dataBase = MyLibraryDb.instance;
42+
43+
await DownloadManager().initialize();
4144
bool isDarkMode =
4245
await dataBase.getPreference('darkMode') == 0 ? false : true;
4346
bool openPdfwithExternalapp = await dataBase

0 commit comments

Comments
 (0)