Add category filters to Upcoming calendar (#3607)

This commit is contained in:
MajorTanya
2026-08-04 12:30:23 +02:00
committed by GitHub
parent f7a1ecd251
commit a73271aefa
11 changed files with 299 additions and 25 deletions
@@ -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()
}