mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2025-03-04 22:37:16 +00:00
Fix an old issue causing the mb link to be added more than once.
Mark links as processed using an attribute. Note: there is another old issue related to discogs page navigation, links don't always show up
This commit is contained in:
parent
636c9e0ca9
commit
e66f4c45df
1 changed files with 4 additions and 0 deletions
|
@ -77,6 +77,10 @@ function insertMBLinks($root) {
|
|||
function searchAndDisplayMbLinkInSection($tr, mb_type, discogs_type) {
|
||||
$tr.find('a[href*="http://www.discogs.com/'+discogs_type+'/"]').each(function() {
|
||||
var $link = $(this);
|
||||
// ensure we do it only once per link
|
||||
var done = $link.attr('mblink');
|
||||
if (done) return;
|
||||
$link.attr('mblink', true);
|
||||
var discogs_url = $link.attr('href');
|
||||
mblinks.searchAndDisplayMbLink(discogs_url, mb_type, function (link) { $link.before(link); });
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue