add artists

This commit is contained in:
marsteralex 2022-09-10 00:09:30 +02:00
parent e204b336b3
commit c30a2b05c2
8 changed files with 61 additions and 7 deletions

View File

@ -39,6 +39,11 @@ if (whichGuesser === 'basic') {
.then((response) => response.json())
.then((data) => (sets = data))
}
if (whichGuesser === 'artist') {
fetch('jsons/artistList.json')
.then((response) => response.json())
.then((data) => (sets = data))
}
let firstFetch = fetch('jsons/' + whichGuesser + '.json')
fetchToResponse(firstFetch)
@ -66,6 +71,8 @@ function putIntoMapAndFetch(data) {
document.getElementById('guess-type').innerText = 'How Basic'
} else if (whichGuesser === 'commander') {
document.getElementById('guess-type').innerText = 'General Knowledge'
} else if (whichGuesser === 'artist') {
document.getElementById('guess-type').innerText = 'Aesthetic Consultation'
}
setUpNewGame()
}
@ -145,6 +152,15 @@ function determineIfSkip(card) {
) {
return true
}
} else if (whichGuesser == 'artist') {
if (
card.set_type === 'token' ||
card.set_type === 'vanguard' ||
card.set_type === 'planechase' ||
card.set_type === 'archenemy'
) {
return true
}
} else {
if (
card.reprint === true ||
@ -179,6 +195,8 @@ function putIntoMap(data) {
sets[name][1] +
'" /> ' +
sets[name][0]
} else if (whichGuesser === 'artist') {
name = sets[name]
}
let normalImg = ''
if (card.image_uris.normal) {

View File

@ -5,6 +5,7 @@ import json
# add category name here
allCategories = ['counterspell', 'beast', 'burn', 'commander', 'artist'] #, 'terror', 'wrath', 'zombie', 'artifact']
specialCategories = ['set', 'basic']
artists = dict()
def generate_initial_query(category):
@ -29,8 +30,8 @@ def generate_initial_query(category):
# string_query += '-type%3Alegendary+type%3Azombie+-type%3Atoken'
# elif category == 'artifact':
# string_query += 't%3Aartifact&order=released&dir=asc&unique=prints&page='
# elif category == 'artist':
# string_query+= 'a%3A"Wylie+Beckert"+or+a%3A“Ernanda+Souza”+or+a%3A"randy+gallegos"+or+a%3A“Amy+Weber”+or+a%3A“Dan+Frazier”+or+a%3A“Thomas+M.+Baxa”+or+a%3A“Phil+Foglio”+or+a%3A“DiTerlizzi”+or+a%3A"steve+argyle"+or+a%3A"Veronique+Meignaud"+or+a%3A"Magali+Villeneuve"+or+a%3A"Michael+Sutfin"+or+a%3A“Volkan+Baǵa”+or+a%3A“Franz+Vohwinkel”+or+a%3A"Nils+Hamm"+or+a%3A"Mark+Poole"+or+a%3A"Carl+Critchlow"+or+a%3A"rob+alexander"+or+a%3A"igor+kieryluk"+or+a%3A“Victor+Adame+Minguez”+or+a%3A"johannes+voss"+or+a%3A"Svetlin+Velinov"+or+a%3A"ron+spencer"+or+a%3A"rk+post"+or+a%3A"kev+walker"+or+a%3A"rebecca+guay"+or+a%3A"seb+mckinnon"+or+a%3A"pete+venters"+or+a%3A"greg+staples"+or+a%3A"Christopher+Moeller"+or+a%3A"christopher+rush"+or+a%3A"Mark+Tedin"'
elif category == 'artist':
string_query+= '%28a%3A"Wylie+Beckert"+or+a%3A“David+Martin”+or+a%3A“Ernanda+Souza”+or+a%3A"randy+gallegos"+or+a%3A“Amy+Weber”+or+a%3A“Dan+Frazier”+or+a%3A“Thomas+M.+Baxa”+or+a%3A“Phil+Foglio”+or+a%3A“DiTerlizzi”+or+a%3A"steve+argyle"+or+a%3A"Veronique+Meignaud"+or+a%3A"Magali+Villeneuve"+or+a%3A"Michael+Sutfin"+or+a%3A“Volkan+Baǵa”+or+a%3A“Franz+Vohwinkel”+or+a%3A"Nils+Hamm"+or+a%3A"Mark+Poole"+or+a%3A"Carl+Critchlow"+or+a%3A"rob+alexander"+or+a%3A"igor+kieryluk"+or+a%3A“Victor+Adame+Minguez”+or+a%3A"johannes+voss"+or+a%3A"Svetlin+Velinov"+or+a%3A"ron+spencer"+or+a%3A"rk+post"+or+a%3A"kev+walker"+or+a%3A"rebecca+guay"+or+a%3A"seb+mckinnon"+or+a%3A"pete+venters"+or+a%3A"greg+staples"+or+a%3A"Christopher+Moeller"+or+a%3A"christopher+rush"+or+a%3A"Mark+Tedin"%29+not%3Adfc'
# add category string query here
string_query += '+-%28set%3Asld+%28%28cn>%3D231+cn<%3D233%29+or+%28cn>%3D321+cn<%3D324%29+or+%28cn>%3D185+cn' \
'<%3D189%29+or+%28cn>%3D138+cn<%3D142%29+or+%28cn>%3D364+cn<%3D368%29+or+cn%3A669+or+cn%3A670%29' \
@ -104,6 +105,9 @@ def to_compact_write_form(smallJson, art_names, response, category):
# do not include racist cards
if 'content_warning' in card and card['content_warning'] == True:
continue
# for artist category, do not use multiple artists
if category == 'artist' and len(card['artist_ids']) != 1:
continue
# do not repeat art
if 'card_faces' in card:
card_face = card['card_faces'][0]
@ -119,7 +123,13 @@ def to_compact_write_form(smallJson, art_names, response, category):
for field in fieldsInCard:
# if field == 'name' and category == 'artifact':
# write_card['name'] = card['released_at'].split('-')[0]
if field == 'name' and 'card_faces' in card:
if field =='name' and category == 'artist':
artist_id = card['artist_ids'][0]
artist = card['artist']
if artist_id not in artists or len(artists[artist_id]) > len(artist):
artists[artist_id] = artist
write_card['name'] = card['artist_ids'][0]
elif field == 'name' and 'card_faces' in card:
write_card['name'] = card['card_faces'][0]['name']
elif field == 'image_uris':
if 'card_faces' in card and 'image_uris' in card['card_faces'][0]:
@ -182,3 +192,6 @@ if __name__ == "__main__":
for category in specialCategories:
print(category)
fetch_and_write_all_special(category, generate_initial_special_query(category))
print("artistList")
with open('jsons/artistList.json', 'w') as f:
json.dump(artists, f)

View File

@ -256,6 +256,28 @@
</div>
<br />
<div class="option-row">
<input
type="radio"
id="artist"
name="whichguesser"
value="artist"
onchange="updateSettingDefault(true, true, true)"
/>
<label class="radio-label" for="artist">
<img
class="thumbnail"
src="https://c1.scryfall.com/file/scryfall-cards/art_crop/front/0/4/0464a507-20e5-42d5-8aca-12504a869f21.jpg?1562487441"
/>
<h3>Aesthetic Consultation</h3></label
>
<img
class="level-badge"
src="https://static.wikia.nocookie.net/mtgsalvation_gamepedia/images/a/af/Expert_level.jpg"
/>
</div>
<br />
<details id="addl-options">
<summary>
<img

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"059bba56-5feb-42e4-8c2e-e2f1e6ba11f9": "Dan Frazier", "bfdeaf09-f915-4058-8e8b-bcac3bc43c33": "Mark Poole", "9ee9a9cc-c09e-486f-918b-69f80cbc4188": "Mark Tedin", "c1160787-e72e-4f89-b361-c6864f7a4e3a": "Amy Weber", "35906871-6c78-4ab2-9ed1-e6792c8efb74": "Rob Alexander", "c96773f0-346c-4f7d-9271-2d98cc5d86e1": "Christopher Rush", "dab52c11-0564-4207-a4a1-c1735c946a65": "Ron Spencer", "d54c4a1a-c0c5-4834-84db-125d341f3ad8": "Pete Venters", "3bfc0fd7-f6ce-4c3f-a755-aaafc84ac704": "Phil Foglio", "a5048cc7-438a-4378-98e4-da99b78e1db0": "Randy Gallegos", "f8f662fa-d597-46a3-afb2-91d6e13243e2": "Rebecca Guay", "f366a0ee-a0cd-466d-ba6a-90058c7a31a6": "Kev Walker", "ed44dce4-30cf-4c2c-b2e1-a19ba2295690": "DiTerlizzi", "81ae0f3f-1d88-4125-9aeb-b15b4c734c82": "rk post", "17948f16-611a-44b8-8d10-9895a0bdfff1": "Carl Critchlow", "3a243c17-3baa-4b53-9599-645311cd7d3d": "Franz Vohwinkel", "ff346569-557d-4043-ae44-97c2c7cabd7d": "Thomas M. Baxa", "5ce7b3bd-53d2-49e6-b504-37191e8e9b17": "Michael Sutfin", "93d65564-bf00-447b-8406-e2031f03b6b1": "Greg Staples", "21e10012-06ae-44f2-b38d-3824dd2e73d4": "Christopher Moeller", "996ad764-4ae0-4952-8bb5-5a75c9d68275": "David Martin", "93bec3c0-0260-4d31-8064-5d01efb4153f": "Volkan Ba\u01f5a", "c540d1fc-1500-457f-93cf-d6069ee66546": "Nils Hamm", "a44ddda4-5331-4f83-aac9-3e00ed36bd7b": "Steve Argyle", "41084244-a313-4d14-8123-db05855f9cfe": "V\u00e9ronique Meignaud", "9c3e9d17-509f-485c-9360-46d897ce716b": "Igor Kieryluk", "ffd063ae-c097-4f26-b2e6-b1e2137708bc": "Svetlin Velinov", "3593dd7e-c547-4a32-81cd-7da725f60118": "Johannes Voss", "ad4caca0-8d89-44ce-a1a6-d5ca905bd6fb": "Seb McKinnon", "9e6a55ae-be4d-4c23-a2a5-135737ffd879": "Magali Villeneuve", "bd8f7368-5b10-4554-b6b8-d052c6aca89f": "Victor Adame Minguez", "074daf3d-0849-4c4a-b5a5-c276384e81e5": "Wylie Beckert", "e87a8b19-f97f-4df0-9dda-1310ab0257bb": "Ernanda Souza"}

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