Merge pull request #429 from KotatsuApp/Alpha-zaAndStateUpcoming
Add a new filter and a new state
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
enum class MangaState {
|
||||
ONGOING, FINISHED, ABANDONED, PAUSED
|
||||
ONGOING, FINISHED, ABANDONED, PAUSED, UPCOMING
|
||||
}
|
||||
|
||||
@@ -5,5 +5,6 @@ enum class SortOrder {
|
||||
POPULARITY,
|
||||
RATING,
|
||||
NEWEST,
|
||||
ALPHABETICAL
|
||||
}
|
||||
ALPHABETICAL,
|
||||
ALPHABETICAL_DESC
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ internal class BatoToParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
MangaState.FINISHED -> "completed"
|
||||
MangaState.ABANDONED -> "cancelled"
|
||||
MangaState.PAUSED -> "hiatus"
|
||||
MangaState.UPCOMING -> "pending"
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,8 @@ internal class ComickFunParser(context: MangaLoaderContext) : PagedMangaParser(c
|
||||
SortOrder.RATING,
|
||||
)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.allOf(MangaState::class.java)
|
||||
override val availableStates: Set<MangaState> =
|
||||
EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.PAUSED, MangaState.ABANDONED)
|
||||
|
||||
@Volatile
|
||||
private var cachedTags: SparseArrayCompat<MangaTag>? = null
|
||||
@@ -75,6 +76,7 @@ internal class ComickFunParser(context: MangaLoaderContext) : PagedMangaParser(c
|
||||
MangaState.FINISHED -> "2"
|
||||
MangaState.ABANDONED -> "3"
|
||||
MangaState.PAUSED -> "4"
|
||||
else -> ""
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ internal class ExHentaiParser(
|
||||
return getOrCreateTagMap().values.toSet()
|
||||
}
|
||||
|
||||
protected suspend fun getOrCreateTagMap(): Map<String, MangaTag> = mutex.withLock {
|
||||
private suspend fun getOrCreateTagMap(): Map<String, MangaTag> = mutex.withLock {
|
||||
tagCache?.let { return@withLock it }
|
||||
val tagMap = ArrayMap<String, MangaTag>()
|
||||
val tagElements = tags.split(",")
|
||||
|
||||
@@ -32,7 +32,8 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context
|
||||
|
||||
override val availableSortOrders: EnumSet<SortOrder> = EnumSet.allOf(SortOrder::class.java)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.allOf(MangaState::class.java)
|
||||
override val availableStates: Set<MangaState> =
|
||||
EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.PAUSED, MangaState.ABANDONED)
|
||||
|
||||
|
||||
override suspend fun getList(offset: Int, filter: MangaListFilter?): List<Manga> {
|
||||
@@ -66,6 +67,7 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context
|
||||
SortOrder.UPDATED -> "[latestUploadedChapter]=desc"
|
||||
SortOrder.RATING -> "[rating]=desc"
|
||||
SortOrder.ALPHABETICAL -> "[title]=asc"
|
||||
SortOrder.ALPHABETICAL_DESC -> "[title]=desc"
|
||||
SortOrder.NEWEST -> "[createdAt]=desc"
|
||||
SortOrder.POPULARITY -> "[followedCount]=desc"
|
||||
},
|
||||
@@ -77,6 +79,7 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context
|
||||
MangaState.FINISHED -> append("completed")
|
||||
MangaState.ABANDONED -> append("cancelled")
|
||||
MangaState.PAUSED -> append("hiatus")
|
||||
else -> append("")
|
||||
}
|
||||
}
|
||||
filter.locale?.let {
|
||||
|
||||
@@ -55,6 +55,7 @@ internal class MangaPark(context: MangaLoaderContext) :
|
||||
MangaState.FINISHED -> "completed"
|
||||
MangaState.PAUSED -> "hiatus"
|
||||
MangaState.ABANDONED -> "cancelled"
|
||||
MangaState.UPCOMING -> "pending"
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -67,6 +68,7 @@ internal class MangaPark(context: MangaLoaderContext) :
|
||||
SortOrder.NEWEST -> "field_create"
|
||||
SortOrder.ALPHABETICAL -> "field_name"
|
||||
SortOrder.RATING -> "field_score"
|
||||
else -> ""
|
||||
|
||||
},
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ internal class PapScan(context: MangaLoaderContext) :
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, filter: MangaListFilter?): List<Manga> {
|
||||
@@ -50,7 +51,8 @@ internal class PapScan(context: MangaLoaderContext) :
|
||||
append("&sortBy=")
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("views")
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("name&asc=false")
|
||||
SortOrder.ALPHABETICAL -> append("name&asc=true")
|
||||
else -> append("updated")
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ internal class FlixScans(context: MangaLoaderContext) : PagedMangaParser(context
|
||||
MangaState.FINISHED -> "completed"
|
||||
MangaState.ABANDONED -> "droped"
|
||||
MangaState.PAUSED -> "onhold"
|
||||
MangaState.UPCOMING -> "soon"
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ class Manhwa18Parser(context: MangaLoaderContext) :
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.ALPHABETICAL -> "az"
|
||||
SortOrder.ALPHABETICAL_DESC -> "za"
|
||||
SortOrder.POPULARITY -> "top"
|
||||
SortOrder.UPDATED -> "update"
|
||||
SortOrder.NEWEST -> "new"
|
||||
|
||||
@@ -26,6 +26,7 @@ class TuMangaOnlineParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.POPULARITY,
|
||||
@@ -48,15 +49,14 @@ class TuMangaOnlineParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
append("?order_item=")
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> "likes_count"
|
||||
SortOrder.UPDATED -> "release_date"
|
||||
SortOrder.NEWEST -> "creation"
|
||||
SortOrder.ALPHABETICAL -> "alphabetically"
|
||||
SortOrder.RATING -> "score"
|
||||
|
||||
SortOrder.POPULARITY -> "likes_count&order_dir=desc"
|
||||
SortOrder.UPDATED -> "release_date&order_dir=desc"
|
||||
SortOrder.NEWEST -> "creation&order_dir=desc"
|
||||
SortOrder.ALPHABETICAL -> "alphabetically&order_dir=asc"
|
||||
SortOrder.ALPHABETICAL_DESC -> "alphabetically&order_dir=desc"
|
||||
SortOrder.RATING -> "score&order_dir=desc"
|
||||
},
|
||||
)
|
||||
append("&order_dir=desc")
|
||||
append("&filter_by=title")
|
||||
if (filter.tags.isNotEmpty()) {
|
||||
for (tag in filter.tags) {
|
||||
|
||||
@@ -25,6 +25,7 @@ internal abstract class FmreaderParser(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.of(
|
||||
@@ -85,7 +86,8 @@ internal abstract class FmreaderParser(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("views")
|
||||
SortOrder.UPDATED -> append("last_update")
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.ALPHABETICAL -> append("name&sort_type=ASC")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("name&sort_type=DESC")
|
||||
else -> append("last_update")
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ internal class Manhwa18Com(context: MangaLoaderContext) :
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.ALPHABETICAL -> "az"
|
||||
SortOrder.ALPHABETICAL_DESC -> "za"
|
||||
SortOrder.POPULARITY -> "top"
|
||||
SortOrder.UPDATED -> "update"
|
||||
SortOrder.NEWEST -> "new"
|
||||
|
||||
@@ -44,7 +44,8 @@ internal class OlimpoScans(context: MangaLoaderContext) :
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("views")
|
||||
SortOrder.UPDATED -> append("last_update")
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.ALPHABETICAL -> append("name&sort_type=ASC")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("name&sort_type=DESC")
|
||||
else -> append("last_update")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,13 @@ internal class BentomangaParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
SortOrder.RATING,
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
)
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("bentomanga.com", "www.bentomanga.com")
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.allOf(MangaState::class.java)
|
||||
override val availableStates: Set<MangaState> =
|
||||
EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.PAUSED, MangaState.ABANDONED)
|
||||
|
||||
init {
|
||||
paginator.firstPage = 0
|
||||
@@ -54,7 +56,8 @@ internal class BentomangaParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
SortOrder.POPULARITY -> "views"
|
||||
SortOrder.RATING -> "top"
|
||||
SortOrder.NEWEST -> "create"
|
||||
SortOrder.ALPHABETICAL -> "name"
|
||||
SortOrder.ALPHABETICAL -> "name&order=asc"
|
||||
SortOrder.ALPHABETICAL_DESC -> "name&order=desc"
|
||||
},
|
||||
)
|
||||
|
||||
@@ -70,6 +73,7 @@ internal class BentomangaParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
MangaState.FINISHED -> "2"
|
||||
MangaState.PAUSED -> "3"
|
||||
MangaState.ABANDONED -> "5"
|
||||
else -> "1"
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ internal class LugnicaScans(context: MangaLoaderContext) : PagedMangaParser(cont
|
||||
SortOrder.UPDATED,
|
||||
)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.allOf(MangaState::class.java)
|
||||
override val availableStates: Set<MangaState> =
|
||||
EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.PAUSED, MangaState.ABANDONED)
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("lugnica-scans.com")
|
||||
|
||||
@@ -68,6 +69,7 @@ internal class LugnicaScans(context: MangaLoaderContext) : PagedMangaParser(cont
|
||||
MangaState.FINISHED -> append("1")
|
||||
MangaState.PAUSED -> append("4")
|
||||
MangaState.ABANDONED -> append("3")
|
||||
else -> append("")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ internal abstract class HeanCms(
|
||||
SortOrder.POPULARITY,
|
||||
)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.allOf(MangaState::class.java)
|
||||
override val availableStates: Set<MangaState> =
|
||||
EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.PAUSED, MangaState.ABANDONED)
|
||||
|
||||
override val headers: Headers = Headers.Builder()
|
||||
.add("User-Agent", UserAgents.CHROME_DESKTOP)
|
||||
@@ -56,18 +57,19 @@ internal abstract class HeanCms(
|
||||
MangaState.FINISHED -> "Completed"
|
||||
MangaState.ABANDONED -> "Dropped"
|
||||
MangaState.PAUSED -> "Hiatus"
|
||||
else -> ""
|
||||
},
|
||||
)
|
||||
|
||||
}
|
||||
append("&order=desc")
|
||||
append("&orderBy=")
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("total_views")
|
||||
SortOrder.UPDATED -> append("latest")
|
||||
SortOrder.NEWEST -> append("created_at")
|
||||
SortOrder.ALPHABETICAL -> append("title")
|
||||
else -> append("latest")
|
||||
SortOrder.POPULARITY -> append("total_views&order=desc")
|
||||
SortOrder.UPDATED -> append("latest&order=desc")
|
||||
SortOrder.NEWEST -> append("created_at&order=desc")
|
||||
SortOrder.ALPHABETICAL -> append("title&order=desc")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("title&order=asc")
|
||||
else -> append("latest&order=desc")
|
||||
}
|
||||
append("&series_type=Comic&perPage=12")
|
||||
append("&tags_ids=")
|
||||
|
||||
@@ -33,18 +33,19 @@ internal class YugenMangasEs(context: MangaLoaderContext) :
|
||||
MangaState.FINISHED -> "Completed"
|
||||
MangaState.ABANDONED -> "Dropped"
|
||||
MangaState.PAUSED -> "Hiatus"
|
||||
else -> ""
|
||||
},
|
||||
)
|
||||
|
||||
}
|
||||
append("&order=desc")
|
||||
append("&orderBy=")
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("total_views")
|
||||
SortOrder.UPDATED -> append("latest")
|
||||
SortOrder.NEWEST -> append("created_at")
|
||||
SortOrder.ALPHABETICAL -> append("title")
|
||||
else -> append("latest")
|
||||
SortOrder.POPULARITY -> append("total_views&order=desc")
|
||||
SortOrder.UPDATED -> append("latest&order=desc")
|
||||
SortOrder.NEWEST -> append("created_at&order=desc")
|
||||
SortOrder.ALPHABETICAL -> append("title&order=desc")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("title&order=asc")
|
||||
else -> append("latest&order=desc")
|
||||
}
|
||||
append("&series_type=Comic&perPage=12")
|
||||
append("&tags_ids=")
|
||||
|
||||
@@ -151,6 +151,15 @@ internal abstract class MadaraParser(
|
||||
"En attente",
|
||||
)
|
||||
|
||||
@JvmField
|
||||
protected val upcoming: Set<String> = hashSetOf(
|
||||
"Upcoming",
|
||||
"upcoming",
|
||||
"لم تُنشَر بعد",
|
||||
"Prochainement",
|
||||
"À venir",
|
||||
)
|
||||
|
||||
// Change these values only if the site does not support manga listings via ajax
|
||||
protected open val withoutAjax = false
|
||||
|
||||
@@ -203,6 +212,7 @@ internal abstract class MadaraParser(
|
||||
MangaState.FINISHED -> append("end")
|
||||
MangaState.ABANDONED -> append("canceled")
|
||||
MangaState.PAUSED -> append("on-hold")
|
||||
MangaState.UPCOMING -> append("upcoming")
|
||||
}
|
||||
}
|
||||
append("&")
|
||||
@@ -215,6 +225,7 @@ internal abstract class MadaraParser(
|
||||
SortOrder.NEWEST -> append("new-manga")
|
||||
SortOrder.ALPHABETICAL -> append("alphabet")
|
||||
SortOrder.RATING -> append("rating")
|
||||
else -> append("latest")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,6 +266,7 @@ internal abstract class MadaraParser(
|
||||
}
|
||||
|
||||
SortOrder.RATING -> {}
|
||||
else -> payload["vars[meta_key]"] = "_latest_update"
|
||||
}
|
||||
|
||||
filter.states.forEach {
|
||||
@@ -264,6 +276,7 @@ internal abstract class MadaraParser(
|
||||
MangaState.FINISHED -> "end"
|
||||
MangaState.ABANDONED -> "canceled"
|
||||
MangaState.PAUSED -> "on-hold"
|
||||
MangaState.UPCOMING -> "upcoming"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,6 +323,7 @@ internal abstract class MadaraParser(
|
||||
in finished -> MangaState.FINISHED
|
||||
in abandoned -> MangaState.ABANDONED
|
||||
in paused -> MangaState.PAUSED
|
||||
in upcoming -> MangaState.UPCOMING
|
||||
else -> null
|
||||
},
|
||||
source = source,
|
||||
|
||||
@@ -75,7 +75,7 @@ internal class FireScans(context: MangaLoaderContext) :
|
||||
}
|
||||
}
|
||||
|
||||
fun String.decodeHex(): ByteArray {
|
||||
private fun String.decodeHex(): ByteArray {
|
||||
check(length % 2 == 0) { "Must have an even length" }
|
||||
|
||||
return chunked(2).map { it.toInt(16).toByte() }.toByteArray()
|
||||
|
||||
@@ -68,6 +68,7 @@ internal class Hentai4Free(context: MangaLoaderContext) :
|
||||
SortOrder.NEWEST -> append("new-manga")
|
||||
SortOrder.ALPHABETICAL -> append("alphabet")
|
||||
SortOrder.RATING -> append("rating")
|
||||
else -> append("latest")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ internal class IsekaiScanEuParser(context: MangaLoaderContext) :
|
||||
MangaState.FINISHED -> append("end")
|
||||
MangaState.ABANDONED -> append("canceled")
|
||||
MangaState.PAUSED -> append("on-hold")
|
||||
MangaState.UPCOMING -> append("upcoming")
|
||||
}
|
||||
}
|
||||
append("&")
|
||||
@@ -73,6 +74,7 @@ internal class IsekaiScanEuParser(context: MangaLoaderContext) :
|
||||
SortOrder.NEWEST -> append("new-manga")
|
||||
SortOrder.ALPHABETICAL -> append("alphabet")
|
||||
SortOrder.RATING -> append("rating")
|
||||
else -> append("latest")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ internal class MangaDass(context: MangaLoaderContext) :
|
||||
SortOrder.NEWEST -> append("new-manga")
|
||||
SortOrder.ALPHABETICAL -> append("alphabet")
|
||||
SortOrder.RATING -> append("rating")
|
||||
else -> append("latest")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ internal abstract class MadthemeParser(
|
||||
SortOrder.ALPHABETICAL -> append("name") // On some sites without tags or searches, the alphabetical option is empty.
|
||||
SortOrder.NEWEST -> append("created_at")
|
||||
SortOrder.RATING -> append("rating")
|
||||
else -> append("updated_at")
|
||||
}
|
||||
if (filter.tags.isNotEmpty()) {
|
||||
filter.tags.forEach {
|
||||
|
||||
@@ -35,6 +35,7 @@ internal class ManhuaScan(context: MangaLoaderContext) :
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.NEWEST -> append("created_at")
|
||||
SortOrder.RATING -> append("rating")
|
||||
else -> append("updated_at")
|
||||
}
|
||||
if (filter.tags.isNotEmpty()) {
|
||||
filter.tags.forEach {
|
||||
|
||||
@@ -30,7 +30,13 @@ internal abstract class MangaReaderParser(
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
override val availableSortOrders: Set<SortOrder>
|
||||
get() = EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY, SortOrder.ALPHABETICAL, SortOrder.NEWEST)
|
||||
get() = EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.NEWEST,
|
||||
)
|
||||
|
||||
override val availableStates: Set<MangaState>
|
||||
get() = EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.PAUSED)
|
||||
@@ -63,6 +69,7 @@ internal abstract class MangaReaderParser(
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.ALPHABETICAL -> "title"
|
||||
SortOrder.ALPHABETICAL_DESC -> "titlereverse"
|
||||
SortOrder.NEWEST -> "latest"
|
||||
SortOrder.POPULARITY -> "popular"
|
||||
SortOrder.UPDATED -> "update"
|
||||
|
||||
@@ -36,6 +36,7 @@ internal class SwaTeam(context: MangaLoaderContext) :
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.ALPHABETICAL -> "a-z"
|
||||
SortOrder.ALPHABETICAL_DESC -> "z-a"
|
||||
SortOrder.NEWEST -> "added"
|
||||
SortOrder.POPULARITY -> "popular"
|
||||
SortOrder.UPDATED -> "update"
|
||||
|
||||
@@ -41,6 +41,7 @@ internal class KomikSan(context: MangaLoaderContext) :
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.ALPHABETICAL -> "title"
|
||||
SortOrder.ALPHABETICAL_DESC -> "titlereverse"
|
||||
SortOrder.NEWEST -> "latest"
|
||||
SortOrder.POPULARITY -> "popular"
|
||||
SortOrder.UPDATED -> "update"
|
||||
|
||||
@@ -44,6 +44,7 @@ internal class Komikcast(context: MangaLoaderContext) :
|
||||
append(
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.ALPHABETICAL -> "&orderby=titleasc"
|
||||
SortOrder.ALPHABETICAL_DESC -> "&orderby=titledesc"
|
||||
SortOrder.POPULARITY -> "&orderby=popular"
|
||||
SortOrder.UPDATED -> "" // To get the Updated list, you don't need "orderby" in the url.
|
||||
else -> ""
|
||||
|
||||
@@ -97,14 +97,15 @@ internal abstract class MmrcmsParser(
|
||||
append(listUrl)
|
||||
append("/?page=")
|
||||
append(page.toString())
|
||||
append("&asc=true&author=&tag=&alpha=&cat=")
|
||||
append("&author=&tag=&alpha=&cat=")
|
||||
filter.tags.oneOrThrowIfMany()?.let {
|
||||
append(it.key)
|
||||
}
|
||||
append("&sortBy=")
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("views")
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.POPULARITY -> append("views&asc=true")
|
||||
SortOrder.ALPHABETICAL -> append("name&asc=true")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("name&asc=false")
|
||||
else -> append("name")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,13 @@ import java.util.*
|
||||
class LerManga(context: MangaLoaderContext) : PagedMangaParser(context, MangaSource.LERMANGA, 24) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> =
|
||||
EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY, SortOrder.ALPHABETICAL, SortOrder.RATING)
|
||||
EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.RATING,
|
||||
)
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("lermanga.org")
|
||||
|
||||
@@ -52,6 +58,7 @@ class LerManga(context: MangaLoaderContext) : PagedMangaParser(context, MangaSou
|
||||
SortOrder.UPDATED -> "modified&order=desc"
|
||||
SortOrder.POPULARITY -> "views&order=desc"
|
||||
SortOrder.ALPHABETICAL -> "title&order=asc"
|
||||
SortOrder.ALPHABETICAL_DESC -> "title&order=desc"
|
||||
SortOrder.RATING -> "rating&order=desc"
|
||||
else -> "modified&order=desc"
|
||||
},
|
||||
|
||||
@@ -276,6 +276,7 @@ internal abstract class GroupleParser(
|
||||
SortOrder.UPDATED -> "updated"
|
||||
SortOrder.NEWEST -> "created"
|
||||
SortOrder.RATING -> "votes"
|
||||
else -> null
|
||||
}
|
||||
|
||||
private suspend fun advancedSearch(domain: String, tags: Set<MangaTag>): Response {
|
||||
|
||||
@@ -19,7 +19,7 @@ class TrWebtoon(context: MangaLoaderContext) :
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("trwebtoon.com")
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> =
|
||||
EnumSet.of(SortOrder.POPULARITY, SortOrder.ALPHABETICAL, SortOrder.UPDATED)
|
||||
EnumSet.of(SortOrder.POPULARITY, SortOrder.ALPHABETICAL, SortOrder.ALPHABETICAL_DESC, SortOrder.UPDATED)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.of(MangaState.ONGOING, MangaState.FINISHED)
|
||||
|
||||
@@ -77,6 +77,7 @@ class TrWebtoon(context: MangaLoaderContext) :
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("views&short_type=DESC")
|
||||
SortOrder.ALPHABETICAL -> append("name&short_type=ASC")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("name&short_type=DESC")
|
||||
else -> append("views&short_type=DESC")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ internal class LxManga(context: MangaLoaderContext) : PagedMangaParser(context,
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.POPULARITY,
|
||||
@@ -76,6 +77,7 @@ internal class LxManga(context: MangaLoaderContext) : PagedMangaParser(context,
|
||||
SortOrder.UPDATED -> append("-updated_at")
|
||||
SortOrder.NEWEST -> append("-created_at")
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("-name")
|
||||
else -> append("-updated_at")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ class TruyentranhLHParser(context: MangaLoaderContext) :
|
||||
SortOrder.RATING -> "like"
|
||||
SortOrder.POPULARITY -> "top"
|
||||
SortOrder.ALPHABETICAL -> "az"
|
||||
SortOrder.ALPHABETICAL_DESC -> "za"
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ internal abstract class ZMangaParser(
|
||||
SortOrder.POPULARITY -> append("popular")
|
||||
SortOrder.UPDATED -> append("update")
|
||||
SortOrder.ALPHABETICAL -> append("title")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("titlereverse")
|
||||
SortOrder.NEWEST -> append("latest")
|
||||
SortOrder.RATING -> append("rating")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user