Add custom URL support with mirror selection#17328
Open
dejavui wants to merge 16 commits into
Open
Conversation
Introduce CustomAndMirrorPreferences class to allow extensions to offer both predefined mirror URLs and a custom URL input option. This enables better flexibility for sources with multiple mirrors or alternative domains. Changes include: - New CustomAndMirrorPreferences class for managing mirror + custom URL preferences - Enhanced BaseUrlSpec.Mirrors to support entries, values, and withCustom flag - Updated SourceProcessor to conditionally use CustomAndMirrorPreferences when custom URLs are enabled - Migrated MoeTruyen extension to use new @source annotation with declarative mirror configuration - Removed manual preference handling code from MoeTruyen, now generated by framework
Contributor
|
I feel like mirrors and custom urls should remain mutually exclusive. |
Contributor
Author
I understand the concern. My intention isn't to merge two unrelated features, but to model different ways of resolving the effective base URL \(〇_o)/ MoeTruyen has been using this workflow for a time: users choose either the default domain, one of the predefined mirrors, or a custom URL. Only one option is active at a time, so they're still mutually exclusive from the user's perspective. |
dejavui
marked this pull request as draft
July 8, 2026 07:23
Contributor
|
if this were to be considered i would expect the custom and mirrors option to be merged |
dejavui
marked this pull request as ready for review
July 8, 2026 11:12
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.
Introduce
CustomAndMirrorPreferences, allowing extensions to combine predefined mirrors with a custom base URL option.This generalizes the existing MoeTruyen implementation into a reusable framework component, so extensions no longer need to implement their own mirror/custom URL preference logic.
Changes
CustomAndMirrorPreferencesto handle mirror selection and custom base URLs in a single preference component.BaseUrlSpec.Mirrorswith optionalentries,values, andwithCustomsupport for declarative mirror configuration.SourceProcessorto generateCustomAndMirrorPreferenceswhen custom URLs are enabled, while preserving the existingMirrorPreferencespath for regular mirror-only sources.@Sourceconfiguration.Review needed 👉゚ヮ゚👉 from @AwkwardPeak7, @vetleledaal, and @FourTOne5. Thanks!
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