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 $link = $(this);
|
||||||
var mlink = $link.attr('mlink');
|
var mlink = $link.attr('mlink');
|
||||||
// ensure we do it only once per link
|
// ensure we do it only once per link
|
||||||
var done = $link.attr('mlink_done');
|
var done = ($link.attr('mlink_done') || "").split(",");
|
||||||
if (done) return;
|
for (var i=0; i<done.length; i++) {
|
||||||
$link.attr('mlink_done', true);
|
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) {
|
if (link_infos[mlink] && link_infos[mlink].type == discogs_type) {
|
||||||
var discogs_url = link_infos[mlink].clean_url;
|
var discogs_url = link_infos[mlink].clean_url;
|
||||||
mblinks.searchAndDisplayMbLink(discogs_url, mb_type, function (link) { $link.before(link); });
|
mblinks.searchAndDisplayMbLink(discogs_url, mb_type, function (link) { $link.before(link); });
|
||||||
|
|
Loading…
Reference in a new issue