Filter out tmp directories for download badge
This commit is contained in:
parent
9588a582ce
commit
6f84815801
@ -100,7 +100,9 @@ class DownloadCache(
|
||||
if (sourceDir != null) {
|
||||
val mangaDir = sourceDir.files[provider.getMangaDirName(manga)]
|
||||
if (mangaDir != null) {
|
||||
return mangaDir.files.size
|
||||
return mangaDir.files
|
||||
.filter { !it.endsWith(Downloader.TMP_DIR_SUFFIX) }
|
||||
.size
|
||||
}
|
||||
}
|
||||
return 0
|
||||
|
@ -246,7 +246,7 @@ class Downloader(
|
||||
private fun downloadChapter(download: Download): Observable<Download> = Observable.defer {
|
||||
val chapterDirname = provider.getChapterDirName(download.chapter)
|
||||
val mangaDir = provider.getMangaDir(download.manga, download.source)
|
||||
val tmpDir = mangaDir.createDirectory("${chapterDirname}_tmp")
|
||||
val tmpDir = mangaDir.createDirectory(chapterDirname + TMP_DIR_SUFFIX)
|
||||
|
||||
val pageListObservable = if (download.pages == null) {
|
||||
// Pull page list from network and add them to download object
|
||||
@ -436,4 +436,8 @@ class Downloader(
|
||||
return queue.none { it.status <= Download.DOWNLOADING }
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TMP_DIR_SUFFIX = "_tmp"
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user