mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
Use generic for filterChapters to remove cast warning
This commit is contained in:
parent
23e7b380b0
commit
0670e00a09
@ -207,7 +207,7 @@ class MangaDetailsPresenter(
|
||||
if (isLockedFromSearch)
|
||||
return chapterList
|
||||
|
||||
val chapters = chapterFilter.filterChapters(chapterList, manga) as List<ChapterItem>
|
||||
val chapters = chapterFilter.filterChapters(chapterList, manga)
|
||||
|
||||
val sortFunction: (Chapter, Chapter) -> Int = when (manga.sorting) {
|
||||
Manga.SORTING_SOURCE -> when (sortDescending()) {
|
||||
|
@ -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<Chapter>, manga: Manga): List<Chapter> {
|
||||
fun <T : Chapter> filterChapters(chapters: List<T>, manga: Manga): List<T> {
|
||||
val readEnabled = manga.readFilter == Manga.SHOW_READ
|
||||
val unreadEnabled = manga.readFilter == Manga.SHOW_UNREAD
|
||||
val downloadEnabled = manga.downloadedFilter == Manga.SHOW_DOWNLOADED
|
||||
|
Loading…
Reference in New Issue
Block a user