优化完成比赛标题格式
- 比分移到✓符号后面:✓ 2-0 Team1 vs Team2 - 更新 run_sync.sh 说明文字 - 修复格式匹配逻辑
This commit is contained in:
parent
a1573a3f82
commit
dc63c9bd01
@ -6,9 +6,9 @@
|
||||
- 现在: `Team1 vs Team2 [The International 2025]`
|
||||
- **简化的完成标记**:
|
||||
- 之前: `[COMPLETED] Dota 2 - Tournament: Team1 vs Team2`
|
||||
- 现在: `✓ Team1 vs Team2 [Tournament] (2-0)`
|
||||
- 现在: `✓ 2-0 Team1 vs Team2 [Tournament]`
|
||||
- 移除了 "Dota 2" 字样,让日历更简洁
|
||||
- 完成的比赛直接在标题显示比分
|
||||
- 比分紧跟在✓后面,更加紧凑
|
||||
|
||||
## v3.0 - 时间变更检测
|
||||
- 新增比赛时间变更自动检测
|
||||
|
||||
@ -18,4 +18,7 @@ python3 sync_dota2_matches.py --calendar-id "$CALENDAR_ID"
|
||||
echo ""
|
||||
echo "✅ 同步完成!"
|
||||
echo "📅 请在 Google Calendar 中查看更新的比赛"
|
||||
echo "🏆 已完成的比赛会显示 [COMPLETED] 标记和比分"
|
||||
echo ""
|
||||
echo "标题格式说明:"
|
||||
echo " 未开始: Team1 vs Team2 [Tournament]"
|
||||
echo " 已完成: ✓ 2-0 Team1 vs Team2 [Tournament]"
|
||||
@ -249,9 +249,11 @@ class Dota2CalendarSync:
|
||||
|
||||
# Also create key based on teams and tournament for matching
|
||||
summary = event.get('summary', '')
|
||||
# Remove completed markers
|
||||
summary = summary.replace('[COMPLETED] ', '').replace('✓ ', '')
|
||||
# Remove score if present
|
||||
# Remove completed markers and scores
|
||||
summary = summary.replace('[COMPLETED] ', '')
|
||||
# Remove checkmark and score (format: "✓ 2-1 Team vs Team")
|
||||
summary = re.sub(r'^✓\s+\d+[-:]\d+\s+', '', summary)
|
||||
# Also handle old format with score at end
|
||||
summary = re.sub(r'\s*\([0-9\-\?]+\)\s*$', '', summary)
|
||||
|
||||
# Try new format first: "Team1 vs Team2 [Tournament]"
|
||||
@ -428,8 +430,9 @@ class Dota2CalendarSync:
|
||||
# Update the summary to show it's completed with result
|
||||
summary = event.get('summary', '')
|
||||
if '✓' not in summary:
|
||||
# Add checkmark and score to the title
|
||||
summary = f"✓ {summary} ({match_data.get('score', '?-?')})"
|
||||
# Add checkmark and score right after it
|
||||
score = match_data.get('score', '?-?')
|
||||
summary = f"✓ {score} {summary}"
|
||||
|
||||
# Update the event
|
||||
event['description'] = description
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user