Add relevance sort order for good filters with text searches
Adding the added filter
This commit is contained in:
@@ -11,4 +11,7 @@ enum class SortOrder {
|
||||
NEWEST_ASC,
|
||||
ALPHABETICAL,
|
||||
ALPHABETICAL_DESC,
|
||||
ADDED,
|
||||
ADDED_ASC,
|
||||
RELEVANCE,
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context
|
||||
is MangaListFilter.Search -> {
|
||||
append("&title=")
|
||||
append(filter.query)
|
||||
append("&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic")
|
||||
append("&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic&order[relevance]=desc")
|
||||
}
|
||||
|
||||
is MangaListFilter.Advanced -> {
|
||||
@@ -99,10 +99,13 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context
|
||||
SortOrder.RATING_ASC -> "[rating]=asc"
|
||||
SortOrder.ALPHABETICAL -> "[title]=asc"
|
||||
SortOrder.ALPHABETICAL_DESC -> "[title]=desc"
|
||||
SortOrder.NEWEST -> "[createdAt]=desc"
|
||||
SortOrder.NEWEST_ASC -> "[createdAt]=asc"
|
||||
SortOrder.NEWEST -> "[year]=desc"
|
||||
SortOrder.NEWEST_ASC -> "[year]=asc"
|
||||
SortOrder.POPULARITY -> "[followedCount]=desc"
|
||||
SortOrder.POPULARITY_ASC -> "[followedCount]=asc"
|
||||
SortOrder.ADDED -> "[createdAt]=desc"
|
||||
SortOrder.ADDED_ASC -> "[createdAt]=asc"
|
||||
SortOrder.RELEVANCE -> "&order[relevance]=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")
|
||||
|
||||
@@ -67,13 +67,7 @@ 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