fix: 防止未开始的比赛被错误标记为完成 v4.4

问题修复:
- 添加时间检查,只有已开始的比赛才能标记为完成
- 防止Liquipedia的预设比分导致未来比赛被误标为完成
- 修复了XG vs PV等未开始比赛显示完成状态的问题

技术细节:
- 在_parse_match方法中增加match_has_started检查
- 只有match_datetime <= now时才判断比赛是否完成
- 对未来比赛的比分记录debug日志但不标记为完成

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ching 2025-09-14 12:27:35 +08:00
parent d01c6aab85
commit cf679b7107

View File

@ -317,7 +317,16 @@ class Dota2CalendarSync:
score2 = int(score_parts.group(2)) score2 = int(score_parts.group(2))
# Check if series is completed # Check if series is completed
completed = self._is_series_completed(score1, score2, format_str) # Only mark as completed if the match has already started
now = datetime.now(pytz.UTC)
match_has_started = match_datetime <= now
if match_has_started:
completed = self._is_series_completed(score1, score2, format_str)
else:
# Future match with score - likely a placeholder/prediction
completed = False
logger.debug(f"Future match {team1} vs {team2} has score {score} but not marking as completed")
if completed: if completed:
winner = team1 if score1 > score2 else team2 winner = team1 if score1 > score2 else team2