Skip to content

Commit

Permalink
Use master/release schema to grab band name
Browse files Browse the repository at this point in the history
  • Loading branch information
eramdam committed Feb 22, 2025
1 parent 80cf3f0 commit 1aca50c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Discogs_Scout.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,12 +1190,12 @@ async function performRelease() {
band = $('[id*=profile_title]').find('a').text().trim();
release = $('[id*=profile_title]').children().last().text().trim();
} else if ($('#master_schema').length > 0) { // the new version of the master page (beta)
band = $('[class^=body]').find('h1>span>a.link_15cpV:first').text().trim();
band = JSON.parse(document.getElementById('master_schema').textContent)['@graph'][0]['byArtist']['name'];
release = JSON.parse(document.getElementById('master_schema').textContent)['@graph'][0]['name'];
}
} else if (Boolean(location.href.match('/release/'))) {
if ($('#release_schema').length > 0) {
band = $('[class^=body]').find('h1>span>a.link_15cpV:first').text().trim();
band = JSON.parse(document.getElementById('release_schema').textContent)['releaseOf']['byArtist'][0]['name'];
release = JSON.parse(document.getElementById('release_schema').textContent)['name'];
}
}
Expand Down

0 comments on commit 1aca50c

Please sign in to comment.