mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 10:19:22 +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)
|
if (isLockedFromSearch)
|
||||||
return chapterList
|
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) {
|
val sortFunction: (Chapter, Chapter) -> Int = when (manga.sorting) {
|
||||||
Manga.SORTING_SOURCE -> when (sortDescending()) {
|
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()) {
|
class ChapterFilter(val preferences: PreferencesHelper = Injekt.get(), val downloadManager: DownloadManager = Injekt.get()) {
|
||||||
|
|
||||||
// filters chapters based on the manga values
|
// 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 readEnabled = manga.readFilter == Manga.SHOW_READ
|
||||||
val unreadEnabled = manga.readFilter == Manga.SHOW_UNREAD
|
val unreadEnabled = manga.readFilter == Manga.SHOW_UNREAD
|
||||||
val downloadEnabled = manga.downloadedFilter == Manga.SHOW_DOWNLOADED
|
val downloadEnabled = manga.downloadedFilter == Manga.SHOW_DOWNLOADED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user