]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/videos/streaming-playlists-command.ts
Add bin directory creation for parallel tests
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / videos / streaming-playlists-command.ts
index 4caec713734e944cc8ee657c7529ff5e53fc615c..5d40d35cb9e06b1d0d90cb0ba0c14a39edaf177d 100644 (file)
@@ -1,6 +1,5 @@
-
-import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes'
-import { unwrapBody, unwrapText } from '../requests'
+import { HttpStatusCode } from '@shared/models'
+import { unwrapBody, unwrapTextOrDecode, unwrapBodyOrDecodeToJSON } from '../requests'
 import { AbstractCommand, OverrideCommandOptions } from '../shared'
 
 export class StreamingPlaylistsCommand extends AbstractCommand {
@@ -8,7 +7,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
   get (options: OverrideCommandOptions & {
     url: string
   }) {
-    return unwrapText(this.getRawRequest({
+    return unwrapTextOrDecode(this.getRawRequest({
       ...options,
 
       url: options.url,
@@ -21,20 +20,20 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
     url: string
     range?: string
   }) {
-    return unwrapText(this.getRawRequest({
+    return unwrapBody<Buffer>(this.getRawRequest({
       ...options,
 
       url: options.url,
       range: options.range,
       implicitToken: false,
-      defaultExpectedStatus: HttpStatusCode.OK_200,
+      defaultExpectedStatus: HttpStatusCode.OK_200
     }))
   }
 
   getSegmentSha256 (options: OverrideCommandOptions & {
     url: string
   }) {
-    return unwrapBody<{ [ id: string ]: string }>(this.getRawRequest({
+    return unwrapBodyOrDecodeToJSON<{ [ id: string ]: string }>(this.getRawRequest({
       ...options,
 
       url: options.url,