Skip to content

MBS-12986: Revise Weibo URL cleanup#3682

Open
SHREESHANTH99 wants to merge 2 commits intometabrainz:masterfrom
SHREESHANTH99:mbs-12986
Open

MBS-12986: Revise Weibo URL cleanup#3682
SHREESHANTH99 wants to merge 2 commits intometabrainz:masterfrom
SHREESHANTH99:mbs-12986

Conversation

@SHREESHANTH99
Copy link
Copy Markdown
Contributor

Fix MBS-12986

Problem

Some Weibo URLs entered in edits use the /n/ path or lack www/HTTPS, e.g.:

https://weibo.com/n/username
http://weibo.com/u/123456789

These URLs are inconsistent and can cause broken links or unexpected behavior.

Solution

  • Normalize /n/ URLs to the standard /u/ format.
  • Ensure https://www prefix is added if missing.
  • This makes all saved Weibo URLs consistent and valid.

Testing

  • Manually tested in local Docker development setup (http://localhost:5000).
  • Entered /n/ URLs and verified they are normalized to /u/ format with https://www.
  • Non-Weibo URLs remain unchanged.
  • Optional: can add JS unit tests for /n/ → /u/ normalization.

Notes

  • No database changes required.
  • Only small JS file changes in root/static/scripts/cleanup.js.

Fix normalization of /n/ Weibo URLs to standard /u/ format
and add www + HTTPS if missing. This ensures all Weibo
URLs are consistent and prevents broken links.
@welcome
Copy link
Copy Markdown

welcome Bot commented Dec 4, 2025

Thanks for opening your first pull request for MusicBrainz Server, and welcome to our community! 🎉
If you haven’t yet, please check out our contributing guidelines.
Someone will be reviewing your PR soon; just hang in there!
In the meantime, if you’re wondering what to do next, you can have a look at our issue tracker.

Copy link
Copy Markdown
Member

@reosarevok reosarevok left a comment

Choose a reason for hiding this comment

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

I guess it's a good start to at least standardise these, even though it's still unclear whether they should be added or we should ask people to find and enter the equivalent /u link.

Comment thread root/static/scripts/tests/Control/URLCleanup.js
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.

2 participants