murdos / musicbrainz-userscripts

Collection of userscripts for MusicBrainz, by various authors
549 stars 91 forks source link

Display shortcut for relationships should also optionally display `discography entries` #453

Open vzell opened 2 years ago

vzell commented 2 years ago

My use case is to display discography entries on the release pages for Bruce Springsteen releases. I managed to get it working with the following patch

modified   mb_relationship_shortcuts.user.js
@@ -33,6 +33,7 @@ const urlRelationsIconClasses = {
     secondhandsongs: 'secondhandsongs',
     vgmdb: 'vgmdb',
     wikidata: 'wikidata',
+    'discography entry': 'discographyentry',
 };

 const otherDatabasesIconClasses = {
@@ -94,6 +95,10 @@ td.relationships span.favicon.ended {
     background-image: url(https://www.hdtracks.com/favicon.ico);
     background-size: 16px;
 }
+.discographyentry-favicon {
+    background-image: url(https://www.springsteenlyrics.com/favicon.ico);
+    background-size: 16px;
+}
 .creativecommons-favicon {
     background-image: url(https://creativecommons.org/favicon.ico);
 }

The problem is it displays the same icon for all discography entries as can be seen in the following screenshot for the release-group https://musicbrainz.org/release-group/1503429e-e48d-4386-a70a-3b2e4195f276

image

Screenshot from the corresponding release https://musicbrainz.org/release/a831423d-f9c9-4744-9ca5-91cc5ae5b31f

image

Would it be possible to read the favicon.ico Files directly from the right discography entry URL instead of hardcoding one ?

kellnerd commented 2 years ago

The favicons in the release sidebar are loaded by @jesus2099's mb_ALL-LINKS.user.js, so it should be possible to write similar code for the shortcut icon userscript.