Add category filters to Upcoming calendar (#3607)
This commit is contained in:
@@ -87,12 +87,24 @@ class MangaRepositoryImpl(
|
||||
.awaitAsList()
|
||||
}
|
||||
|
||||
override suspend fun getUpcomingManga(statuses: Set<Long>): Flow<List<Manga>> {
|
||||
override suspend fun getUpcomingManga(
|
||||
statuses: Set<Long>,
|
||||
excludedCategories: List<Long>,
|
||||
includedCategories: List<Long>,
|
||||
): Flow<List<Manga>> {
|
||||
val timeZone = TimeZone.currentSystemDefault()
|
||||
val epochMillis =
|
||||
Clock.System.now().toLocalDateTime(timeZone).date.atStartOfDayIn(timeZone).toEpochMilliseconds()
|
||||
return database.mangasQueries
|
||||
.getUpcomingManga(epochMillis, statuses, MangaMapper::mapManga)
|
||||
.getUpcomingManga(
|
||||
startOfDay = epochMillis,
|
||||
statuses = statuses,
|
||||
includedEmpty = includedCategories.isEmpty(),
|
||||
includedCategories = includedCategories,
|
||||
excludedEmpty = excludedCategories.isEmpty(),
|
||||
excludedCategories = excludedCategories,
|
||||
mapper = MangaMapper::mapManga,
|
||||
)
|
||||
.subscribeToList()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user