Keep installed NSFW extensions visible when NSFW toggle is off - #3747
Open
Hisham-AlAhmad wants to merge 1 commit into
Open
Keep installed NSFW extensions visible when NSFW toggle is off#3747Hisham-AlAhmad wants to merge 1 commit into
Hisham-AlAhmad wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adjusts NSFW handling for extensions so the “Show NSFW (18+) sources” preference only affects discovery of new NSFW extensions, while keeping already-installed NSFW extensions loaded and visible (so they remain usable and can be updated).
Changes:
- Removed the load-time rejection of NSFW-flagged installed extensions in
ExtensionLoader. - Removed NSFW-based filtering from the installed extensions list in
GetExtensionsByTypewhile keeping the filter for available (not installed) extensions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt | Always loads installed extensions (including NSFW) and preserves the NSFW flag for UI/badging. |
| app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionsByType.kt | Stops hiding installed NSFW extensions when the NSFW toggle is off; keeps gating discovery for available extensions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+24
to
26
| // Installed extensions are always shown regardless of the NSFW preference; the | ||
| // toggle only controls discovery of new NSFW extensions (see `available` below). | ||
| val (updates, installed) = _installed |
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.
Keep installed NSFW extensions visible when the NSFW toggle is off
Closes #1673
Problem
Turning off Settings → Browse → "Show NSFW (18+) sources" removed any
NSFW-flagged extension from the app — including ones the user had already
installed and was actively using. This also silently stopped those
extensions from receiving updates, since they no longer loaded at all.
Root cause
ExtensionLoader.loadExtension()runs once per installed package (atstartup and after install/update) and short-circuited with
LoadResult.Errorwhenever the extension was NSFW-flagged and thepreference was off. That kept the extension out of
installedExtensionMapFlowentirely — it never loaded, so it couldn'tappear in the UI or be matched up for updates.
GetExtensionsByTypeadditionally filtered the installed list by the samepreference, which would have hidden it from Browse even if it had loaded.
Fix
The NSFW preference should only gate discovery of new extensions, not
access to ones already installed:
ExtensionLoader.kt: removed the early-return that rejected installedNSFW extensions during load.
isNsfwis still computed and passedthrough to
Extension.Installed, so the flag is preserved for badges/UI— the extension just isn't blocked from loading anymore. Removed the now
unused
SourcePreferencesinjection alongside it.GetExtensionsByType.kt: removed the NSFW filter on the installedextensions list. The filter on the available (not-yet-installed) list
is untouched, so undiscovered NSFW extensions still stay hidden from
Browse when the toggle is off.
No changes to the update-checker (
ExtensionManager) or the network layer— neither of them filtered by NSFW to begin with, so installed NSFW
extensions were already eligible for update checks; they just couldn't
load in the first place before this fix.
Behavior after this change