Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

fix: the notes window no longer says notes stopped at 00:00 when only another request lost the network

wqugurua99c380d17f7
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 545e0cf..5d101db 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -398,6 +398,7 @@
"%@ 暂时连不上,先用本机识别" = "Can't reach %@; recognizing on this Mac for now";
"key 已失效,到设置 › AI 服务里重填" = "The key stopped working. Enter a new one in Settings › AI Service";
"%@ 暂时连不上,正在重试" = "Can't reach %@. Retrying";
+"%@ 在听" = "%@ is listening";
"翻译暂不可用" = "Translation unavailable for now";
/* ListenPill */
@@ -473,9 +474,11 @@
"现在结束" = "End now";
/* NotesWindow */
-"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "The key stopped working (token deleted or free quota used up). Notes stop at %@.";
+"key 已失效(被删或额度用完),纪要暂停在 %@。" = "The key stopped working (deleted or out of credit). Notes paused at %@.";
+"key 已失效(被删或额度用完),换个 key 就能开始写纪要。" = "The key stopped working (deleted or out of credit). Change it to start the notes.";
"%@ 很忙,纪要稍后补上。字幕照常。" = "%@ is busy; notes will catch up. Subtitles go on.";
-"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "Can't reach %1$@; notes stop at %2$@ for now. They resume when the network is back.";
+"连不上 %@,纪要暂停在 %@,连上后自动继续。" = "Can't reach %1$@. Notes paused at %2$@ and resume once it's back.";
+"连不上 %@,连上后开始写纪要。" = "Can't reach %@. Notes start once it's back.";
"这轮没整理好,下一轮会自动重试。" = "This round failed; the next one will retry.";
"会议纪要" = "Meeting notes";
"结束这场会议" = "End this meeting";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index efa13fb..0ec5193 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -398,6 +398,7 @@
"%@ 暂时连不上,先用本机识别" = "%@ に接続できません。ひとまずこの Mac で認識します";
"key 已失效,到设置 › AI 服务里重填" = "キーが無効になりました。設定 › AI サービスで入力し直してください";
"%@ 暂时连不上,正在重试" = "%@ に接続できません。再試行しています";
+"%@ 在听" = "%@ が聞き取り中";
"翻译暂不可用" = "現在翻訳を利用できません";
/* ListenPill */
@@ -473,9 +474,11 @@
"现在结束" = "今すぐ終了";
/* NotesWindow */
-"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "キーが無効になりました(トークンの削除、または無料枠の上限)。議事メモは%@で止まっています。";
+"key 已失效(被删或额度用完),纪要暂停在 %@。" = "キーが無効になりました(削除または残高切れ)。メモは %@ で一時停止中です。";
+"key 已失效(被删或额度用完),换个 key 就能开始写纪要。" = "キーが無効になりました(削除または残高切れ)。キーを変えるとメモを書き始めます。";
"%@ 很忙,纪要稍后补上。字幕照常。" = "%@ が混み合っています。メモは後で追いつきます。字幕はそのまま。";
-"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "%1$@ に接続できないため、メモは %2$@ で止まっています。ネットワークが戻ると自動で再開します。";
+"连不上 %@,纪要暂停在 %@,连上后自动继续。" = "%1$@ に接続できません。メモは %2$@ で一時停止中、つながると自動で再開します。";
+"连不上 %@,连上后开始写纪要。" = "%@ に接続できません。つながるとメモを書き始めます。";
"这轮没整理好,下一轮会自动重试。" = "今回の整理に失敗しました。次回自動で再試行します。";
"会议纪要" = "会議の議事メモ";
"结束这场会议" = "この会議を終了";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index 8eda775..da54a45 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -398,6 +398,7 @@
"%@ 暂时连不上,先用本机识别" = "%@에 연결할 수 없어 우선 이 Mac에서 인식합니다";
"key 已失效,到设置 › AI 服务里重填" = "키가 더 이상 작동하지 않습니다. 설정 › AI 서비스에서 다시 입력하세요";
"%@ 暂时连不上,正在重试" = "%@에 연결할 수 없습니다. 다시 시도하는 중";
+"%@ 在听" = "%@ 이(가) 듣는 중";
"翻译暂不可用" = "번역을 일시적으로 사용할 수 없음";
/* ListenPill */
@@ -473,9 +474,11 @@
"现在结束" = "지금 끝내기";
/* NotesWindow */
-"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "key가 만료되었습니다(토큰 삭제 또는 무료 한도 소진). 회의록은 %@까지만 작성되었습니다.";
+"key 已失效(被删或额度用完),纪要暂停在 %@。" = "key가 만료되었습니다(삭제 또는 잔액 소진). 노트가 %@에서 멈췄습니다.";
+"key 已失效(被删或额度用完),换个 key 就能开始写纪要。" = "key가 만료되었습니다(삭제 또는 잔액 소진). key를 바꾸면 노트를 쓰기 시작합니다.";
"%@ 很忙,纪要稍后补上。字幕照常。" = "%@가 붐빕니다. 노트는 나중에 채워집니다. 자막은 그대로입니다.";
-"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "%1$@에 연결할 수 없어 노트가 %2$@에서 멈춰 있습니다. 네트워크가 돌아오면 자동으로 이어집니다.";
+"连不上 %@,纪要暂停在 %@,连上后自动继续。" = "%1$@에 연결할 수 없습니다. 노트가 %2$@에서 멈췄고, 연결되면 자동으로 이어집니다.";
+"连不上 %@,连上后开始写纪要。" = "%@에 연결할 수 없습니다. 연결되면 노트를 쓰기 시작합니다.";
"这轮没整理好,下一轮会自动重试。" = "이번에는 정리하지 못했습니다. 다음 차례에 자동으로 다시 시도합니다.";
"会议纪要" = "회의록";
"结束这场会议" = "이 회의 종료";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index b90af94..0241d57 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -398,6 +398,7 @@
"%@ 暂时连不上,先用本机识别" = "%@ 暂时连不上,先用本机识别";
"key 已失效,到设置 › AI 服务里重填" = "key 已失效,到设置 › AI 服务里重填";
"%@ 暂时连不上,正在重试" = "%@ 暂时连不上,正在重试";
+"%@ 在听" = "%@ 在听";
"翻译暂不可用" = "翻译暂不可用";
/* ListenPill */
@@ -473,9 +474,11 @@
"现在结束" = "现在结束";
/* NotesWindow */
-"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。";
+"key 已失效(被删或额度用完),纪要暂停在 %@。" = "key 已失效(被删或额度用完),纪要暂停在 %@。";
+"key 已失效(被删或额度用完),换个 key 就能开始写纪要。" = "key 已失效(被删或额度用完),换个 key 就能开始写纪要。";
"%@ 很忙,纪要稍后补上。字幕照常。" = "%@ 很忙,纪要稍后补上。字幕照常。";
-"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。";
+"连不上 %@,纪要暂停在 %@,连上后自动继续。" = "连不上 %@,纪要暂停在 %@,连上后自动继续。";
+"连不上 %@,连上后开始写纪要。" = "连不上 %@,连上后开始写纪要。";
"这轮没整理好,下一轮会自动重试。" = "这轮没整理好,下一轮会自动重试。";
"会议纪要" = "会议纪要";
"结束这场会议" = "结束这场会议";
diff --git a/Sources/Cicada/Notes.swift b/Sources/Cicada/Notes.swift
index b7e0862..8ce1408 100644
--- a/Sources/Cicada/Notes.swift
+++ b/Sources/Cicada/Notes.swift
@@ -93,6 +93,9 @@ final class NotesEngine: ObservableObject {
case noKey
case invalidKey
case rateLimited
+ /// The notes' own request couldn't reach the service (network, proxy, timeout). Another
+ /// request failing, such as naming speakers, never sets this.
+ case unreachable
case failed
}
@@ -186,6 +189,8 @@ final class NotesEngine: ObservableObject {
shownID = id
notes = store.session(id)?.notes ?? MeetingNotes()
fresh = []
+ // A round that failed belongs to the meeting it ran for, not to the record opened now.
+ if sessionID == nil, [.failed, .unreachable, .rateLimited].contains(state) { state = .idle }
}
/// Notes for a finished meeting that has none (e.g. recorded before a key was set).
@@ -212,6 +217,9 @@ final class NotesEngine: ObservableObject {
if state == .idle, !ling.hasKey { state = .noKey }
// A key that was just checked and refused says so, rather than asking for a key again.
if state == .noKey || state == .idle, ling.hasKey, ling.keyState == .invalid { state = .invalidKey }
+ // The service answers again (the check after a network change, or any other request): the
+ // banner goes now, not after the next round, which runs on its usual 45 s.
+ if state == .unreachable, ling.aiCheck.failure?.reason != .unreachable { state = .idle }
guard let id = sessionID, !inFlight else { return }
guard let s = store.session(id), s.lines.count > notes.covered else { return }
// First notes as soon as there is something to say, then every 45 s.
@@ -305,6 +313,9 @@ final class NotesEngine: ObservableObject {
state = .rateLimited
} catch LingClient.Failure.noKey {
state = .noKey
+ } catch LingClient.Failure.network, LingClient.Failure.timeout {
+ debugLog("notes: update can't reach the service")
+ state = .unreachable
} catch {
debugLog("notes: update failed \(error)")
state = .failed
diff --git a/Sources/Cicada/NotesWindow.swift b/Sources/Cicada/NotesWindow.swift
index 2cf80bf..025b75a 100644
--- a/Sources/Cicada/NotesWindow.swift
+++ b/Sources/Cicada/NotesWindow.swift
@@ -669,18 +669,22 @@ struct NotesWindowView: View {
case .noKey where session?.lines.isEmpty == false || live:
keyEntry
case .invalidKey:
- notice(L("key 已失效(令牌被删或免费额度用尽),纪要停留在 \(NotesEngine.clock(lastCovered))。"), tint: Palette.errorPale) {
+ notice(lastCovered > 0 ? L("key 已失效(被删或额度用完),纪要暂停在 \(NotesEngine.clock(lastCovered))。")
+ : L("key 已失效(被删或额度用完),换个 key 就能开始写纪要。"), tint: Palette.errorPale) {
SoftButton(L("更换 key"), dark: true) { model.openSettings(.ai) }
}
- case .rateLimited:
- notice(L("\(model.ling.serviceName) 很忙,纪要稍后补上。字幕照常。"), tint: Palette.warnPale) { EmptyView() }
- case .failed where model.ling.aiCheck.failure?.reason == .unreachable:
+ // The rest is about a round of the meeting going on now: a record opened later has none.
+ case .rateLimited where live:
+ notice(L("\(serviceLabel) 很忙,纪要稍后补上。字幕照常。"), tint: Palette.warnPale) { EmptyView() }
+ // Both: the notes' own request failed, and the service doesn't answer anything. Notes that
+ // only timed out while translations still came back aren't "can't reach"; the next round retries.
+ case .unreachable where live && model.ling.aiCheck.failure?.reason == .unreachable:
// The network or the proxy, not the notes: say which, and that it picks up by itself.
- notice(L("连不上 \(model.ling.serviceName),这段时间的纪要先停在 \(NotesEngine.clock(lastCovered))。网络恢复后自动继续。"),
- tint: Palette.errorPale) {
+ notice(lastCovered > 0 ? L("连不上 \(serviceLabel),纪要暂停在 \(NotesEngine.clock(lastCovered)),连上后自动继续。")
+ : L("连不上 \(serviceLabel),连上后开始写纪要。"), tint: Palette.errorPale) {
SoftButton(L("设置")) { model.openSettings(.ai) }
}
- case .failed:
+ case .failed where live:
notice(L("这轮没整理好,下一轮会自动重试。"), tint: Palette.fill) { EmptyView() }
default:
EmptyView()
@@ -723,6 +727,12 @@ struct NotesWindowView: View {
.background(RoundedRectangle(cornerRadius: 12).fill(Palette.accentPale))
}
+ /// Who the banners name: a custom service by its address, which says more than 这个服务.
+ private var serviceLabel: String {
+ let ling = model.ling
+ return ling.provider.id == .custom && !ling.serviceHost.isEmpty ? ling.serviceHost : ling.serviceName
+ }
+
/// Lines the notes don't cover yet, once they are two minutes behind the meeting (between
/// ordinary 45 s updates there is always a little that isn't in yet).
private var behind: Int {