Skip to content

Keep installed NSFW extensions visible when NSFW toggle is off - #3747

Open
Hisham-AlAhmad wants to merge 1 commit into
mihonapp:mainfrom
Hisham-AlAhmad:fix/keep-installed-nsfw-extensions
Open

Keep installed NSFW extensions visible when NSFW toggle is off#3747
Hisham-AlAhmad wants to merge 1 commit into
mihonapp:mainfrom
Hisham-AlAhmad:fix/keep-installed-nsfw-extensions

Conversation

@Hisham-AlAhmad

Copy link
Copy Markdown

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 (at
startup and after install/update) and short-circuited with
LoadResult.Error whenever the extension was NSFW-flagged and the
preference was off. That kept the extension out of
installedExtensionMapFlow entirely — it never loaded, so it couldn't
appear in the UI or be matched up for updates.

GetExtensionsByType additionally filtered the installed list by the same
preference, 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 installed
    NSFW extensions during load. isNsfw is still computed and passed
    through to Extension.Installed, so the flag is preserved for badges/UI
    — the extension just isn't blocked from loading anymore. Removed the now
    unused SourcePreferences injection alongside it.
  • GetExtensionsByType.kt: removed the NSFW filter on the installed
    extensions 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

Scenario Result
Toggle OFF, NSFW extension installed Stays visible, usable, still updates
Toggle OFF, NSFW extension NOT installed Stays hidden from Browse (unchanged)
Toggle ON Unchanged from current behavior
Uninstall an NSFW extension while toggle is OFF Disappears again (package no longer present, so it's simply not loaded)
Fresh install, no extensions installed yet Nothing to show either way; discovery still hides NSFW (unchanged)

Copilot AI lite review requested due to automatic review settings August 13, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GetExtensionsByType while 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installed NSFW Extensions Should Remain Accessable & Receive Updates Even if NSFW Visibility is Off

2 participants