From a21a813d8361a30499738d13452b00eca13a1ca4 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Wed, 8 Apr 2026 18:38:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 只在手动点击'重新生成标题'按钮时才触发标题生成 --- app.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app.py b/app.py index 89763cd..2b3634f 100644 --- a/app.py +++ b/app.py @@ -167,18 +167,9 @@ def api_update_note(note_id): now = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - # 判断是否需要生成新标题 - old_content = note.get('content', '') - need_new_title = (not note['title'] or note['title'] == '新记录' or - len(old_content) < 50 and len(content) >= 50) - note['content'] = content note['updated_at'] = now - # 如果内容变化较大,异步生成新标题 - if need_new_title and len(content) >= 20: - threading.Thread(target=generate_title_async, args=(note_id, content)).start() - save_notes(notes) return jsonify(note)