diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt index af6448a1d0..78e81608af 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt @@ -347,7 +347,7 @@ class MangaDetailsPresenter( * @param chapters the list of chapters to download. */ fun downloadChapters(chapters: List) { - downloadManager.downloadChapters(manga, chapters) + downloadManager.downloadChapters(manga, chapters.filter { !it.isDownloaded }) } fun restartDownloads() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt index 3ab159237c..44e4a98f04 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt @@ -55,8 +55,9 @@ object ImageUtil { return null } - fun autoSetBackground(image: Bitmap, useWhiteAlways: Boolean): Drawable { + fun autoSetBackground(image: Bitmap?, useWhiteAlways: Boolean): Drawable { val backgroundColor = if (useWhiteAlways) Color.WHITE else android.R.attr.colorBackground + if (image == null) return ColorDrawable(backgroundColor) if (image.width < 50 || image.height < 50) return ColorDrawable(backgroundColor) val top = 5