IDAC: Improvements

- Fixed play stamp event name not shown
- Fixed broken cars such as: LEVIN SR (AE85), SKYLINE 25GT TURBO (ER34), S2000 (AP1), GR SUPRA (DB42), SWIFT Sport (ZC33S), LANCER RS EVOLUTION Ⅴ (CP9A), LANCER GSR EVOLUTION Ⅵ TMEDITION (CP9A)
- Fixed bunta/special mode not properly updating
- Fixed frontend (for real this time)
This commit is contained in:
2023-10-08 19:56:04 +02:00
parent 8ccb7f08f2
commit d55ada2538
8 changed files with 92 additions and 30 deletions

View File

@ -2,12 +2,13 @@ import os
import hashlib
def prepare_images(image_folder="./images"):
def prepare_images(image_folder="titles/idac/data/images"):
print(f"Preparing image delivery files in {image_folder}...")
for file in os.listdir(image_folder):
if file.endswith(".png") or file.endswith(".jpg"):
dpg_name = "adv-" + file[:-4].upper()
# dpg_name = "adv-" + file[:-4].upper()
dpg_name = file[:-4]
if file.endswith(".png"):
dpg_name += ".dpg"
else:
@ -22,10 +23,11 @@ def prepare_images(image_folder="./images"):
original_image = original_image_file.read()
image_hash = hashlib.md5(original_image).hexdigest()
print(
f"DPG for {file} not found, creating with hash {image_hash}..."
f"DPG for {file} not found, creating with hash {image_hash.upper()} ..."
)
md5_buf = bytes.fromhex(image_hash)
dpg_buf = md5_buf + original_image
dpg_name = "adv-" + image_hash.upper() + dpg_name[:-4]
with open(os.path.join(image_folder, dpg_name), "wb") as dpg_file:
dpg_file.write(dpg_buf)