add POPULARITY time sortOrder
This commit is contained in:
@@ -11,4 +11,9 @@ enum class SortOrder {
|
||||
NEWEST_ASC,
|
||||
ALPHABETICAL,
|
||||
ALPHABETICAL_DESC,
|
||||
POPULARITY_HOUR,
|
||||
POPULARITY_TODAY,
|
||||
POPULARITY_WEEK,
|
||||
POPULARITY_MONTH,
|
||||
POPULARITY_YEAR,
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@ internal class BatoToParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.POPULARITY_YEAR,
|
||||
SortOrder.POPULARITY_MONTH,
|
||||
SortOrder.POPULARITY_WEEK,
|
||||
SortOrder.POPULARITY_TODAY,
|
||||
SortOrder.POPULARITY_HOUR,
|
||||
)
|
||||
|
||||
override val availableStates: Set<MangaState> = EnumSet.allOf(MangaState::class.java)
|
||||
@@ -108,6 +113,11 @@ internal class BatoToParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
SortOrder.POPULARITY -> append("views_a.za")
|
||||
SortOrder.NEWEST -> append("create.za")
|
||||
SortOrder.ALPHABETICAL -> append("title.az")
|
||||
SortOrder.POPULARITY_YEAR -> append("views_y.za")
|
||||
SortOrder.POPULARITY_MONTH -> append("views_m.za")
|
||||
SortOrder.POPULARITY_WEEK -> append("views_w.za")
|
||||
SortOrder.POPULARITY_TODAY -> append("views_d.za")
|
||||
SortOrder.POPULARITY_HOUR -> append("views_h.za")
|
||||
else -> append("update.za")
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context
|
||||
SortOrder.NEWEST_ASC -> "[createdAt]=asc"
|
||||
SortOrder.POPULARITY -> "[followedCount]=desc"
|
||||
SortOrder.POPULARITY_ASC -> "[followedCount]=asc"
|
||||
else -> "[latestUploadedChapter]=desc"
|
||||
},
|
||||
)
|
||||
filter.states.forEach {
|
||||
|
||||
@@ -66,6 +66,7 @@ class TuMangaOnlineParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
SortOrder.ALPHABETICAL_DESC -> "alphabetically&order_dir=desc"
|
||||
SortOrder.RATING -> "score&order_dir=desc"
|
||||
SortOrder.RATING_ASC -> "score&order_dir=asc"
|
||||
else -> "release_date&order_dir=desc"
|
||||
},
|
||||
)
|
||||
append("&filter_by=title")
|
||||
|
||||
@@ -57,48 +57,24 @@ internal class NHentaiParser(context: MangaLoaderContext) :
|
||||
}
|
||||
|
||||
is MangaListFilter.Advanced -> {
|
||||
if (filter.tags.size > 1 || (filter.tags.isNotEmpty() && filter.locale != null)) {
|
||||
append("/search/?q=")
|
||||
append(buildQuery(filter.tags, filter.locale).urlEncoded())
|
||||
if (filter.sortOrder == SortOrder.POPULARITY) {
|
||||
append("&sort=popular")
|
||||
}
|
||||
append("&")
|
||||
} else if (filter.tags.isNotEmpty()) {
|
||||
filter.tags.oneOrThrowIfMany()?.let {
|
||||
append("/tag/")
|
||||
append(it.key)
|
||||
}
|
||||
append("/")
|
||||
if (filter.sortOrder == SortOrder.POPULARITY) {
|
||||
append("popular")
|
||||
}
|
||||
if (page > 1) {
|
||||
append("?")
|
||||
}
|
||||
} else if (filter.locale != null) {
|
||||
append("/language/")
|
||||
append(filter.locale.toLanguagePath())
|
||||
append("/")
|
||||
if (filter.sortOrder == SortOrder.POPULARITY) {
|
||||
append("popular")
|
||||
}
|
||||
if (page > 1) {
|
||||
append("?")
|
||||
}
|
||||
} else {
|
||||
if (filter.sortOrder == SortOrder.POPULARITY) {
|
||||
append("/?sort=popular&")
|
||||
} else {
|
||||
append("/?")
|
||||
}
|
||||
append("/search/?q=pages:>0 ")
|
||||
// for Search with query
|
||||
// append(filter.query.urlEncoded())
|
||||
// append(' ')
|
||||
append(buildQuery(filter.tags, filter.locale).urlEncoded())
|
||||
when (filter.sortOrder) {
|
||||
SortOrder.POPULARITY -> append("&sort=popular")
|
||||
SortOrder.POPULARITY_TODAY -> append("&sort=popular-today")
|
||||
SortOrder.POPULARITY_WEEK -> append("&sort=popular-week")
|
||||
SortOrder.UPDATED -> {}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
null -> append("/?")
|
||||
null -> append("/search/?q=pages:>0 ")
|
||||
}
|
||||
if (page > 1) {
|
||||
append("page=")
|
||||
append("&page=")
|
||||
append(page.toString())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,13 +67,8 @@ class MangaWtfParser(
|
||||
SortOrder.POPULARITY -> "viewsCount,desc"
|
||||
SortOrder.RATING -> "likesCount,desc"
|
||||
SortOrder.NEWEST -> "createdAt,desc"
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.UPDATED_ASC,
|
||||
SortOrder.POPULARITY_ASC,
|
||||
SortOrder.RATING_ASC,
|
||||
SortOrder.NEWEST_ASC,
|
||||
-> throw IllegalArgumentException("Unsupported ${filter.sortOrder}")
|
||||
else -> throw IllegalArgumentException("Unsupported ${filter.sortOrder}")
|
||||
|
||||
},
|
||||
)
|
||||
if (filter.tags.isNotEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user