Keyoapp: fix genres, add type/status filters, exclude novels - #18250
Open
JochemKuipers wants to merge 3 commits into
Open
Keyoapp: fix genres, add type/status filters, exclude novels#18250JochemKuipers wants to merge 3 commits into
JochemKuipers wants to merge 3 commits into
Conversation
Genres are rendered from an inline initializeDropdownMenu({ type:
"genre", items: [...] }) script payload rather than the old
#series_tags_page markup, so parseGenres() always returned empty and the
filter sheet only ever showed the "Press 'Reset'" placeholder. Parse the
script payload, keeping a DOM fallback in case the shape changes.
The same payload carries the type and status dropdowns, so expose those
as filter groups, send them as query params, and narrow the results
client-side on each entry's data-type and data-status attributes.
Fetching now runs off the main thread and guards against overlapping
requests when the filter sheet is reopened.
Novels leaked into every listing. Matching on :not([data-type=novel])
only worked on pages that emit that attribute, so detection also checks
the badge text and a "(Novel)" or "[ Novel ]" title marker, and is
applied to popular, latest and search theme-wide. Sources can disable it
via excludeNovels or adapt it by overriding isNovel().
Asmotoon drops its now-redundant selector overrides. ArtLapsa,
RitharScans and TimelessToons override searchMangaParse, so they apply
the novel filter explicitly. ArtLapsa also renders its filters as
Livewire <select> elements instead of the script payload and overrides
the three parse methods accordingly.
Genre filtering silently dropped matches across the whole ecosystem: card `tags` are frequently padded (e.g. `[" Fantasy", "Action "]`) and the client-side match used `equals(ignoreCase = true)`, which tolerates case but not surrounding whitespace. Trim tags before comparing, in the theme and in TimelessToons' overridden searchMangaParse. ArtLapsa and RitharScans filter server-side via single-value controls (a `<select>` and mutually-exclusive genre chips), so selecting more than one value sent a repeated query param of which the server keeps only the last, e.g. `?type=manhwa&type=manhua` returned only manhua and manhwa results silently disappeared. Model these as single-choice dropdowns: add a shared SelectFilter plus singleSelectFilterList() and HttpUrl.Builder.addSelectedTo() helpers, and have both sources opt in. Sites that return every entry for client-side narrowing keep the existing multi-select checkbox groups. Expose genresList/typesList/statusesList as protected read-only so sources can build their own filter lists off the fetched data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Genres are rendered from an inline
initializeDropdownMenu({ type: "genre", items: [...] })script payload rather than the old#series_tags_pagemarkup, soparseGenres()always returned empty and the filter sheet only ever showed the "Press 'Reset'" placeholder. Parse the script payload, keeping a DOM fallback in case the shape changes.The same payload carries the type and status dropdowns, so expose those as filter groups, send them as query params, and narrow the results client-side on each entry's
data-typeanddata-statusattributes. Fetching now runs off the main thread and guards against overlapping requests when the filter sheet is reopened.Genre matching was also silently dropping hits across the theme: card
tagsare frequently padded (e.g.[" Fantasy", "Action "]), and the client-side compare usedequals(ignoreCase = true), which tolerates case but not surrounding whitespace. Tags are trimmed before comparing in the theme and in TimelessToons' overriddensearchMangaParse.Most Keyoapp sites return every entry and filter client-side, so multi-select checkboxes are correct there. ArtLapsa and RitharScans filter server-side via single-value controls (a Livewire
<select>and mutually-exclusive genre chips), so selecting more than one value sent a repeated query param of which the server keeps only the last — e.g.?type=manhwa&type=manhuareturned only manhua, and manhwa results disappeared. Those sources now use a sharedSelectFilter/singleSelectFilterList()path that offers single-choice dropdowns instead.Novels leaked into every listing. Matching on
:not([data-type=novel])only worked on pages that emit that attribute, so detection also checks the badge text and a "(Novel)" or "[ Novel ]" title marker, and is applied to popular, latest and search theme-wide. Sources can disable it viaexcludeNovelsor adapt it by overridingisNovel(). ArtLapsa also strips Novel from its Type dropdown and deriveshasNextPagefrom the pre-filter entry count so novel exclusion cannot truncate pagination.Asmotoon drops its now-redundant selector overrides. ArtLapsa, RitharScans and TimelessToons override
searchMangaParse, so they apply the novel filter explicitly. ArtLapsa also parses its Livewire<select>options instead of the script payload.Checklist:
versionCodevalue inbuild.gradle.ktsbaseVersionCodeinbuild.gradle.kts(if updated multisrc theme code)contentWarningconfiguration inbuild.gradle.ktsappropriatelyidif a source's name or language were changedweb_hi_res_512.pngwhen adding a new extension🤖 This PR was opened with AI assistance. I was asked to fix the broken genre filter on Keyoapp sources, add the missing type and status filters, and stop novel entries from appearing in listings; the code changes were written by an AI agent and reviewed by the human opening this PR.