]> 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 b109597c9369dea1dceab94641ba2e485a1d082f..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,7 +20,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
     url: string
     range?: string
   }) {
-    return unwrapText(this.getRawRequest({
+    return unwrapBody<Buffer>(this.getRawRequest({
       ...options,
 
       url: options.url,
@@ -34,7 +33,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
   getSegmentSha256 (options: OverrideCommandOptions & {
     url: string
   }) {
-    return unwrapBody<{ [ id: string ]: string }>(this.getRawRequest({
+    return unwrapBodyOrDecodeToJSON<{ [ id: string ]: string }>(this.getRawRequest({
       ...options,
 
       url: options.url,