discogarchive: fix new data from bandcamp

This commit is contained in:
yosh 2023-10-24 00:22:05 -04:00
parent 5d9fc46e4d
commit dc521cfe66
1 changed files with 2 additions and 2 deletions

View File

@ -73,11 +73,11 @@ for type in album track; do
curl -L -s -o - "$url" | pup 'script[type="application/ld+json"]' 'text{}' > "$json" || continue
artist="$(jq -r '.byArtist.name' < "$json")"
name="$(jq -r '.name' < "$json")"
if [ "$(jq '.numTracks' < "$json")" = "0" ]; then
if [ "$(jq '.numTracks' < "$json")" = "0.0" ]; then
look_closer="<a href=\"$url\" rel=\"nofollow\">$artist - $name</a><br>$NL$look_closer"
errecho "LOOK CLOSER: $url"
tmplog="$tmplog$url LOOK_CLOSER$NL"
elif [ "$(jq 'if (.inAlbum) then .inAlbum.albumRelease[0].offers.price else .albumRelease[0].offers.price end' < "$json")" = "0" ]; then
elif [ "$(jq 'if (.inAlbum) then .inAlbum.albumRelease[0].offers.price else .albumRelease[0].offers.price end' < "$json")" = "0.0" ]; then
eval 'contained_'"$type"'s="<a href=\"$url\" rel=\"nofollow\">$artist - $name</a><br>${NL}${contained_'"$type"'s}"'
errecho "CONTAINED $type: $artist - $name"
tmplog="$tmplog$url CONTAINED$NL"