Skip to content

Commit fa426e4

Browse files
committed
add rename_folders.py
1 parent da7a94d commit fa426e4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/rename_folders.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import json
2+
import os
3+
import shutil
4+
5+
# Load game name to ID mapping
6+
with open('json/ids.json', 'r') as f:
7+
game_mappings = json.load(f)
8+
9+
# Iterate over the directories inside 'json' folder
10+
base_path = 'json'
11+
for game_name in os.listdir(base_path):
12+
full_path = os.path.join(base_path, game_name)
13+
if os.path.isdir(full_path) and game_name in game_mappings:
14+
game_id = game_mappings[game_name]
15+
new_full_path = os.path.join(base_path, game_id)
16+
shutil.move(full_path, new_full_path)

0 commit comments

Comments
 (0)