aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/videos/live.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-12 16:09:02 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-10-24 14:48:24 +0200
commit3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (patch)
treee7f1d12ef5dae1e1142c3a8d0b681c1dbbb0de10 /shared/server-commands/videos/live.ts
parent38a3ccc7f8ad0ea94362b58c732af7c387ab46be (diff)
downloadPeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.tar.gz
PeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.tar.zst
PeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.zip
Put private videos under a specific subdirectory
Diffstat (limited to 'shared/server-commands/videos/live.ts')
-rw-r--r--shared/server-commands/videos/live.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/shared/server-commands/videos/live.ts b/shared/server-commands/videos/live.ts
index 0d9c32aab..ee7444b64 100644
--- a/shared/server-commands/videos/live.ts
+++ b/shared/server-commands/videos/live.ts
@@ -1,6 +1,6 @@
1import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg' 1import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg'
2import { buildAbsoluteFixturePath, wait } from '@shared/core-utils' 2import { buildAbsoluteFixturePath, wait } from '@shared/core-utils'
3import { VideoDetails, VideoInclude } from '@shared/models' 3import { VideoDetails, VideoInclude, VideoPrivacy } from '@shared/models'
4import { PeerTubeServer } from '../server/server' 4import { PeerTubeServer } from '../server/server'
5 5
6function sendRTMPStream (options: { 6function sendRTMPStream (options: {
@@ -98,7 +98,10 @@ async function waitUntilLiveReplacedByReplayOnAllServers (servers: PeerTubeServe
98} 98}
99 99
100async function findExternalSavedVideo (server: PeerTubeServer, liveDetails: VideoDetails) { 100async function findExternalSavedVideo (server: PeerTubeServer, liveDetails: VideoDetails) {
101 const { data } = await server.videos.list({ token: server.accessToken, sort: '-publishedAt', include: VideoInclude.BLACKLISTED }) 101 const include = VideoInclude.BLACKLISTED
102 const privacyOneOf = [ VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.PUBLIC, VideoPrivacy.UNLISTED ]
103
104 const { data } = await server.videos.list({ token: server.accessToken, sort: '-publishedAt', include, privacyOneOf })
102 105
103 return data.find(v => v.name === liveDetails.name + ' - ' + new Date(liveDetails.publishedAt).toLocaleString()) 106 return data.find(v => v.name === liveDetails.name + ' - ' + new Date(liveDetails.publishedAt).toLocaleString())
104} 107}