From b4edcb7309b0a370b1fd9f0a889b8613042391a6 Mon Sep 17 00:00:00 2001 From: marsteralex Date: Sat, 17 Sep 2022 02:20:26 +0200 Subject: [PATCH] update jsons --- web/public/mtg/app.js | 2 +- web/public/mtg/importCards.py | 20 ++++++++++---------- web/public/mtg/index.html | 4 ++-- web/public/mtg/jsons/artist.json | 2 +- web/public/mtg/jsons/set.json | 2 +- web/public/mtg/jsons/watermark.json | 2 +- web/public/mtg/jsons/wm.json | 21 ++++++++++++++++++++- 7 files changed, 36 insertions(+), 17 deletions(-) diff --git a/web/public/mtg/app.js b/web/public/mtg/app.js index ff18dacf..0ae42a4a 100644 --- a/web/public/mtg/app.js +++ b/web/public/mtg/app.js @@ -73,7 +73,7 @@ function putIntoMapAndFetch(data) { } else if (whichGuesser === 'commander') { document.getElementById('guess-type').innerText = 'General Knowledge' } else if (whichGuesser === 'watermark') { - document.getElementById('guess-type').innerText = 'Watermark' + document.getElementById('guess-type').innerText = 'Watermark It' } else if (whichGuesser === 'artist') { document.getElementById('guess-type').innerText = 'Aesthetic Consultation' } diff --git a/web/public/mtg/importCards.py b/web/public/mtg/importCards.py index 2ad14a2b..80cb6a48 100644 --- a/web/public/mtg/importCards.py +++ b/web/public/mtg/importCards.py @@ -51,7 +51,7 @@ def generate_initial_special_query(category): elif category == 'basic': string_query += 't%3Abasic&order=released&dir=asc&unique=prints&page=' elif category == 'watermark': - string_query += 'has%3Awatermark+-t%3Atoken+-st%3Amemorabilia+-set%3Aplist+-name%3A%2F%5EA-%2F&order=released&dir=asc&unique=prints&page=' + string_query += 'has%3Awatermark+not%3Apromo+-t%3Atoken+-st%3Amemorabilia+-set%3Aplist+-name%3A%2F%5EA-%2F&order=released&dir=asc&unique=prints&page=' # add category string query here print(string_query) return string_query @@ -121,7 +121,7 @@ def fetch_and_write_all_artist(): queried_artists_pre = artist_ids[i*37:min((i+1)*37, len(artist_ids))] queried_artists = [] for j in range(len(queried_artists_pre)): - if artists[queried_artists_pre[j]][1] >= 50 or artists[queried_artists_pre[j]][0] in artist_allowlist: + if artists[queried_artists_pre[j]][1] >= 60 or artists[queried_artists_pre[j]][0] in artist_allowlist: queried_artists.append(queried_artists_pre[j]) print(queried_artists) print(i) @@ -219,7 +219,7 @@ def to_compact_write_form_special(smallJson, art_names, response, category, arti fieldsInArtist = ['image_uris', 'digital', 'set_type', 'artist_ids', 'security_stamp'] fieldsInWatermark = ['image_uris', 'watermark', - 'set_type', 'digital', 'security_stamp', 'promo', 'set'] + 'set_type', 'digital', 'security_stamp', 'set'] data = smallJson['data'] # write all fields needed in card for card in response['data']: @@ -360,13 +360,13 @@ def write_image_uris(card_image_uris): if __name__ == "__main__": - # for category in allCategories: - # print(category) - # fetch_and_write_all(category, generate_initial_query(category)) - # for category in specialCategories: - # print(category) - # fetch_and_write_all_special( - # category, generate_initial_special_query(category)) + for category in allCategories: + print(category) + fetch_and_write_all(category, generate_initial_query(category)) + for category in specialCategories: + print(category) + fetch_and_write_all_special( + category, generate_initial_special_query(category)) # uncomment this once in a while, but it's expensive to run # fetch_and_write_initial_artist_query() fetch_and_write_all_artist() diff --git a/web/public/mtg/index.html b/web/public/mtg/index.html index 173f6f27..93f1ca7a 100644 --- a/web/public/mtg/index.html +++ b/web/public/mtg/index.html @@ -269,9 +269,9 @@ Watermark It