2017-11-11 01:28:11 +00:00
// ==UserScript==
2015-07-18 20:59:15 +00:00
// @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.
2021-08-05 16:25:01 +00:00
// @version 2021.8.5.1
2015-07-18 20:59:15 +00:00
// @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
// @updateURL https://raw.github.com/murdos/musicbrainz-userscripts/master/mb_relationship_shortcuts.user.js
// @include http*://*musicbrainz.org/artist/*
// @include http*://*musicbrainz.org/release-group/*
// @include http*://*musicbrainz.org/label/*
2017-11-11 01:28:11 +00:00
// @require https://code.jquery.com/jquery-3.2.1.min.js
2015-07-18 20:59:15 +00:00
// ==/UserScript==
// Definitions: relations-type and corresponding icons we are going to treat
2021-08-05 15:50:04 +00:00
const relationsIconsURLs = {
2018-11-20 22:18:49 +00:00
url : {
2021-03-08 08:24:47 +00:00
'amazon asin' : ` data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAgAAAAIACH+pydAAABEVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DBAQDBQUEBQUcHR0wMTEwMjIxMjJDRUVERUVVVlZlZmZmZ2d2dnaFhoaTlJSioqKvsLCwsLCwsbG9vb3MzMzNzc3Z2dnl5eXm5uby8vLz8/Lz8/P+pwD/pwD/qAD/rRP/sin/syn/uD3/uD7/uT7/vlD/v1D/v1H/xGL/yXL/ynL/1JD/1ZD/1ZH/2p//363/4K7/5bz/6cr/6sr/6sv/79j/8Nj/9OX/9eX/+vL/+vP/+/P////K77b0AAAAHnRSTlMAAwYJDBIYHidIUWZvcnV4fpyfpbHDzM/S2Nvw9vy8Hjz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BuVgr9nEzuSATlW3r0jqT2LT6ZnwX1lCAu7nhvAd6tI9Lkk5WpJgpZBTixAMG4gG/8FsUoP78fD4Hnhx3ZSmmLFbNF7WC+w2CzfgtqqUAd86FxXM3tKZJpazpzB1ElNfmynrhVNV15OPurfBfXLeLAJzQvTx4ctCgAm70HpbnuNzd3c5xxanK5LwJQ1X+9b8nhqc2tIiH0/1bJqlGeju+zX3k1LOYWh6x6dmya/S8++9fr/335MqdTW0mp+On9fsPB0rcitiJC8wAAAAASUVORK5CYII= ` ,
2018-11-20 22:18:49 +00:00
'creative commons licensed download' : 'http://creativecommons.org/favicon.ico' ,
'cover art link' : 'http://www.cdcovers.cc/favicon.ico' ,
2021-03-08 08:24:47 +00:00
secondhandsongs : ` data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zV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0yVg56WQcvsFuSomGMi3BuhmbhiwbEkF856GUdHUFLWQlyOIAOshLnnFUm+mEOv9nzwL85vv8lwADUZ1hgAbiJKAAAAABJRU5ErkJggg== ` ,
2021-08-05 16:25:01 +00:00
// 'http://www.nomy.nu/img/lyrics-icon.gif'
lyrics : ` data:image/gif;base64,R0lGODlhEQARALMAAAAAAP////z8/Onp6dzc3KmpqaGhoZGRkYyMjHx8fP///wAAAAAAAAAAAAAAAAAAACH5BAEAAAoALAAAAAARABEAAARNUBCUqr0JEVnI+GA4EJ0WnGiKTskQGEcsy0YwVK6q2/g7/7Vba6cTumA/Gm9ITBl9yViw10Q9kdEps7o8RqU8EzcwIXlEIrOEgsFoBBEAOw== ` ,
2021-03-08 08:24:47 +00:00
allmusic : ` data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABaFBMVEUjHyAkICEnq+EsKCksreItKSowLC0yr+M0r+I0r+M1sOI2r+M3seQ9tOQ/Ozw/tORBteVCteRDtuVFt+VGQkNGtuZHt+ZHuOZIuOZJuOVLSEhVUlNVvedXvudaV1hav+hbWFhbv+lcwOleW1xewOlfwehhwuliwelkYmJkwuhmw+ltxetua2xxbm9xyOxzcHF0yex3yux9enuAze2Bze6Dz+6Eg4OFz+6G0O+J0e+R1PCWlZWZl5eZl5idm5yf2fKgnp6i2vKi2/Kl3POsq6us3vSs3/Stq6yx4fS3tba44/W75Pa85fa95fbFxMXGxcXH6ffJ6vfK6vfNzMzQz8/R7fjS0dLU7vnY8Prc8fre3d3e8vrf8vvg8/vj9Pvl9fvn9vzr9/zs7Ozs8PLs+Pzv7+/v+f3w+f3x8PDx+f3x+v3z+v309PT0+v30+/32+/349/j5/f76/Pz7/v/8/v/9/v79/v////+KKYFdAAAAyklEQVQYGQXBByMWABQAwGcrm2Rkr4yM7LL3JpvskU3Rx/19dwFHg6XFZdUz9xD435v9Y3H5Z07bEwJdDVfwt6MuQbBS+Gi+sXbiNVE5SfB11ljL/vH3Pr9KCDJOFTz9u3n7fJtIvRMkPz4XWxvXdOjjiSB/V8XedP9ZUeI69VnQM2DvtDz9Yt1kK8HJhw2rEaOOsrYJLGVeNqd9yn3Jm0LA/u+kzpFYOIAA3TG3GV9AwJ+UiIjYgoChqB8ebo9vENBetcN5Tf0D3gHTvVN12wWaYQAAAABJRU5ErkJggg== ` ,
2021-05-24 21:21:35 +00:00
vgmdb : ` data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABDElEQVR4AWL4//8/XnyFAdAIWUJlGERBFCoFJ5Fx94i7ZBru7g49kHCpdNwS7i4RibhT0Amz57zfv3DX5u1dsUoAC+CPnANflVvabAeaQT7IBB+UXGoVWIuxsxC8mhWgIAmMgSrO/cEr+LMoQNguCktAqJibFyBwBd8sWuWaMcGVKUEXC36BO4gAHuAWfDPPBqVSIH/8kYJuUMOxjd4hveDVmKCKG05AIHgGVSLvYw6MC/YZenPuIrIKi5/I4FbvuiHsm7UIfhn6cj4IfjiOABNkEVwbE7xS8AE+Od5ilq5Q9cYEe3rXXAVxzNq4NgqiTAk8wDI4Axlca2HfIMSeRgVECmfBkBKpG+jX/QNlATUdEbOUaAAAAABJRU5ErkJggg== ` ,
2015-07-18 20:59:15 +00:00
} ,
'release-group' : {
2021-08-05 16:25:01 +00:00
// http://www.amaesingtools.com/images/left_arrow_icon.gif
'single from' : ` data:image/gif;base64,R0lGODlhDwALAJEAAP2ZAZmZmf///wAAACH5BAAAAAAALAAAAAAPAAsAAAIflI+pq2ABY0DAiYmwqOyaCoaHxjHaZp0e9UhQB8dCAQA7 ` ,
2015-07-18 20:59:15 +00:00
} ,
2018-11-20 22:18:49 +00:00
release : {
'part of set' : 'http://web.archive.org/web/20060709091901/http://wiki.musicbrainz.org/-/musicbrainz/img/moin-inter.png' ,
2020-04-05 14:01:21 +00:00
remaster : 'http://web.archive.org/web/20060708200714/http://wiki.musicbrainz.org/-/musicbrainz/img/moin-www.png' ,
} ,
2015-07-18 20:59:15 +00:00
} ;
2021-08-05 15:50:04 +00:00
const otherDatabasesIconURLs = {
2021-03-08 08:24:47 +00:00
'd-nb.info' : ` data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAQlBMVEUAZswTa8IZHBwlKC06bqFGSEhLeqlUVlZVmd1WWVliZGSIuOeUlZWav+WbnZ2vxNqys7O71vHCwsLO2+jg4eH///9dbbdbAAAATUlEQVR42q2OyQ2AMADDQjjKXaB4/1URajsB+GklUWRbLy58FG0WwCKiMXAHmWtDpA5zTOwya8MIEQOEKk5yYq4VpVKpoxryaP/v9cIDQFsGHWYbgn0AAAAASUVORK5CYII= ` ,
'www.musik-sammler.de' : ` data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAgAAAAIACH+pydAAAAM1BMVEUAAAANDg4cHR0eICAfIB0kJSQwMTE9Pj9KTU9XW11yc3KPj4+urq7MzMzk5OXv7+////80u7S3AAAAAXRSTlMAQObYZgAAAAFiS0dEEJWyDSwAAAGFSURBVBgZBcEBchRHEATArJ4VECCj/z9TgrBBd9vlzADAW7eSeQdAAHjde2vNmTMfAAF4vR+wGHtd5xcQ4OfzDwM7OzudvFzvcMA/n58IRHY60X77ROD175bRYEfHiFy/GPzzuWQqxeiIiPuNi7e/m6xqYhFJRD05XI/VSbU9Z2adREj7/e/l55/V2Zl1XSN9uTdC1e2yT5Tt1zPSmF1UtY5zI9pv1ySSSFot9eP6+QfUywgQsqXWXn0iOBloiLQW22lQJNj/ft8Q96pOpwUOvO+jTxCh7o4ggLdwEFWDXFPgbsN57aAq3VmZXKRoizmh3Xt01mQ+hhKfLUD7sCBzOUiPPC8J7D7uU7Pm+ricc3MMz5NB93EfMHtcPr6vCbEPJ7pP06RmvxwX59qI4r4bBpWa613w4xFoFx2wQ17+ZXAdaEFarF3XCw7+fldlNQiKr1/eEf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F0ZTptb2RpZnkAMjAxNC0wOS0xMFQwNToxMjowNSswMjowMC4FeS8AAAAASUVORK5CYII= ` ,
2017-11-12 02:01:52 +00:00
} ;
2021-08-05 15:50:04 +00:00
const incOptions = {
2018-11-20 22:18:49 +00:00
'release-group' : [ 'release-group-rels' , 'url-rels' ] ,
release : [ 'release-rels' , 'url-rels' , 'discids' ] ,
recording : [ 'work-rels' ] ,
2020-04-05 14:01:21 +00:00
work : [ 'url-rels' ] ,
2015-07-18 20:59:15 +00:00
} ;
// prevent JQuery conflicts, see http://wiki.greasespot.net/@grant
this . $ = this . jQuery = jQuery . noConflict ( true ) ;
if ( ! unsafeWindow ) unsafeWindow = window ;
2020-04-05 14:01:21 +00:00
$ ( document ) . ready ( function ( ) {
2015-07-18 20:59:15 +00:00
// Get pageType (label or artist)
2018-11-20 22:18:49 +00:00
let parent = { } ;
let child = { } ;
2021-08-05 15:50:04 +00:00
let m ;
2018-11-20 22:18:49 +00:00
if ( ( m = window . location . href . match ( '/artist/(.{36})[^/]*$' ) ) ) {
2015-07-18 20:59:15 +00:00
parent . type = 'artist' ;
parent . mbid = m [ 1 ] ;
child . type = 'release-group' ;
2018-11-20 22:18:49 +00:00
} else if ( ( m = window . location . href . match ( '/(release-group|label)/(.{36})[^/]*$' ) ) ) {
2015-07-18 20:59:15 +00:00
parent . type = m [ 1 ] ;
parent . mbid = m [ 2 ] ;
child . type = 'release' ;
2018-11-20 22:18:49 +00:00
} else if ( ( m = window . location . href . match ( '/artist/(.{36})/(releases|recordings|works)' ) ) ) {
2015-07-18 20:59:15 +00:00
parent . type = 'artist' ;
parent . mbid = m [ 1 ] ;
child . type = m [ 2 ] . replace ( /s$/ , '' ) ;
} else {
// Not supported
return ;
}
2018-11-20 22:18:49 +00:00
let mbidRE = /(release|release-group|work)\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/ ;
2015-07-18 20:59:15 +00:00
// Determine target column
2018-11-20 22:18:49 +00:00
let columnindex = 0 ;
2020-04-05 14:01:21 +00:00
$ ( "table.tbl tbody tr[class!='subh']" ) . each ( function ( ) {
2018-11-20 22:18:49 +00:00
$ ( this )
. children ( 'td' )
2020-04-05 14:01:21 +00:00
. each ( function ( ) {
if ( $ ( this ) . find ( 'a' ) . attr ( 'href' ) !== undefined && $ ( this ) . find ( 'a' ) . attr ( 'href' ) . match ( mbidRE ) ) {
2018-11-20 22:18:49 +00:00
return false ;
}
columnindex ++ ;
} ) ;
2015-07-18 20:59:15 +00:00
return false ;
} ) ;
// Set MBID to row in tables to get easiest fastest access
2020-04-05 14:01:21 +00:00
$ ( "table.tbl tr[class!='subh']" ) . each ( function ( ) {
2018-11-20 22:18:49 +00:00
let $tr = $ ( this ) ;
$tr . children ( ` th:eq( ${ columnindex } ) ` ) . after ( "<th style='width: 150px;'>Relationships</th>" ) ;
$tr . children ( ` td:eq( ${ columnindex } ) ` ) . after ( "<td class='relationships'></td>" ) ;
$ ( this )
. find ( 'a' )
2020-04-05 14:01:21 +00:00
. each ( function ( ) {
2018-11-20 22:18:49 +00:00
let href = $ ( this ) . attr ( 'href' ) ;
if ( ( m = href . match ( mbidRE ) ) ) {
$tr . attr ( 'id' , m [ 2 ] ) ;
return false ;
}
} ) ;
2015-07-18 20:59:15 +00:00
} ) ;
2020-03-31 09:56:56 +00:00
// Adapt width of subheader rows by incrementing the colspan of a cell
2020-04-05 19:56:29 +00:00
$ ( 'table.tbl tr.subh' ) . each ( function ( ) {
2020-03-31 10:28:52 +00:00
$ ( this )
. children ( 'th[colspan]' )
2020-04-05 19:56:29 +00:00
. attr ( 'colspan' , function ( index , oldValue ) {
2020-03-31 10:28:52 +00:00
if ( index === 0 ) {
return Number ( oldValue ) + 1 ;
} else {
return oldValue ;
}
} ) ;
2020-03-31 09:56:56 +00:00
} ) ;
2017-04-16 20:07:25 +00:00
// Calculate offset for multi-page lists
2018-11-20 22:18:49 +00:00
let page = 1 ;
if ( ( m = window . location . href . match ( '[?&]page=([0-9]*)' ) ) ) {
2017-11-11 01:28:11 +00:00
page = m [ 1 ] ;
2017-04-16 20:07:25 +00:00
}
2018-11-20 22:18:49 +00:00
let offset = ( page - 1 ) * 100 ;
2017-11-11 01:28:11 +00:00
2015-07-18 20:59:15 +00:00
// Call the MB webservice
2018-11-20 22:18:49 +00:00
let url = ` /ws/2/ ${ child . type } ? ${ parent . type } = ${ parent . mbid } &inc= ${ incOptions [ child . type ] . join ( '+' ) } &limit=100&offset= ${ offset } ` ;
2017-11-11 01:28:11 +00:00
//console.log("MB WS url: " + url);
2015-07-18 20:59:15 +00:00
2020-04-05 14:01:21 +00:00
$ . get ( url , function ( data , textStatus , jqXHR ) {
2015-07-18 20:59:15 +00:00
// Parse each child
2018-11-20 22:18:49 +00:00
$ ( data )
. find ( child . type )
2020-04-05 14:01:21 +00:00
. each ( function ( ) {
2018-11-20 22:18:49 +00:00
let mbid = $ ( this ) . attr ( 'id' ) ;
// URL relationships
$ ( this )
. find ( "relation-list[target-type='url'] relation" )
2020-04-05 14:01:21 +00:00
. each ( function ( ) {
2018-11-20 22:18:49 +00:00
let reltype = $ ( this ) . attr ( 'type' ) ;
2020-04-05 14:01:21 +00:00
let target = $ ( this ) . children ( 'target' ) . text ( ) ;
2020-03-14 00:43:40 +00:00
if ( Object . prototype . hasOwnProperty . call ( relationsIconsURLs . url , reltype ) ) {
2018-11-20 22:18:49 +00:00
$ ( ` # ${ mbid } td.relationships ` ) . append (
` <a href=' ${ target . replace ( /'/g , ''' ) } '> ` +
` <img style='max-height: 16px;' src=' ${ relationsIconsURLs . url [ reltype ] } ' /> ` +
` </a> `
) ;
} else
for ( let rel in otherDatabasesIconURLs ) {
if ( target . indexOf ( rel ) != - 1 ) {
$ ( ` # ${ mbid } td.relationships ` ) . append (
` <a href=' ${ target . replace ( /'/g , ''' ) } '> ` +
` <img style='max-height: 16px;' src=' ${ otherDatabasesIconURLs [ rel ] } ' /> ` +
` </a> `
) ;
}
}
} ) ;
// Other relationships
$ ( this )
. find ( "relation-list[target-type!='url']" )
2020-04-05 14:01:21 +00:00
. each ( function ( ) {
let targettype = $ ( this ) . attr ( 'target-type' ) . replace ( 'release_group' , 'release-group' ) ;
2018-11-20 22:18:49 +00:00
let relations = { } ;
if ( relationsIconsURLs [ targettype ] === undefined ) {
return ;
}
$ ( this )
. children ( 'relation' )
2020-04-05 14:01:21 +00:00
. each ( function ( ) {
2018-11-20 22:18:49 +00:00
let reltype = $ ( this ) . attr ( 'type' ) ;
2020-04-05 14:01:21 +00:00
let target = $ ( this ) . children ( 'target' ) . text ( ) ;
2018-11-20 22:18:49 +00:00
let url = targettype == 'url' ? target : ` / ${ targettype } / ${ target } ` ;
2020-03-14 00:43:40 +00:00
if ( Object . prototype . hasOwnProperty . call ( relationsIconsURLs [ targettype ] , reltype ) ) {
if ( ! Object . prototype . hasOwnProperty . call ( relations , reltype ) ) relations [ reltype ] = [ url ] ;
2018-11-20 22:18:49 +00:00
else relations [ reltype ] . push ( url ) ;
}
} ) ;
2020-04-05 14:01:21 +00:00
$ . each ( relations , function ( reltype , urls ) {
2018-11-20 22:18:49 +00:00
let html = '' ;
if ( urls . length < - 1 ) {
html += ` <img src=' ${ relationsIconsURLs [ targettype ] [ reltype ] } ' />( ${ urls . length } ) ` ;
} else {
2020-04-05 14:01:21 +00:00
$ . each ( urls , function ( index , url ) {
2018-11-20 22:18:49 +00:00
html += ` <a href=' ${ url } '><img src=' ${ relationsIconsURLs [ targettype ] [ reltype ] } ' /></a> ` ;
} ) ;
}
$ ( ` # ${ mbid } td.relationships ` ) . append ( html ) ;
2015-07-18 20:59:15 +00:00
} ) ;
2018-11-20 22:18:49 +00:00
} ) ;
2015-07-18 20:59:15 +00:00
} ) ;
} ) ;
} ) ;