mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-14 12:22:26 +00:00
discogs_importer: improve mblink_done attribute
It was a boolean, it is now a list of all MB types tried.
This commit is contained in:
parent
08046d1b09
commit
2725bdf76d
1 changed files with 6 additions and 3 deletions
|
@ -92,9 +92,12 @@ function insertMBLinks($root) {
|
|||
var $link = $(this);
|
||||
var mlink = $link.attr('mlink');
|
||||
// ensure we do it only once per link
|
||||
var done = $link.attr('mlink_done');
|
||||
if (done) return;
|
||||
$link.attr('mlink_done', true);
|
||||
var done = ($link.attr('mlink_done') || "").split(",");
|
||||
for (var i=0; i<done.length; i++) {
|
||||
if (mb_type == done[i]) return;
|
||||
}
|
||||
done.push(mb_type);
|
||||
$link.attr('mlink_done', done.filter(function(e) { return (e!="");}).join(','));
|
||||
if (link_infos[mlink] && link_infos[mlink].type == discogs_type) {
|
||||
var discogs_url = link_infos[mlink].clean_url;
|
||||
mblinks.searchAndDisplayMbLink(discogs_url, mb_type, function (link) { $link.before(link); });
|
||||
|
|
Loading…
Reference in a new issue