File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,11 +143,9 @@ const BandcampImport = {
143143 let showntracks = bandcampAlbumData . trackinfo . length ;
144144 let numtracks = - 1 ;
145145 let nostream = false ;
146- // album description indicates number of tracks in the download
147- let match = / ^ \d + t r a c k a l b u m $ / . exec ( document . querySelector ( 'meta[property="og:description"]' ) . getAttribute ( 'content' ) ) ;
148- if ( match ) {
149- numtracks = parseInt ( match , 10 ) ;
150- }
146+ // ld+json metadata contains number of tracks in the download
147+ const linkeddata = JSON . parse ( document . querySelector ( 'script[type="application/ld+json"]' ) . innerText )
148+ numtracks = linkeddata . numTracks
151149 if ( numtracks > 0 && numtracks > showntracks ) {
152150 // display a warning if tracks in download differs from tracks shown
153151 $ ( 'h2.trackTitle' ) . append (
@@ -557,12 +555,12 @@ $(document).ready(function () {
557555 <a class="mb_search_link"
558556 class="musicbrainz_import"
559557 target="_blank"
560- title="Search this artist on MusicBrainz (open in a new tab)"
558+ title="Search this artist on MusicBrainz (open in a new tab)"
561559 href="${ artistSearchUrl } "
562560 ><small>A</small>?</a>
563561 </span>
564562 <span class="mb_valign mb_searchit">
565- <a
563+ <a
566564 class="mb_search_link musicbrainz_import"
567565 target="_blank"
568566 title="Search this label on MusicBrainz (open in a new tab)"
You can’t perform that action at this time.
0 commit comments