Merge pull request #165 from yvanzo/patch-2

Check target type in shorcut for relationships
This commit is contained in:
Aurélien Mino 2018-02-11 21:01:21 +01:00 committed by GitHub
commit 2a2bf1a3cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Display shortcut for relationships on MusicBrainz
// @description Display icon shortcut for relationships of release-group, release, recording and work: e.g. Amazon, Discogs, Wikipedia, ... links. This allows to access some relationships without opening the entity page.
// @version 2017.11.12.1
// @version 2018.02.11.0
// @author Aurelien Mino <aurelien.mino@gmail.com>
// @licence GPL (http://www.gnu.org/copyleft/gpl.html)
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/mb_relationship_shortcuts.user.js
@ -143,6 +143,10 @@ $(document).ready(function(){
var targettype = $(this).attr("target-type").replace("release_group", "release-group");
var relations = {};
if (relationsIconsURLs[targettype] === undefined) {
return;
}
$(this).children("relation").each(function() {
var reltype = $(this).attr("type");
var target = $(this).children("target").text();