41 lines
929 B
Plaintext
Executable File
41 lines
929 B
Plaintext
Executable File
#!/usr/bin/env -S jq -fMr
|
|
|
|
def format_as_deezer_record_type($format):
|
|
$format | ascii_upcase |
|
|
if . == "SINGLE-WEB" then
|
|
"single"
|
|
elif . == "CDS" then
|
|
"single"
|
|
elif . == "CDM" then
|
|
"single"
|
|
elif . == "CDEP" then
|
|
"ep"
|
|
elif . == "EP-WEB" then
|
|
"ep"
|
|
elif . == "EP" then
|
|
"ep"
|
|
elif . == "WEB" then
|
|
"album"
|
|
elif . == "2CD" then
|
|
"album"
|
|
elif . == "CD" then
|
|
"album"
|
|
else
|
|
null
|
|
end;
|
|
|
|
if .total == 1 then
|
|
[._scene_release_name, .data[0].cover_xl ]
|
|
elif .total > 1 then
|
|
._scene_release_name as $rls |
|
|
format_as_deezer_record_type(._format) as $record_type |
|
|
if $record_type != null then
|
|
# alternate to empty if there is no matching record type
|
|
.data | map(select(.record_type == $record_type))[0]//empty | [$rls, .cover_xl]
|
|
else
|
|
empty
|
|
end
|
|
else
|
|
empty
|
|
end | @tsv
|