Global refactoring: migrate getList to new filter
parent
ae9a7c6090
commit
c5d3a7b0c1
@ -0,0 +1,22 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilterV2
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
|
||||
@InternalParsersApi
|
||||
abstract class SinglePageMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
) : MangaParser(context, source) {
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilterV2): List<Manga> {
|
||||
if (offset > 0) {
|
||||
return emptyList()
|
||||
}
|
||||
return getList(order, filter)
|
||||
}
|
||||
|
||||
abstract suspend fun getList(order: SortOrder, filter: MangaListFilterV2): List<Manga>
|
||||
}
|
||||
@ -1,21 +1,13 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import java.util.*
|
||||
|
||||
data class MangaListFilterCapabilities @InternalParsersApi constructor(
|
||||
val availableSortOrders: Set<SortOrder>,
|
||||
val availableTags: Set<MangaTag>,
|
||||
val availableStates: Set<MangaState>,
|
||||
val availableContentRating: Set<ContentRating>,
|
||||
val availableContentTypes: Set<ContentType>,
|
||||
val availableDemographics: Set<Demographic>,
|
||||
val availableLocales: Set<Locale>,
|
||||
val isMultipleTagsSupported: Boolean,
|
||||
val isTagsExclusionSupported: Boolean,
|
||||
val isSearchSupported: Boolean,
|
||||
val searchSupportedWithMultipleFilters: Boolean,
|
||||
val isSearchYearSupported: Boolean,
|
||||
val isSearchYearRangeSupported: Boolean,
|
||||
val isSearchOriginalLanguages: Boolean,
|
||||
val isSearchWithFiltersSupported: Boolean,
|
||||
val isYearSupported: Boolean = false,
|
||||
val isYearRangeSupported: Boolean = false,
|
||||
val isSourceLocaleSupported: Boolean = false,
|
||||
)
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import java.util.*
|
||||
|
||||
data class MangaListFilterOptions @InternalParsersApi constructor(
|
||||
val availableTags: Set<MangaTag>,
|
||||
val availableStates: Set<MangaState> = emptySet(),
|
||||
val availableContentRating: Set<ContentRating> = emptySet(),
|
||||
val availableContentTypes: Set<ContentType> = emptySet(),
|
||||
val availableDemographics: Set<Demographic> = emptySet(),
|
||||
val availableLocales: Set<Locale> = emptySet(),
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue