|
|
|
@ -30,11 +30,19 @@ internal abstract class LikeMangaParser(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override val availableSortOrders: Set<SortOrder> =
|
|
|
|
override val availableSortOrders: Set<SortOrder> =
|
|
|
|
EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY, SortOrder.NEWEST)
|
|
|
|
EnumSet.of(
|
|
|
|
|
|
|
|
SortOrder.UPDATED,
|
|
|
|
|
|
|
|
SortOrder.POPULARITY,
|
|
|
|
|
|
|
|
SortOrder.NEWEST,
|
|
|
|
|
|
|
|
SortOrder.POPULARITY_TODAY,
|
|
|
|
|
|
|
|
SortOrder.POPULARITY_WEEK,
|
|
|
|
|
|
|
|
SortOrder.POPULARITY_MONTH,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
override val filterCapabilities: MangaListFilterCapabilities
|
|
|
|
override val filterCapabilities: MangaListFilterCapabilities
|
|
|
|
get() = MangaListFilterCapabilities(
|
|
|
|
get() = MangaListFilterCapabilities(
|
|
|
|
isSearchSupported = true,
|
|
|
|
isSearchSupported = true,
|
|
|
|
|
|
|
|
isSearchWithFiltersSupported = true,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
|
|
|
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
|
|
|
@ -48,50 +56,49 @@ internal abstract class LikeMangaParser(
|
|
|
|
append(domain)
|
|
|
|
append(domain)
|
|
|
|
append("/?act=search")
|
|
|
|
append("/?act=search")
|
|
|
|
|
|
|
|
|
|
|
|
when {
|
|
|
|
filter.query?.let {
|
|
|
|
!filter.query.isNullOrEmpty() -> {
|
|
|
|
append("&f")
|
|
|
|
append("&f")
|
|
|
|
append("[keyword]".urlEncoded())
|
|
|
|
append("[keyword]".urlEncoded())
|
|
|
|
append("=")
|
|
|
|
append("=")
|
|
|
|
append(filter.query.urlEncoded())
|
|
|
|
append(filter.query.urlEncoded())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else -> {
|
|
|
|
|
|
|
|
append("&f")
|
|
|
|
|
|
|
|
append("[sortby]".urlEncoded())
|
|
|
|
|
|
|
|
append("=")
|
|
|
|
|
|
|
|
when (order) {
|
|
|
|
|
|
|
|
SortOrder.POPULARITY -> append("hot")
|
|
|
|
|
|
|
|
SortOrder.UPDATED -> append("lastest-chap")
|
|
|
|
|
|
|
|
SortOrder.NEWEST -> append("lastest-manga")
|
|
|
|
|
|
|
|
else -> append("lastest-chap")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (filter.tags.isNotEmpty()) {
|
|
|
|
append("&f")
|
|
|
|
append("&f")
|
|
|
|
append("[sortby]".urlEncoded())
|
|
|
|
append("[genres]".urlEncoded())
|
|
|
|
append("=")
|
|
|
|
append("=")
|
|
|
|
when (order) {
|
|
|
|
filter.tags.oneOrThrowIfMany()?.let {
|
|
|
|
SortOrder.UPDATED -> append("lastest-chap")
|
|
|
|
append(it.key)
|
|
|
|
SortOrder.NEWEST -> append("lastest-manga")
|
|
|
|
}
|
|
|
|
SortOrder.POPULARITY -> append("top-manga")
|
|
|
|
}
|
|
|
|
SortOrder.POPULARITY_TODAY -> append("top-day")
|
|
|
|
|
|
|
|
SortOrder.POPULARITY_WEEK -> append("top-week")
|
|
|
|
|
|
|
|
SortOrder.POPULARITY_MONTH -> append("top-month")
|
|
|
|
|
|
|
|
else -> append("lastest-chap")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
filter.states.oneOrThrowIfMany()?.let {
|
|
|
|
if (filter.tags.isNotEmpty()) {
|
|
|
|
append("&f")
|
|
|
|
append("&f")
|
|
|
|
append("[status]".urlEncoded())
|
|
|
|
append("[genres]".urlEncoded())
|
|
|
|
append("=")
|
|
|
|
append("=")
|
|
|
|
append(
|
|
|
|
filter.tags.oneOrThrowIfMany()?.let {
|
|
|
|
when (it) {
|
|
|
|
append(it.key)
|
|
|
|
MangaState.ONGOING -> "in-process"
|
|
|
|
|
|
|
|
MangaState.FINISHED -> "complete"
|
|
|
|
|
|
|
|
MangaState.PAUSED -> "pause"
|
|
|
|
|
|
|
|
else -> "all"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
filter.states.oneOrThrowIfMany()?.let {
|
|
|
|
|
|
|
|
append("&f")
|
|
|
|
|
|
|
|
append("[status]".urlEncoded())
|
|
|
|
|
|
|
|
append("=")
|
|
|
|
|
|
|
|
append(
|
|
|
|
|
|
|
|
when (it) {
|
|
|
|
|
|
|
|
MangaState.ONGOING -> "in-process"
|
|
|
|
|
|
|
|
MangaState.FINISHED -> "complete"
|
|
|
|
|
|
|
|
MangaState.PAUSED -> "pause"
|
|
|
|
|
|
|
|
else -> "all"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (page > 1) {
|
|
|
|
if (page > 1) {
|
|
|
|
append("&pageNum=")
|
|
|
|
append("&pageNum=")
|
|
|
|
append(page)
|
|
|
|
append(page)
|
|
|
|
|