shagu / mtg-browser

Convert MTG Card-Scanner (DelverLens) exports into a simple website with plain image files
MIT License
7 stars 2 forks source link

Card not found in MTGJSON #1

Open jarljaulm opened 3 years ago

jarljaulm commented 3 years ago

I was having trouble with failures due to some cards not existing in the JSON. The issue was bypassed by adding the following If statement:


/ read mtgjson data / const jsondata = scry2mtgjson.get(card.scryfall)

if (String(jsondata) == 'undefined'){
    process.stdout.write(String(card.name) + '\n')
    current++
} else {

The close of the statement is towards the end:

process.stdout.write(''.padEnd(process.stdout.columns, ' ') + '\r') process.stdout.write('[' + current + '/' + cards.length + '] ' + card.name + '\n') current++ }} / added here / )

/ save collection metadata /


This only got me past the image error. I'm now looking at an issue with my list being too large.

A future enhancement could write the bypassed cards to a file...

Nimrod-666 commented 2 years ago

I'm getting the same issue now here https://github.com/shagu/mtg-browser/issues/2 It seems that the script has a problem with token cards. Would be nice if it could be fixed.

{
  id: 59962,
  foil: 0,
  image: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff e2 02 28 49 43 43 5f 50 52 4f 46 49 4c 45 00 01 01 00 00 02 18 00 00 00 00 02 10 00 00 ... 36728 more bytes>,
  quantity: 1,
  language: '',
  category: 1,
  scryfall: '142bbbe1-4446-4d80-b82d-0df8ef17eac1'
}