-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhitelist_vote_igdb.py
41 lines (27 loc) · 981 Bytes
/
whitelist_vote_igdb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import json
from pathlib import Path
from anonymize_data import get_data_folder
from igdb_databases import get_igdb_file_name_suffix
from my_types import HardCodedIDs
def get_file_name_for_whitelisted_igdb_ids(
release_year: str | None = None,
) -> str:
suffix = get_igdb_file_name_suffix(release_year)
return get_data_folder() + "whitelisted_igdb_ids" + suffix + ".json"
def load_whitelisted_igdb_ids(
release_year: str | None = None,
) -> HardCodedIDs:
file_name = get_file_name_for_whitelisted_igdb_ids(release_year=release_year)
try:
with Path(file_name).open(encoding="utf-8") as f:
whitelisted_igdb_ids = json.load(f)
except FileNotFoundError:
print(f"File {file_name} not found.")
whitelisted_igdb_ids = {}
return whitelisted_igdb_ids
def main() -> bool:
release_year = "2018"
load_whitelisted_igdb_ids(release_year=release_year)
return True
if __name__ == "__main__":
main()