mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 20:48:56 +01:00
Download manager rewrite (#535)
* Saving to SD working * Rename imagePath to uri * Handle android < 21 * Minor changes * Separate downloader from the manager. Optimize folder lookups * Persist downloads across restarts * Fix for #511 * Updated ReactiveNetwork. Add some documentation * More documentation and minor fixes * Handle persistent notifications. Other minor changes * Improve downloader and add documentation * Rename pageNumber to index in Page class * Remove unused methods * Use chop method * Make sure dest dir is created * Reset downloads dir preference * Use invalidate options menu in download fragment and fix wrong condition * Fix empty download queue after application restart * Use addAll method in download queue to avoid too many notifications * Inform download manager changes
This commit is contained in:
@@ -185,15 +185,10 @@ class LibraryPresenter : BasePresenter<LibraryFragment>() {
|
||||
}
|
||||
|
||||
if (prefFilterDownloaded) {
|
||||
val mangaDir = downloadManager.getAbsoluteMangaDirectory(source, manga)
|
||||
val mangaDir = downloadManager.findMangaDir(source, manga)
|
||||
|
||||
if (mangaDir.exists()) {
|
||||
for (file in mangaDir.listFiles()) {
|
||||
if (file.isDirectory && file.listFiles().isNotEmpty()) {
|
||||
hasDownloaded = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (mangaDir != null) {
|
||||
hasDownloaded = mangaDir.listFiles()?.any { it.isDirectory } ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user