@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 the room’s chunks
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 the requested translation languages
272
+ // 3) discard translation languages still in INIT
273
273
  if (options.translation) {
274
274
  for (const lang of options.translation) {
275
- if (chunk.translation[lang]) {
276
- chunk.translation[lang].status = 'DISCARDED';
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 the requested TTS languages
281
+ // 4) discard TTS languages still in INIT
281
282
  if (options.tts) {
282
283
  for (const lang of options.tts) {
283
- if (chunk.tts[lang]) {
284
- chunk.tts[lang].status = 'DISCARDED';
284
+ const entry = chunk.tts[lang];
285
+ if (entry && entry.status === 'INIT') {
286
+ entry.status = 'DISCARDED';
285
287
  }
286
288
  }
287
289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulingai-npm/redis",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {