mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-12 19:32:27 +00:00
import_functions: add searchUrlFor() which returns an url for search of given entity
This commit is contained in:
parent
4bd4b74c7f
commit
1a07a75774
1 changed files with 12 additions and 0 deletions
|
@ -101,6 +101,17 @@ var MBReleaseImportHelper = (function() {
|
|||
return '<a class="musicbrainz_import" href="//musicbrainz.org/search?' + params.join('&') + '">Search in MusicBrainz</a>';
|
||||
}
|
||||
|
||||
function fnSearchUrlFor(type, what) {
|
||||
type = type.replace('-', '_');
|
||||
|
||||
var params = [
|
||||
'query=' + luceneEscape(what),
|
||||
'type=' + type,
|
||||
'indexed=1'
|
||||
];
|
||||
return '//musicbrainz.org/search?' + params.join('&');
|
||||
}
|
||||
|
||||
// compute HTML of import form
|
||||
function fnBuildFormHTML(parameters) {
|
||||
|
||||
|
@ -345,6 +356,7 @@ var MBReleaseImportHelper = (function() {
|
|||
guessReleaseType: fnGuessReleaseType,
|
||||
hmsToMilliSeconds: hmsToMilliSeconds,
|
||||
ISO8601toMilliSeconds: fnISO8601toMilliSeconds,
|
||||
searchUrlFor: fnSearchUrlFor,
|
||||
URL_TYPES: url_types
|
||||
};
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue