Bandcamp UPC/barcodes and the importer

I submitted a PR some time ago that changed the logic in the script so that the release UPC is not set unless digital is the only available medium:

This was to avoid instances like you are discussing here. However Bandcamp does have a per medium UPC field in the page JSON, so I think a fix is possible.

Here’s the output from my Bandcamp release page parser:

> br = Djembe::Bandcamp.album("https://myonlydesirerecords.bandcamp.com/album/love-and-understanding-citadel-room-315-sweden-74")
> puts JSON.pretty_generate(br.releases)
[
  {
    "id": "https://myonlydesirerecords.bandcamp.com/album/love-and-understanding-citadel-room-315-sweden-74",
    "name": "Love and Understanding: Citadel/Room 315 Sweden '74",
    "description": "Includes high-quality download in MP3, FLAC and more. Paying supporters also get unlimited streaming via the free Bandcamp app.",
    "format": "DigitalFormat",
    "identifier": "5052442016687",
    "type": "Digital",
    "images": [
      "https://f4.bcbits.com/img/a2110588555_10.jpg"
    ],
    "currency": "GBP",
    "price": 7.0
  },
  {
    "id": "https://myonlydesirerecords.bandcamp.com/album/love-and-understanding-citadel-room-315-sweden-74#p207737587",
    "name": "Limited Edition Compact Disc",
    "description": "CD packaged in 'mini-LP' gatefold sleeve with insert and additional photos.",
    "format": "CDFormat",
    "identifier": null,
    "type": "Compact Disc (CD)",
    "images": [
      "https://f4.bcbits.com/img/0018653577_10.jpg",
      "https://f4.bcbits.com/img/0018653578_10.jpg",
      "https://f4.bcbits.com/img/0018653579_10.jpg"
    ],
    "currency": "GBP",
    "price": 10.0
  },
  {
    "id": "https://myonlydesirerecords.bandcamp.com/album/love-and-understanding-citadel-room-315-sweden-74#p862471893",
    "name": "Limited Edition Double Vinyl",
    "description": "Limited edition, high quality pressing of 500 copies. The gatefold sleeve is printed on reverse board with exclusive photos and extensive sleeve notes by Daniel Spicer (Jazzwise, The Wire)",
    "format": "VinylFormat",
    "identifier": null,
    "type": "2 x Vinyl LP",
    "images": [
      "https://f4.bcbits.com/img/0018653462_10.jpg",
      "https://f4.bcbits.com/img/0018653463_10.jpg",
      "https://f4.bcbits.com/img/0018653467_10.jpg",
      "https://f4.bcbits.com/img/0018653469_10.jpg"
    ],
    "currency": "GBP",
    "price": 24.0
  }
]

Note that the UPC is only set on the digital release.

5 Likes