update with latest non-digital printing
This commit is contained in:
parent
fed6380af6
commit
c3bc96a0a3
|
@ -109,7 +109,7 @@ def write_art(art_names, id, index, digital):
|
||||||
def to_compact_write_form(smallJson, art_names, response, category):
|
def to_compact_write_form(smallJson, art_names, response, category):
|
||||||
fieldsInCard = ['name', 'image_uris', 'flavor_name',
|
fieldsInCard = ['name', 'image_uris', 'flavor_name',
|
||||||
'reprint', 'frame_effects', 'digital', 'set_type']
|
'reprint', 'frame_effects', 'digital', 'set_type']
|
||||||
data = []
|
data = smallJson['data']
|
||||||
# write all fields needed in card
|
# write all fields needed in card
|
||||||
for card in response['data']:
|
for card in response['data']:
|
||||||
# do not include racist cards
|
# do not include racist cards
|
||||||
|
@ -125,18 +125,18 @@ def to_compact_write_form(smallJson, art_names, response, category):
|
||||||
if 'illustration_id' not in card_face or card_face['illustration_id'] in art_names and (art_names[card_face['illustration_id']] < 0 or card['digital']):
|
if 'illustration_id' not in card_face or card_face['illustration_id'] in art_names and (art_names[card_face['illustration_id']] < 0 or card['digital']):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
ind = len(data)+len(smallJson['data'])
|
ind = len(data)
|
||||||
if (card_face['illustration_id'] in art_names):
|
if (card_face['illustration_id'] in art_names):
|
||||||
digital_holder = ind
|
digital_holder = art_names[card['illustration_id']]
|
||||||
ind = -1
|
ind = -1
|
||||||
write_art(
|
write_art(
|
||||||
art_names, card_face['illustration_id'], ind, card['digital'])
|
art_names, card_face['illustration_id'], ind, card['digital'])
|
||||||
elif 'illustration_id' not in card or card['illustration_id'] in art_names and (art_names[card['illustration_id']] < 0 or card['digital']):
|
elif 'illustration_id' not in card or card['illustration_id'] in art_names and (art_names[card['illustration_id']] < 0 or card['digital']):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
ind = len(data)+len(smallJson['data'])
|
ind = len(data)
|
||||||
if (card['illustration_id'] in art_names):
|
if (card['illustration_id'] in art_names):
|
||||||
digital_holder = ind
|
digital_holder = art_names[card['illustration_id']]
|
||||||
ind = -1
|
ind = -1
|
||||||
write_art(art_names, card['illustration_id'], ind, card['digital'])
|
write_art(art_names, card['illustration_id'], ind, card['digital'])
|
||||||
write_card = dict()
|
write_card = dict()
|
||||||
|
@ -164,12 +164,11 @@ def to_compact_write_form(smallJson, art_names, response, category):
|
||||||
data[digital_holder] = write_card
|
data[digital_holder] = write_card
|
||||||
else:
|
else:
|
||||||
data.append(write_card)
|
data.append(write_card)
|
||||||
smallJson['data'] += data
|
|
||||||
|
|
||||||
|
|
||||||
def to_compact_write_form_special(smallJson, art_names, response, category):
|
def to_compact_write_form_special(smallJson, art_names, response, category):
|
||||||
fieldsInBasic = ['image_uris', 'set', 'set_type', 'digital']
|
fieldsInBasic = ['image_uris', 'set', 'set_type', 'digital']
|
||||||
data = []
|
data = smallJson['data']
|
||||||
# write all fields needed in card
|
# write all fields needed in card
|
||||||
for card in response['data']:
|
for card in response['data']:
|
||||||
# do not include racist cards
|
# do not include racist cards
|
||||||
|
@ -182,9 +181,9 @@ def to_compact_write_form_special(smallJson, art_names, response, category):
|
||||||
if 'illustration_id' not in card or card['illustration_id'] in art_names and (art_names[card['illustration_id']] < 0 or card['digital']):
|
if 'illustration_id' not in card or card['illustration_id'] in art_names and (art_names[card['illustration_id']] < 0 or card['digital']):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
ind = len(data)+len(smallJson['data'])
|
ind = len(data)
|
||||||
if (card['illustration_id'] in art_names):
|
if (card['illustration_id'] in art_names):
|
||||||
digital_holder = ind
|
digital_holder = art_names[card['illustration_id']]
|
||||||
ind = -1
|
ind = -1
|
||||||
write_art(
|
write_art(
|
||||||
art_names, card['illustration_id'], ind, card['digital'])
|
art_names, card['illustration_id'], ind, card['digital'])
|
||||||
|
@ -204,8 +203,6 @@ def to_compact_write_form_special(smallJson, art_names, response, category):
|
||||||
if card['set_type'] != 'token':
|
if card['set_type'] != 'token':
|
||||||
smallJson[card['code']] = [card['name'], card['icon_svg_uri']]
|
smallJson[card['code']] = [card['name'], card['icon_svg_uri']]
|
||||||
|
|
||||||
smallJson['data'] += data
|
|
||||||
|
|
||||||
|
|
||||||
# only write images needed
|
# only write images needed
|
||||||
def write_image_uris(card_image_uris):
|
def write_image_uris(card_image_uris):
|
||||||
|
|
|
@ -18,11 +18,12 @@
|
||||||
})(window, document, 'script', 'dataLayer', 'GTM-M3MBVGG')
|
})(window, document, 'script', 'dataLayer', 'GTM-M3MBVGG')
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function updateSettingDefault(digital, un, original) {
|
function updateSettingDefault(digital, un, original, original_label) {
|
||||||
window.console.log(digital, un, original)
|
window.console.log(digital, un, original)
|
||||||
document.getElementById('digital').checked = digital
|
document.getElementById('digital').checked = digital
|
||||||
document.getElementById('un').checked = un
|
document.getElementById('un').checked = un
|
||||||
document.getElementById('original').checked = original
|
document.getElementById('original').checked = original
|
||||||
|
document.getElementById('original_label').innerText = original_label
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!-- End Google Tag Manager -->
|
<!-- End Google Tag Manager -->
|
||||||
|
@ -151,7 +152,7 @@
|
||||||
id="counterspell"
|
id="counterspell"
|
||||||
name="whichguesser"
|
name="whichguesser"
|
||||||
value="counterspell"
|
value="counterspell"
|
||||||
onchange="updateSettingDefault(true, true, false)"
|
onchange="updateSettingDefault(true, true, false, 'only first printing')"
|
||||||
checked
|
checked
|
||||||
/>
|
/>
|
||||||
<label class="radio-label" for="counterspell">
|
<label class="radio-label" for="counterspell">
|
||||||
|
@ -174,7 +175,7 @@
|
||||||
id="burn"
|
id="burn"
|
||||||
name="whichguesser"
|
name="whichguesser"
|
||||||
value="burn"
|
value="burn"
|
||||||
onchange="updateSettingDefault(true, true, false)"
|
onchange="updateSettingDefault(true, true, false, 'only first printing')"
|
||||||
/>
|
/>
|
||||||
<label class="radio-label" for="burn">
|
<label class="radio-label" for="burn">
|
||||||
<img
|
<img
|
||||||
|
@ -196,7 +197,7 @@
|
||||||
id="beast"
|
id="beast"
|
||||||
name="whichguesser"
|
name="whichguesser"
|
||||||
value="beast"
|
value="beast"
|
||||||
onchange="updateSettingDefault(true, true, false)"
|
onchange="updateSettingDefault(true, true, false, 'only first printing')"
|
||||||
/>
|
/>
|
||||||
<label class="radio-label" for="beast">
|
<label class="radio-label" for="beast">
|
||||||
<img
|
<img
|
||||||
|
@ -218,7 +219,7 @@
|
||||||
id="basic"
|
id="basic"
|
||||||
name="whichguesser"
|
name="whichguesser"
|
||||||
value="basic"
|
value="basic"
|
||||||
onchange="updateSettingDefault(true, true, true)"
|
onchange="updateSettingDefault(true, true, true, 'only expansions')"
|
||||||
/>
|
/>
|
||||||
<label class="radio-label" for="basic">
|
<label class="radio-label" for="basic">
|
||||||
<img
|
<img
|
||||||
|
@ -240,7 +241,7 @@
|
||||||
id="commander"
|
id="commander"
|
||||||
name="whichguesser"
|
name="whichguesser"
|
||||||
value="commander"
|
value="commander"
|
||||||
onchange="updateSettingDefault(false, false, false)"
|
onchange="updateSettingDefault(false, false, false, 'only first printing')"
|
||||||
/>
|
/>
|
||||||
<label class="radio-label" for="commander">
|
<label class="radio-label" for="commander">
|
||||||
<img
|
<img
|
||||||
|
@ -262,7 +263,7 @@
|
||||||
id="artist"
|
id="artist"
|
||||||
name="whichguesser"
|
name="whichguesser"
|
||||||
value="artist"
|
value="artist"
|
||||||
onchange="updateSettingDefault(true, true, true)"
|
onchange="updateSettingDefault(true, true, true, 'only include cards')"
|
||||||
/>
|
/>
|
||||||
<label class="radio-label" for="artist">
|
<label class="radio-label" for="artist">
|
||||||
<img
|
<img
|
||||||
|
@ -293,7 +294,9 @@
|
||||||
<label for="un">include un-cards</label>
|
<label for="un">include un-cards</label>
|
||||||
<br />
|
<br />
|
||||||
<input type="checkbox" name="original" id="original" />
|
<input type="checkbox" name="original" id="original" />
|
||||||
<label for="original">only original set printing</label>
|
<label for="original"
|
||||||
|
><span id="original_label">only first printing</span></label
|
||||||
|
>
|
||||||
</details>
|
</details>
|
||||||
<input type="submit" id="submit" value="Play" />
|
<input type="submit" id="submit" value="Play" />
|
||||||
</form>
|
</form>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user