Add category filters to Upcoming calendar (#3607)
This commit is contained in:
@@ -14,7 +14,14 @@ class GetUpcomingManga(
|
||||
SManga.PUBLISHING_FINISHED.toLong(),
|
||||
)
|
||||
|
||||
suspend fun subscribe(): Flow<List<Manga>> {
|
||||
return mangaRepository.getUpcomingManga(includedStatuses)
|
||||
suspend fun subscribe(
|
||||
excludedCategories: List<Long>,
|
||||
includedCategories: List<Long>,
|
||||
): Flow<List<Manga>> {
|
||||
return mangaRepository.getUpcomingManga(
|
||||
includedStatuses,
|
||||
excludedCategories = excludedCategories,
|
||||
includedCategories = includedCategories,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,11 @@ interface MangaRepository {
|
||||
|
||||
suspend fun getDuplicateLibraryManga(id: Long, title: String): List<MangaWithChapterCount>
|
||||
|
||||
suspend fun getUpcomingManga(statuses: Set<Long>): Flow<List<Manga>>
|
||||
suspend fun getUpcomingManga(
|
||||
statuses: Set<Long>,
|
||||
excludedCategories: List<Long>,
|
||||
includedCategories: List<Long>,
|
||||
): Flow<List<Manga>>
|
||||
|
||||
suspend fun resetViewerFlags(): Boolean
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package tachiyomi.domain.upcoming.service
|
||||
|
||||
import tachiyomi.core.common.preference.Preference
|
||||
import tachiyomi.core.common.preference.PreferenceStore
|
||||
import tachiyomi.core.common.preference.getLongArray
|
||||
|
||||
class UpcomingPreferences(
|
||||
preferenceStore: PreferenceStore,
|
||||
) {
|
||||
|
||||
val filterIncludedCategories: Preference<List<Long>> = preferenceStore.getLongArray(
|
||||
"pref_filter_upcoming_included_categories",
|
||||
emptyList(),
|
||||
)
|
||||
|
||||
val filterExcludedCategories: Preference<List<Long>> = preferenceStore.getLongArray(
|
||||
"pref_filter_upcoming_excluded_categories",
|
||||
emptyList(),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user