X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fvideos%2Fstreaming-playlists-command.ts;h=5d40d35cb9e06b1d0d90cb0ba0c14a39edaf177d;hb=5678353d4fb0ddd8bea044868576ee02cdbabedb;hp=fab3eb5562a28b11c4213cebb84738560d4e60c4;hpb=dd0ebb715123dfa126a82d4e4fe3a04064ae77b8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/videos/streaming-playlists-command.ts b/shared/extra-utils/videos/streaming-playlists-command.ts index fab3eb556..5d40d35cb 100644 --- a/shared/extra-utils/videos/streaming-playlists-command.ts +++ b/shared/extra-utils/videos/streaming-playlists-command.ts @@ -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, @@ -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,