Detail: unmapable Summarize/transcript-save say why instead of silently doing nothing
This commit is contained in:
parent
5ed4f31973
commit
1dde1019e9
1 changed files with 17 additions and 2 deletions
|
|
@ -1328,7 +1328,16 @@ class DesktopState(private val appDir: File = defaultAppDir()) {
|
|||
* [tone] (e.g. "sarcastic") restyles the voice; null = neutral. */
|
||||
fun summarize(tone: String? = null) {
|
||||
val d = _detail.value ?: return
|
||||
val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId ?: return
|
||||
val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId
|
||||
if (remoteId == null) {
|
||||
// No server recording and no mapping: a silent return here
|
||||
// looked like a broken button (seen with a detail screen
|
||||
// opened for a since-renamed/deleted file). Say what's wrong.
|
||||
d.error = "This file has no server recording to summarize — " +
|
||||
"press Transcribe to upload it first."
|
||||
_detail.value = d.copy()
|
||||
return
|
||||
}
|
||||
d.remoteId = remoteId
|
||||
reprocessInPlace(d, job = "summarize", tone = tone)
|
||||
}
|
||||
|
|
@ -1342,7 +1351,13 @@ class DesktopState(private val appDir: File = defaultAppDir()) {
|
|||
*/
|
||||
fun saveTranscriptEdit(text: String) {
|
||||
val d = _detail.value ?: return
|
||||
val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId ?: return
|
||||
val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId
|
||||
if (remoteId == null) {
|
||||
d.error = "This file has no server recording to save against — " +
|
||||
"press Transcribe to upload it first."
|
||||
_detail.value = d.copy()
|
||||
return
|
||||
}
|
||||
d.remoteId = remoteId
|
||||
if (text.isBlank() || text == d.transcript?.text) return
|
||||
scope.launch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue