Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-9750

Bug in URL Cleanup module for Beatport

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: URL cleanup
    • Labels:

      Description

      Hi, Community,

      Beatport URL Cleanup module in browser replaces this URL

      https://www.beatport.com/release/20-years-best-of-marcus-meinhardt/2241434

      into this

      https://www.beatport.com/release/-/20

      The problem lies in 5th and 6th regex.

       
        beatport: {
          match: [new RegExp("^(https?://)?([^/]+\\.)?beatport\\.com", "i")],
          type: LINK_TYPES.downloadpurchase,
          clean: function (url) {
            url = url.replace(/^(?:https?:\/\/)?(?:(?:classic|pro|www)\.)?beatport\.com\//, "https://www.beatport.com/");
            url = url.replace(/^(https:\/\/www\.beatport\.com)\/[\w-]+\/html\/content\/([\w-]+)\/0*([0-9]+)\/([\w-]+).*$/, "$1/$2/$4/$3");
            url = url.replace(/^(https:\/\/www\.beatport\.com)\/[\w-]+\/html\/content\/([\w-]+)\/0*([0-9]+)(?:[\/?#].*)?$/, "$1/$2/-/$3");
            url = url.replace(/^(https:\/\/www\.beatport\.com)\/([\w-]+)\/([\w-]+)\/0*([0-9]+).*$/, "$1/$2/$3/$4");
            url = url.replace(/^(https:\/\/www\.beatport\.com)\/([\w-]+)\/\/+0*([0-9]+)(?:[\/?#].*)?$/, "$1/$2/-/$3");
            url = url.replace(/^(https:\/\/www\.beatport\.com)\/([\w-]+)\/0*([0-9]+)(?:[\/?#].*)?$/, "$1/$2/$3");
            return url;
          }...
      

       

      source of codepiece https://github.com/metabrainz/musicbrainz-server/blob/14028cc512c34a9bf9859c40f28b699a6dec8bc7/root/static/scripts/edit/URLCleanup.js#L603

      I don't know for what reason these two was added so I am not sure of fixing that, but better if anyone can help.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                roman412 Augmente
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package