Skip to content

Commit

Permalink
added main page sortby updated
Browse files Browse the repository at this point in the history
  • Loading branch information
NagaYZ authored and Koitharu committed Jul 5, 2024
1 parent 41ced8e commit a88a861
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ internal class MangaWorld(
override val availableSortOrders: Set<SortOrder> =
EnumSet.of(SortOrder.POPULARITY, SortOrder.ALPHABETICAL, SortOrder.NEWEST, SortOrder.ALPHABETICAL_DESC, SortOrder.UPDATED)

override val defaultSortOrder: SortOrder
get() = SortOrder.ALPHABETICAL

override val configKeyDomain = ConfigKey.Domain("mangaworld.ac")

override val availableStates: Set<MangaState> = EnumSet.of(MangaState.ONGOING, MangaState.FINISHED, MangaState.ABANDONED, MangaState.PAUSED)
Expand All @@ -39,6 +42,8 @@ internal class MangaWorld(
}

is MangaListFilter.Advanced -> {
if(filter.tags.isEmpty() && filter.states.isEmpty() && filter.sortOrder == SortOrder.UPDATED) return parseMangaList(webClient.httpGet("https://$domain/?page=$page").parseHtml())

if (filter.tags.isNotEmpty()) {
filter.tags.joinTo(this, "&") { it.key.substringAfter("archive?") }
}
Expand Down Expand Up @@ -107,15 +112,15 @@ internal class MangaWorld(
)
}

val tags = doc.select("div[aria-labelledby=typesDropdown] a").mapNotNullToSet {
val types = doc.select("div[aria-labelledby=typesDropdown] a").mapNotNullToSet {
MangaTag(
key = it.attr("href"),
title = it.text().toTitleCase(sourceLocale),
source = source,
)
}

return genres + tags
return genres + types
}

override suspend fun getDetails(manga: Manga): Manga {
Expand Down

0 comments on commit a88a861

Please sign in to comment.