@vocalstack/payload 0.6.1 → 0.6.2

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.
@@ -144,6 +144,11 @@ async function keepReading(req, api, slug, target, lang, speech) {
144
144
  if (res.status !== 400)
145
145
  break;
146
146
  }
147
+ // The track is not there to keep any more (VocalStack re-reads a reading when its clone is
148
+ // rebuilt, or found nothing to read aloud): follow it as being made again, so the next look
149
+ // reads its state instead of downloading it forever.
150
+ if (res?.status === 404)
151
+ return { ...speech, done: 0, error: null, requestedAt: new Date().toISOString(), state: 'running' };
147
152
  if (!res?.ok)
148
153
  throw new VocalStackAPIError(502, 'unavailable', UNAVAILABLE);
149
154
  const data = Buffer.from(await res.arrayBuffer());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocalstack/payload",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "VocalStack for Payload CMS: transcribe audio, translate it into other languages and read it aloud, kept in your own database and storage.",
5
5
  "license": "MIT",
6
6
  "type": "module",