Spaces:
Runtime error
Runtime error
buletomato25
commited on
Commit
·
ba81acb
1
Parent(s):
a2d1919
addreset
Browse files- app.py +1 -1
- templates/talkDetail.html +8 -2
app.py
CHANGED
|
@@ -54,7 +54,7 @@ def reset_html():
|
|
| 54 |
return render_template('reset.html')
|
| 55 |
#メンバー削除
|
| 56 |
@app.route('/reset_member', methods=['GET', 'POST'])
|
| 57 |
-
def
|
| 58 |
users.clear()
|
| 59 |
return render_template('index.html', users = users)
|
| 60 |
|
|
|
|
| 54 |
return render_template('reset.html')
|
| 55 |
#メンバー削除
|
| 56 |
@app.route('/reset_member', methods=['GET', 'POST'])
|
| 57 |
+
def reset_member():
|
| 58 |
users.clear()
|
| 59 |
return render_template('index.html', users = users)
|
| 60 |
|
templates/talkDetail.html
CHANGED
|
@@ -43,10 +43,16 @@
|
|
| 43 |
if (!response.ok) throw new Error("データ取得に失敗しました。");
|
| 44 |
|
| 45 |
const data = await response.json();
|
| 46 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
.map((conv) => `【${conv.speaker}】 ${conv.text}`)
|
| 48 |
.join("\n");
|
| 49 |
-
|
| 50 |
transcriptionElement.textContent = formattedText;
|
| 51 |
} catch (error) {
|
| 52 |
transcriptionElement.textContent = `エラー: ${error.message}`;
|
|
|
|
| 43 |
if (!response.ok) throw new Error("データ取得に失敗しました。");
|
| 44 |
|
| 45 |
const data = await response.json();
|
| 46 |
+
const conversations = data.conversations;
|
| 47 |
+
|
| 48 |
+
if (!Array.isArray(conversations)) {
|
| 49 |
+
throw new Error("会話データが見つかりませんでした。");
|
| 50 |
+
}
|
| 51 |
+
const formattedText = conversations
|
| 52 |
+
|
| 53 |
.map((conv) => `【${conv.speaker}】 ${conv.text}`)
|
| 54 |
.join("\n");
|
| 55 |
+
console.log("フォーマットテキスト:", formattedText);
|
| 56 |
transcriptionElement.textContent = formattedText;
|
| 57 |
} catch (error) {
|
| 58 |
transcriptionElement.textContent = `エラー: ${error.message}`;
|