[YuriGarden] Fix order / path + Remove rating

master
dragonx943 10 months ago
parent d481ff416f
commit e6ca455254
No known key found for this signature in database
GPG Key ID: 903893883B4D575E

@ -41,11 +41,8 @@ internal abstract class YuriGardenParser(
.build() .build()
override val availableSortOrders: Set<SortOrder> = EnumSet.of( override val availableSortOrders: Set<SortOrder> = EnumSet.of(
SortOrder.RELEVANCE,
SortOrder.NEWEST, SortOrder.NEWEST,
SortOrder.NEWEST_ASC, SortOrder.NEWEST_ASC,
SortOrder.POPULARITY,
SortOrder.RATING,
) )
override val filterCapabilities: MangaListFilterCapabilities override val filterCapabilities: MangaListFilterCapabilities
@ -81,12 +78,9 @@ internal abstract class YuriGardenParser(
append("&sort=") append("&sort=")
append(when (order) { append(when (order) {
SortOrder.RELEVANCE -> "relevance"
SortOrder.NEWEST -> "newest" SortOrder.NEWEST -> "newest"
SortOrder.NEWEST_ASC -> "oldest" SortOrder.NEWEST_ASC -> "oldest"
SortOrder.RATING -> "rating" else -> "newest" // default
SortOrder.POPULARITY -> "popularity"
else -> "relevance"
}) })
if (!filter.query.isNullOrEmpty()) { if (!filter.query.isNullOrEmpty()) {
@ -102,11 +96,13 @@ internal abstract class YuriGardenParser(
MangaState.FINISHED -> "completed" MangaState.FINISHED -> "completed"
MangaState.PAUSED -> "hiatus" MangaState.PAUSED -> "hiatus"
MangaState.ABANDONED -> "cancelled" MangaState.ABANDONED -> "cancelled"
else -> "" else -> "all"
}) })
} }
} }
append("&full=true")
if (filter.tags.isNotEmpty()) { if (filter.tags.isNotEmpty()) {
append("&genre=") append("&genre=")
append(filter.tags.joinToString(separator = ",") { it.key }) append(filter.tags.joinToString(separator = ",") { it.key })
@ -139,7 +135,7 @@ internal abstract class YuriGardenParser(
description = jo.getString("description"), description = jo.getString("description"),
contentRating = if (jo.getBooleanOrDefault("r18", false)) ContentRating.ADULT else ContentRating.SUGGESTIVE, contentRating = if (jo.getBooleanOrDefault("r18", false)) ContentRating.ADULT else ContentRating.SUGGESTIVE,
source = source, source = source,
rating = jo.getFloatOrDefault("rating", -5f) / 5f, rating = RATING_UNKNOWN,
) )
} }
} }
@ -184,7 +180,6 @@ internal abstract class YuriGardenParser(
"cancelled" -> MangaState.ABANDONED "cancelled" -> MangaState.ABANDONED
else -> null else -> null
}, },
rating = json.getFloatOrDefault("rating", -5f) / 5f,
chapters = chaptersDeferred.await().mapChapters() { _, jo -> chapters = chaptersDeferred.await().mapChapters() { _, jo ->
val chapterId = jo.getLong("id") val chapterId = jo.getLong("id")
val pageUrls = jo.getJSONArray("pages").mapJSON { page -> val pageUrls = jo.getJSONArray("pages").mapJSON { page ->
Loading…
Cancel
Save