diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 09:43:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 6c5065a011b099618681a37bd77eaa7bd3db752e (patch) | |
tree | 352252a00b25013c4b1902f6bcd9668aba295c7b /shared/extra-utils/videos/live-command.ts | |
parent | 0d8ecb7592577f54012413a2b5a9b159cfc90399 (diff) | |
download | PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.tar.gz PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.tar.zst PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.zip |
Introduce server commands
Diffstat (limited to 'shared/extra-utils/videos/live-command.ts')
-rw-r--r-- | shared/extra-utils/videos/live-command.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/shared/extra-utils/videos/live-command.ts b/shared/extra-utils/videos/live-command.ts index 4f03c9127..a494e60fa 100644 --- a/shared/extra-utils/videos/live-command.ts +++ b/shared/extra-utils/videos/live-command.ts | |||
@@ -5,9 +5,8 @@ import { omit } from 'lodash' | |||
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, VideoCreateResult, VideoDetails, VideoState } from '@shared/models' | 6 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, VideoCreateResult, VideoDetails, VideoState } from '@shared/models' |
7 | import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' | 7 | import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' |
8 | import { buildServerDirectory, wait } from '../miscs/miscs' | 8 | import { wait } from '../miscs' |
9 | import { unwrapBody } from '../requests' | 9 | import { unwrapBody } from '../requests' |
10 | import { waitUntilLog } from '../server/servers' | ||
11 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 10 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
12 | import { sendRTMPStream, testFfmpegStreamError } from './live' | 11 | import { sendRTMPStream, testFfmpegStreamError } from './live' |
13 | import { getVideoWithToken } from './videos' | 12 | import { getVideoWithToken } from './videos' |
@@ -116,7 +115,7 @@ export class LiveCommand extends AbstractCommand { | |||
116 | const { resolution, segment, videoUUID } = options | 115 | const { resolution, segment, videoUUID } = options |
117 | const segmentName = `${resolution}-00000${segment}.ts` | 116 | const segmentName = `${resolution}-00000${segment}.ts` |
118 | 117 | ||
119 | return waitUntilLog(this.server, `${videoUUID}/${segmentName}`, 2, false) | 118 | return this.server.serversCommand.waitUntilLog(`${videoUUID}/${segmentName}`, 2, false) |
120 | } | 119 | } |
121 | 120 | ||
122 | async waitUntilSaved (options: OverrideCommandOptions & { | 121 | async waitUntilSaved (options: OverrideCommandOptions & { |
@@ -135,7 +134,7 @@ export class LiveCommand extends AbstractCommand { | |||
135 | async countPlaylists (options: OverrideCommandOptions & { | 134 | async countPlaylists (options: OverrideCommandOptions & { |
136 | videoUUID: string | 135 | videoUUID: string |
137 | }) { | 136 | }) { |
138 | const basePath = buildServerDirectory(this.server, 'streaming-playlists') | 137 | const basePath = this.server.serversCommand.buildDirectory('streaming-playlists') |
139 | const hlsPath = join(basePath, 'hls', options.videoUUID) | 138 | const hlsPath = join(basePath, 'hls', options.videoUUID) |
140 | 139 | ||
141 | const files = await readdir(hlsPath) | 140 | const files = await readdir(hlsPath) |