mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-13 15:35:46 -04:00
Add JSON game database to replace dat parsing
This commit is contained in:
20
scripts/merge_gamedb.py
Normal file
20
scripts/merge_gamedb.py
Normal file
@ -0,0 +1,20 @@
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
|
||||
if __name__ == "__main__":
|
||||
if (len(sys.argv) < 3):
|
||||
print("usage: %s <gamedb dir> <output path>" % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
games = []
|
||||
for file in os.listdir(sys.argv[1]):
|
||||
with open(os.path.join(sys.argv[1], file), "r") as f:
|
||||
fgames = json.load(f)
|
||||
games.extend(list(fgames))
|
||||
|
||||
|
||||
with open(sys.argv[2], "w") as f:
|
||||
json.dump(games, f, indent=1)
|
||||
|
||||
print("Wrote %s" % sys.argv[2])
|
Reference in New Issue
Block a user