enhance store files naming

This commit is contained in:
NoeBerdoz
2025-04-12 14:00:11 +02:00
parent 80bf8e531c
commit 3f406f1417
2 changed files with 10 additions and 4 deletions

View File

@ -10,7 +10,7 @@ GAME_FILES_DIR = config.GAME_FILES_DIR
# Define padding for round numbers (e.g., 6 digits for up to 999,999 rounds)
FOLDER_ROUND_PADDING = 6
def store_game_round_data(response: GameStartResponseDTO | GameDecisionResponseDTO, round_number: int, session_id: str):
def store_game_round_data(decision: str, response: GameStartResponseDTO | GameDecisionResponseDTO, round_number: int, session_id: str, status: str):
"""
Logs structured response data and saves associated client files.
"""
@ -18,7 +18,7 @@ def store_game_round_data(response: GameStartResponseDTO | GameDecisionResponseD
try:
padded_round = str(round_number).zfill(FOLDER_ROUND_PADDING)
round_folder_name = f"{padded_round}_decision"
round_folder_name = f"{padded_round}_decision_{decision.lower()}_{status.lower()}"
# Construct the directory path: base_dir / session_id / decision_XXXXXX
round_dir = os.path.join(GAME_FILES_DIR, str(session_id), round_folder_name)