@mulingai-npm/redis 2.5.4 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -92,7 +92,7 @@ export declare class MulingstreamChunkManager {
|
|
|
92
92
|
status: StepStatus;
|
|
93
93
|
}>): Promise<boolean>;
|
|
94
94
|
discardStt(roomId: string, chunkNumber: number): Promise<boolean>;
|
|
95
|
-
updateFinalTranscription(roomId: string, chunkNumber: number, transcription: string, sttStatus: StepStatus): Promise<
|
|
95
|
+
updateFinalTranscription(roomId: string, chunkNumber: number, transcription: string, sttStatus: StepStatus): Promise<MulingstreamChunkData | null>;
|
|
96
96
|
/**
|
|
97
97
|
* Discards all post-STT steps for a given chunk:
|
|
98
98
|
* sets all translation[].status & tts[].status to "DISCARDED".
|
|
@@ -195,17 +195,19 @@ class MulingstreamChunkManager {
|
|
|
195
195
|
}
|
|
196
196
|
async updateFinalTranscription(roomId, chunkNumber, transcription, sttStatus) {
|
|
197
197
|
const chunks = await this.getMulingstreamChunksByRoom(roomId);
|
|
198
|
-
if (!chunks)
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
//
|
|
198
|
+
if (!chunks) {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
// locate the chunk
|
|
202
|
+
const idx = chunks.findIndex((c) => c.chunkNumber === chunkNumber);
|
|
203
|
+
if (idx === -1) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
// update fields
|
|
207
|
+
chunks[idx].finalTranscription = transcription;
|
|
208
|
+
chunks[idx].sttStatus = sttStatus;
|
|
207
209
|
await this.redisClient.jsonSet(`[${roomId}]`, '.', chunks);
|
|
208
|
-
return
|
|
210
|
+
return chunks[idx];
|
|
209
211
|
}
|
|
210
212
|
/**
|
|
211
213
|
* Discards all post-STT steps for a given chunk:
|