@mulingai-npm/redis 2.9.0 → 2.9.1
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.
|
@@ -260,7 +260,7 @@ class MulingstreamChunkManager {
|
|
|
260
260
|
return true;
|
|
261
261
|
}
|
|
262
262
|
async discardLanguages(roomId, chunkNumber, options) {
|
|
263
|
-
// 1) fetch
|
|
263
|
+
// 1) fetch room’s chunks
|
|
264
264
|
const chunks = await this.getMulingstreamChunksByRoom(roomId);
|
|
265
265
|
if (!chunks)
|
|
266
266
|
return null;
|
|
@@ -269,19 +269,21 @@ class MulingstreamChunkManager {
|
|
|
269
269
|
if (idx === -1)
|
|
270
270
|
return null;
|
|
271
271
|
const chunk = chunks[idx];
|
|
272
|
-
// 3) discard
|
|
272
|
+
// 3) discard translation languages still in INIT
|
|
273
273
|
if (options.translation) {
|
|
274
274
|
for (const lang of options.translation) {
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
const entry = chunk.translation[lang];
|
|
276
|
+
if (entry && entry.status === 'INIT') {
|
|
277
|
+
entry.status = 'DISCARDED';
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
|
-
// 4) discard
|
|
281
|
+
// 4) discard TTS languages still in INIT
|
|
281
282
|
if (options.tts) {
|
|
282
283
|
for (const lang of options.tts) {
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
const entry = chunk.tts[lang];
|
|
285
|
+
if (entry && entry.status === 'INIT') {
|
|
286
|
+
entry.status = 'DISCARDED';
|
|
285
287
|
}
|
|
286
288
|
}
|
|
287
289
|
}
|