Spaces:
Running
Running
Update history_manager.py
Browse files- history_manager.py +4 -1
history_manager.py
CHANGED
@@ -60,13 +60,16 @@ class UserHistoryManager:
|
|
60 |
processed_result = {
|
61 |
'breed': result.get('breed', 'Unknown'),
|
62 |
'overall_score': result.get('overall_score', result.get('final_score', 0)),
|
63 |
-
'rank': result.get('rank', 0)
|
|
|
64 |
}
|
65 |
processed_results.append(processed_result)
|
66 |
history_entry["results"] = processed_results
|
67 |
|
68 |
# 加入使用者偏好設定(如果有的話)
|
69 |
if user_preferences:
|
|
|
|
|
70 |
history_entry["preferences"] = user_preferences
|
71 |
|
72 |
# 讀取現有歷史
|
|
|
60 |
processed_result = {
|
61 |
'breed': result.get('breed', 'Unknown'),
|
62 |
'overall_score': result.get('overall_score', result.get('final_score', 0)),
|
63 |
+
'rank': result.get('rank', 0),
|
64 |
+
'size': result.get('size', 'Unknown')
|
65 |
}
|
66 |
processed_results.append(processed_result)
|
67 |
history_entry["results"] = processed_results
|
68 |
|
69 |
# 加入使用者偏好設定(如果有的話)
|
70 |
if user_preferences:
|
71 |
+
if 'size_preference' not in user_preferences and 'size_preference' in vars():
|
72 |
+
user_preferences['size_preference'] = size_preference
|
73 |
history_entry["preferences"] = user_preferences
|
74 |
|
75 |
# 讀取現有歷史
|