aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/videos-command.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-09-09 09:31:50 +0200
committerChocobozzz <me@florianbigard.com>2021-09-09 09:35:30 +0200
commit790c2837ddcb443c0f1ea6adcdcb101dfe159d01 (patch)
tree2f1c957363e1c00475a7ab7c75c09efe61fba004 /shared/extra-utils/videos/videos-command.ts
parentb4c945f3c727d1ce5de5a4af69d6dfa14c83468e (diff)
downloadPeerTube-790c2837ddcb443c0f1ea6adcdcb101dfe159d01.tar.gz
PeerTube-790c2837ddcb443c0f1ea6adcdcb101dfe159d01.tar.zst
PeerTube-790c2837ddcb443c0f1ea6adcdcb101dfe159d01.zip
Fix silent 500 after resumable upload
Diffstat (limited to 'shared/extra-utils/videos/videos-command.ts')
-rw-r--r--shared/extra-utils/videos/videos-command.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/shared/extra-utils/videos/videos-command.ts b/shared/extra-utils/videos/videos-command.ts
index d35339c8d..63980c147 100644
--- a/shared/extra-utils/videos/videos-command.ts
+++ b/shared/extra-utils/videos/videos-command.ts
@@ -449,6 +449,8 @@ export class VideosCommand extends AbstractCommand {
449 449
450 const result = await this.sendResumableChunks({ ...options, pathUploadId, videoFilePath, size }) 450 const result = await this.sendResumableChunks({ ...options, pathUploadId, videoFilePath, size })
451 451
452 await this.endResumableUpload({ ...options, pathUploadId })
453
452 return result.body?.video || result.body as any 454 return result.body?.video || result.body as any
453 } 455 }
454 456
@@ -542,6 +544,19 @@ export class VideosCommand extends AbstractCommand {
542 }) 544 })
543 } 545 }
544 546
547 endResumableUpload (options: OverrideCommandOptions & {
548 pathUploadId: string
549 }) {
550 return this.deleteRequest({
551 ...options,
552
553 path: '/api/v1/videos/upload-resumable',
554 rawQuery: options.pathUploadId,
555 implicitToken: true,
556 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
557 })
558 }
559
545 quickUpload (options: OverrideCommandOptions & { 560 quickUpload (options: OverrideCommandOptions & {
546 name: string 561 name: string
547 nsfw?: boolean 562 nsfw?: boolean