From 0670e00a0919e609cb6ba0aea3961c1bd8f0e9b3 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 9 Aug 2020 16:13:56 -0400 Subject: [PATCH] Use generic for filterChapters to remove cast warning --- .../java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt | 2 +- .../main/java/eu/kanade/tachiyomi/util/chapter/ChapterFilter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 9fe2fef618..bd3ff0e994 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 @@ -207,7 +207,7 @@ class MangaDetailsPresenter( if (isLockedFromSearch) return chapterList - val chapters = chapterFilter.filterChapters(chapterList, manga) as List + val chapters = chapterFilter.filterChapters(chapterList, manga) val sortFunction: (Chapter, Chapter) -> Int = when (manga.sorting) { Manga.SORTING_SOURCE -> when (sortDescending()) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterFilter.kt b/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterFilter.kt index 6ee06e61bb..e348b63ff5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterFilter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterFilter.kt @@ -10,7 +10,7 @@ import uy.kohesive.injekt.api.get class ChapterFilter(val preferences: PreferencesHelper = Injekt.get(), val downloadManager: DownloadManager = Injekt.get()) { // filters chapters based on the manga values - fun filterChapters(chapters: List, manga: Manga): List { + fun filterChapters(chapters: List, manga: Manga): List { val readEnabled = manga.readFilter == Manga.SHOW_READ val unreadEnabled = manga.readFilter == Manga.SHOW_UNREAD val downloadEnabled = manga.downloadedFilter == Manga.SHOW_DOWNLOADED