scene release to discogs release
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

out-deezer-cover.jq 929B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env -S jq -fMr
  2. def format_as_deezer_record_type($format):
  3. $format | ascii_upcase |
  4. if . == "SINGLE-WEB" then
  5. "single"
  6. elif . == "CDS" then
  7. "single"
  8. elif . == "CDM" then
  9. "single"
  10. elif . == "CDEP" then
  11. "ep"
  12. elif . == "EP-WEB" then
  13. "ep"
  14. elif . == "EP" then
  15. "ep"
  16. elif . == "WEB" then
  17. "album"
  18. elif . == "2CD" then
  19. "album"
  20. elif . == "CD" then
  21. "album"
  22. else
  23. null
  24. end;
  25. if .total == 1 then
  26. [._scene_release_name, .data[0].cover_xl ]
  27. elif .total > 1 then
  28. ._scene_release_name as $rls |
  29. format_as_deezer_record_type(._format) as $record_type |
  30. if $record_type != null then
  31. # alternate to empty if there is no matching record type
  32. .data | map(select(.record_type == $record_type))[0]//empty | [$rls, .cover_xl]
  33. else
  34. empty
  35. end
  36. else
  37. empty
  38. end | @tsv