diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-12 16:09:02 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-10-24 14:48:24 +0200 |
commit | 3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (patch) | |
tree | e7f1d12ef5dae1e1142c3a8d0b681c1dbbb0de10 /shared/server-commands/videos/live.ts | |
parent | 38a3ccc7f8ad0ea94362b58c732af7c387ab46be (diff) | |
download | PeerTube-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.ts | 7 |
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 @@ | |||
1 | import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg' | 1 | import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg' |
2 | import { buildAbsoluteFixturePath, wait } from '@shared/core-utils' | 2 | import { buildAbsoluteFixturePath, wait } from '@shared/core-utils' |
3 | import { VideoDetails, VideoInclude } from '@shared/models' | 3 | import { VideoDetails, VideoInclude, VideoPrivacy } from '@shared/models' |
4 | import { PeerTubeServer } from '../server/server' | 4 | import { PeerTubeServer } from '../server/server' |
5 | 5 | ||
6 | function sendRTMPStream (options: { | 6 | function sendRTMPStream (options: { |
@@ -98,7 +98,10 @@ async function waitUntilLiveReplacedByReplayOnAllServers (servers: PeerTubeServe | |||
98 | } | 98 | } |
99 | 99 | ||
100 | async function findExternalSavedVideo (server: PeerTubeServer, liveDetails: VideoDetails) { | 100 | async 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 | } |