MangAdventure: fix sort filter & description (#10074)
This commit is contained in:
parent
96d01c1285
commit
2cf0e7779f
|
@ -172,9 +172,13 @@ abstract class MangAdventure(
|
||||||
url = series.url
|
url = series.url
|
||||||
title = series.title
|
title = series.title
|
||||||
thumbnail_url = series.cover
|
thumbnail_url = series.cover
|
||||||
description = series.description?.plus(
|
description = buildString {
|
||||||
series.aliases?.joinToString("\n", "\n\nAlternative titles:\n")
|
series.description?.let(::append)
|
||||||
)
|
series.aliases.let {
|
||||||
|
if (!it.isNullOrEmpty())
|
||||||
|
it.joinTo(this, "\n", "\n\nAlternative titles:\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
author = series.authors?.joinToString()
|
author = series.authors?.joinToString()
|
||||||
artist = series.artists?.joinToString()
|
artist = series.artists?.joinToString()
|
||||||
genre = series.categories?.joinToString()
|
genre = series.categories?.joinToString()
|
||||||
|
|
|
@ -29,18 +29,18 @@ internal class Artist : Filter.Text("Artist"), UriFilter {
|
||||||
*/
|
*/
|
||||||
internal class SortOrder(
|
internal class SortOrder(
|
||||||
private val labels: Array<String>
|
private val labels: Array<String>
|
||||||
) : Filter.Sort("Sort", values, null), UriFilter {
|
) : Filter.Sort("Sort", labels, null), UriFilter {
|
||||||
override val param = "sort"
|
override val param = "sort"
|
||||||
|
|
||||||
override fun toString() = when (state?.ascending) {
|
override fun toString() = when (state?.ascending) {
|
||||||
null -> ""
|
null -> ""
|
||||||
true -> labels[state!!.index]
|
true -> sorts[state!!.index]
|
||||||
false -> "-" + labels[state!!.index]
|
false -> "-" + sorts[state!!.index]
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
/** The available sort order values. */
|
/** The available sort order values. */
|
||||||
private val values = arrayOf(
|
private val sorts = arrayOf(
|
||||||
"title", "views", "latest_upload", "chapter_count"
|
"title", "views", "latest_upload", "chapter_count"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class MangAdventureGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val themeClass = "MangAdventure"
|
override val themeClass = "MangAdventure"
|
||||||
|
|
||||||
override val baseVersionCode = 7
|
override val baseVersionCode = 8
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("Arc-Relight", "https://arc-relight.com", "en", className = "ArcRelight"),
|
SingleLang("Arc-Relight", "https://arc-relight.com", "en", className = "ArcRelight"),
|
||||||
|
|
Loading…
Reference in New Issue