30 players finished

This commit is contained in:
itten
2026-08-02 17:54:45 +03:00
parent 243fc7d509
commit ce3384dd1a
43 changed files with 86 additions and 85 deletions
+4 -3
View File
@@ -21,6 +21,7 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.path.join(BASE_DIR, "data")
CSV_PATH = os.path.join(BASE_DIR, "assets", "transfers-list.csv")
CLUBS_DIR = os.path.join(BASE_DIR, "clubs-logo")
PLAYER_DIR = os.path.join(BASE_DIR, "players")
os.makedirs(DATA_DIR, exist_ok=True)
@@ -142,7 +143,7 @@ def main():
warnings.append(f"Row {i+1}: unknown club '{club_name}' -> auto colours {color}")
photo = r["photo"] if r["photo"] else "tmp-player.png"
photo_path = os.path.join(BASE_DIR, photo)
photo_path = os.path.join(PLAYER_DIR, photo)
if not os.path.exists(photo_path):
warnings.append(f"Row {i+1}: photo '{photo}' not found at project root")
@@ -165,7 +166,7 @@ def main():
transfers_json.append({
"id": i + 1,
"playerName": r["player"],
"photo": photo,
"photo": f"players/{photo}",
"team": {
"name": club_name,
"logo": f"clubs-logo/{logo}" if logo else "",
@@ -177,7 +178,7 @@ def main():
})
json_path = os.path.join(DATA_DIR, "transfers.json")
with open(json_path, "w") as f:
with open(json_path, "w", encoding="utf-8") as f:
json.dump({"transfers": transfers_json}, f, indent=2, ensure_ascii=False)
f.write("\n")
print(f" Data -> {os.path.relpath(json_path, BASE_DIR)}")