fix: 脚本路径同步更新为YYYY/MM/DD嵌套结构

This commit is contained in:
Beast
2026-06-24 00:40:39 +08:00
parent 26202b5529
commit 8fe311b2cb
2 changed files with 4 additions and 2 deletions

View File

@ -121,7 +121,8 @@ def _build_report(date_str, work_memos):
def _write_report(date_str, report_text):
"""Write report to ai-insights/daily/YYYY-MM-DD/work/"""
output_root = get_output_dir("daily")
work_dir = os.path.join(output_root, date_str, "work")
parts = date_str.split("-")
work_dir = os.path.join(output_root, parts[0], parts[1], parts[2], "work")
os.makedirs(work_dir, exist_ok=True)
filepath = os.path.join(work_dir, f"工作日志_{date_str}.md")

View File

@ -163,7 +163,8 @@ def read_week_daily_reports(week_start, week_end):
date_str = current.strftime("%Y-%m-%d")
# Daily reports are named: 每日阅读_YYYY-MM-DD.md
filename = f"每日阅读_{date_str}.md"
filepath = os.path.join(daily_dir, filename)
parts = date_str.split("-")
filepath = os.path.join(daily_dir, parts[0], parts[1], parts[2], filename)
if os.path.exists(filepath):
with open(filepath, "r", encoding="utf-8") as f: