Skip to content

Commit

Permalink
feat(db): add external game ids (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Jan 25, 2025
1 parent 0f23ab8 commit 0cddc1e
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 143 deletions.
322 changes: 179 additions & 143 deletions src/igdb_enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
duplicated_enums = dict(
dates_enum={
0: 'YYYYMMMMDD',
1: 'YYYYMMMM',
2: 'YYYY',
3: 'YYYYQ1',
4: 'YYYYQ2',
5: 'YYYYQ3',
6: 'YYYYQ4',
7: 'TBD',
},
regions_enum={
1: 'europe',
2: 'north_america',
3: 'australia',
4: 'new_zealand',
5: 'japan',
6: 'china',
7: 'asia',
8: 'worldwide',
9: 'korea',
10: 'brazil',
},
websites_enum=dict(
category={
1: 'official',
2: 'wikia',
3: 'wikipedia',
4: 'facebook',
5: 'twitter',
6: 'twitch',
# 7: None,
8: 'instagram',
9: 'youtube',
10: 'iphone',
11: 'ipad',
12: 'android',
13: 'steam',
14: 'reddit',
15: 'itch',
16: 'epicgames',
17: 'gog',
18: 'discord',
},
),
)

enums = dict(
age_ratings=dict(
category={
Expand Down Expand Up @@ -30,24 +77,25 @@
18: 'USK_0',
19: 'USK_6',
20: 'USK_12',
21: 'USK_18',
22: 'GRAC_ALL',
23: 'GRAC_Twelve',
24: 'GRAC_Fifteen',
25: 'GRAC_Eighteen',
26: 'GRAC_TESTING',
27: 'CLASS_IND_L',
28: 'CLASS_IND_Ten',
29: 'CLASS_IND_Twelve',
30: 'CLASS_IND_Fourteen',
31: 'CLASS_IND_Sixteen',
32: 'CLASS_IND_Eighteen',
33: 'ACB_G',
34: 'ACB_PG',
35: 'ACB_M',
36: 'ACB_MA15',
37: 'ACB_R18',
38: 'ACB_RC',
21: 'USK_16',
22: 'USK_18',
23: 'GRAC_ALL',
24: 'GRAC_Twelve',
25: 'GRAC_Fifteen',
26: 'GRAC_Eighteen',
27: 'GRAC_TESTING',
28: 'CLASS_IND_L',
29: 'CLASS_IND_Ten',
30: 'CLASS_IND_Twelve',
31: 'CLASS_IND_Fourteen',
32: 'CLASS_IND_Sixteen',
33: 'CLASS_IND_Eighteen',
34: 'ACB_G',
35: 'ACB_PG',
36: 'ACB_M',
37: 'ACB_MA15',
38: 'ACB_R18',
39: 'ACB_RC',
},
rating_age={
1: 3,
Expand All @@ -70,30 +118,114 @@
18: 1,
19: 6,
20: 12,
21: 18,
22: 1,
23: 12,
24: 15,
25: 18,
21: 16,
22: 18,
23: 1,
24: 12,
25: 15,
26: 18,
27: 1,
28: 10,
29: 12,
30: 14,
31: 16,
32: 18,
33: 1,
34: 13,
35: 15,
27: 18,
28: 1,
29: 10,
30: 12,
31: 14,
32: 16,
33: 18,
34: 1,
35: 13,
36: 15,
37: 18,
37: 15,
38: 18,
39: 18,
},
),
age_rating_contect_descriptions=dict(
category={
1: 'PEGI',
2: 'ESRB',
1: 'ESRB_alcohol_reference',
2: 'ESRB_animated_blood',
3: 'ESRB_blood',
4: 'ESRB_blood_and_gore',
5: 'ESRB_cartoon_violence',
6: 'ESRB_comic_mischief',
7: 'ESRB_crude_humor',
8: 'ESRB_drug_reference',
9: 'ESRB_fantasy_violence',
10: 'ESRB_intense_violence',
11: 'ESRB_language',
12: 'ESRB_lyrics',
13: 'ESRB_mature_humor',
14: 'ESRB_nudity',
15: 'ESRB_partial_nudity',
16: 'ESRB_real_gambling',
17: 'ESRB_sexual_content',
18: 'ESRB_sexual_themes',
19: 'ESRB_sexual_violence',
20: 'ESRB_simulated_gambling',
21: 'ESRB_strong_language',
22: 'ESRB_strong_lyrics',
23: 'ESRB_strong_sexual_content',
24: 'ESRB_suggestive_themes',
25: 'ESRB_tobacco_reference',
26: 'ESRB_use_of_alcohol',
27: 'ESRB_use_of_drugs',
28: 'ESRB_use_of_tobacco',
29: 'ESRB_violence',
30: 'ESRB_violent_references',
31: 'ESRB_animated_violence',
32: 'ESRB_mild_language',
33: 'ESRB_mild_violence',
34: 'ESRB_use_of drugs and alcohol',
35: 'ESRB_drug_and alcohol reference',
36: 'ESRB_mild_suggestive themes',
37: 'ESRB_mild_cartoon violence',
38: 'ESRB_mild_blood',
39: 'ESRB_realistic_blood and gore',
40: 'ESRB_realistic_violence',
41: 'ESRB_alcohol_and tobacco reference',
42: 'ESRB_mature_sexual themes',
43: 'ESRB_mild_animated violence',
44: 'ESRB_mild_sexual themes',
45: 'ESRB_use_of alcohol and tobacco',
46: 'ESRB_animated_blood and gore',
47: 'ESRB_mild_fantasy violence',
48: 'ESRB_mild_lyrics',
49: 'ESRB_realistic_blood',
50: 'PEGI_violence',
51: 'PEGI_sex',
52: 'PEGI_drugs',
53: 'PEGI_fear',
54: 'PEGI_discrimination',
55: 'PEGI_bad_language',
56: 'PEGI_gambling',
57: 'PEGI_online_gameplay',
58: 'PEGI_in_game_purchases',
59: 'CERO_love',
60: 'CERO_sexual_content',
61: 'CERO_violence',
62: 'CERO_horror',
63: 'CERO_drinking_smoking',
64: 'CERO_gambling',
65: 'CERO_crime',
66: 'CERO_controlled_substances',
67: 'CERO_languages_and others',
68: 'GRAC_sexuality',
69: 'GRAC_violence',
70: 'GRAC_fear_horror_threatening',
71: 'GRAC_language',
72: 'GRAC_alcohol_tobacco_drug',
73: 'GRAC_crime_anti_social',
74: 'GRAC_gambling',
75: 'CLASS_IND_violencia',
76: 'CLASS_IND_violencia_extrema',
77: 'CLASS_IND_conteudo_sexual',
78: 'CLASS_IND_nudez',
79: 'CLASS_IND_sexo',
80: 'CLASS_IND_sexo_explicito',
81: 'CLASS_IND_drogas',
82: 'CLASS_IND_drogas_licitas',
83: 'CLASS_IND_drogas_ilicitas',
84: 'CLASS_IND_linguagem_impropria',
85: 'CLASS_IND_atos_criminosos',
},
),
characters=dict(
Expand All @@ -111,49 +243,10 @@
},
),
companies=dict(
change_date_category={
0: 'YYYYMMMMDD',
1: 'YYYYMMMM',
2: 'YYYY',
3: 'YYYYQ1',
4: 'YYYYQ2',
5: 'YYYYQ3',
6: 'YYYYQ4',
7: 'TBD',
},
start_date_category={
0: 'YYYYMMMMDD',
1: 'YYYYMMMM',
2: 'YYYY',
3: 'YYYYQ1',
4: 'YYYYQ2',
5: 'YYYYQ3',
6: 'YYYYQ4',
7: 'TBD',
},
),
company_websites=dict(
category={
1: 'official',
2: 'wikia',
3: 'wikipedia',
4: 'facebook',
5: 'twitter',
6: 'twitch',
# 7: None,
8: 'instagram',
9: 'youtube',
10: 'iphone',
11: 'ipad',
12: 'android',
13: 'steam',
14: 'reddit',
15: 'itch',
16: 'epicgames',
17: 'gog',
18: 'discord',
},
change_date_category=duplicated_enums['dates_enum'].copy(),
start_date_category=duplicated_enums['dates_enum'].copy(),
),
company_websites=duplicated_enums['websites_enum'].copy(),
games=dict(
category={
0: 'main_game',
Expand All @@ -169,6 +262,8 @@
10: 'expanded_game',
11: 'port',
12: 'fork',
13: 'pack',
14: 'update',
},
status={
0: 'released',
Expand Down Expand Up @@ -206,28 +301,8 @@
},
),
platform_version_release_dates=dict(
category={
0: 'YYYYMMMMDD',
1: 'YYYYMMMM',
2: 'YYYY',
3: 'YYYYQ1',
4: 'YYYYQ2',
5: 'YYYYQ3',
6: 'YYYYQ4',
7: 'TBD',
},
region={
1: 'europe',
2: 'north_america',
3: 'australia',
4: 'new_zealand',
5: 'japan',
6: 'china',
7: 'asia',
8: 'worldwide',
9: 'korea',
10: 'brazil',
},
category=duplicated_enums['dates_enum'].copy(),
region=duplicated_enums['regions_enum'].copy(),
),
platform_websites=dict(
category={
Expand All @@ -254,28 +329,8 @@
},
),
release_dates=dict(
category={
0: 'YYYYMMMMDD',
1: 'YYYYMMMM',
2: 'YYYY',
3: 'YYYYQ1',
4: 'YYYYQ2',
5: 'YYYYQ3',
6: 'YYYYQ4',
7: 'TBD',
},
region={
1: 'europe',
2: 'north_america',
3: 'australia',
4: 'new_zealand',
5: 'japan',
6: 'china',
7: 'asia',
8: 'worldwide',
9: 'korea',
10: 'brazil',
},
category=duplicated_enums['dates_enum'].copy(),
region=duplicated_enums['regions_enum'].copy(),
),
external_games=dict(
category={
Expand All @@ -297,32 +352,13 @@
32: 'kartridge',
36: 'playstation_store_us',
37: 'focus_entertainment',
54: 'xbox_game_pass_ultimate_cloud',
55: 'gamejolt',
},
media={
1: 'digital',
2: 'physical',
},
),
websites=dict(
category={
1: 'official',
2: 'wikia',
3: 'wikipedia',
4: 'facebook',
5: 'twitter',
6: 'twitch',
# 7: None,
8: 'instagram',
9: 'youtube',
10: 'iphone',
11: 'ipad',
12: 'android',
13: 'steam',
14: 'reddit',
15: 'itch',
16: 'epicgames',
17: 'gog',
18: 'discord',
},
),
websites=duplicated_enums['websites_enum'].copy(),
)
6 changes: 6 additions & 0 deletions src/update_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ def get_data():
'artworks.url',
'collection.name',
'cover.url',
'external_games.category',
'external_games.media',
'external_games.name',
'external_games.platform',
'external_games.uid',
'external_games.url',
'franchise.name',
'franchises.name',
'game_modes.name',
Expand Down

0 comments on commit 0cddc1e

Please sign in to comment.