Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Don't add live videos in redundancy

Chocobozzz9e2b2e76ba5f
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index b6f4097aa0..69564a1a3b 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -271,6 +271,8 @@ type TranscodeOptions =
| QuickTranscodeOptions
function transcode (options: TranscodeOptions) {
+ logger.debug('Will run transcode.', { options })
+
return new Promise<void>(async (res, rej) => {
try {
let command = getFFmpeg(options.inputPath)
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index 3d93417388..55c7a4ccbc 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -123,7 +123,7 @@ async function saveLive (video: MVideo, live: MVideoLive) {
}
async function cleanupLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) {
- const hlsDirectory = getHLSDirectory(video, false)
+ const hlsDirectory = getHLSDirectory(video)
await remove(hlsDirectory)
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts
index e267b1397c..9882a14db2 100644
--- a/server/lib/video-transcoding.ts
+++ b/server/lib/video-transcoding.ts
@@ -174,8 +174,6 @@ async function generateHlsPlaylist (options: {
}
}
- logger.debug('Will run transcode.', { transcodeOptions })
-
await transcode(transcodeOptions)
const playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid)
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts
index 1c8b2cf782..1b967996ca 100644
--- a/server/models/redundancy/video-redundancy.ts
+++ b/server/models/redundancy/video-redundancy.ts
@@ -268,7 +268,8 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
limit: randomizedFactor,
order: getVideoSort('-views'),
where: {
- privacy: VideoPrivacy.PUBLIC
+ privacy: VideoPrivacy.PUBLIC,
+ isLive: false
},
include: [
await VideoRedundancyModel.buildVideoFileForDuplication(),
@@ -288,7 +289,8 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
limit: randomizedFactor,
order: getVideoSort('-trending'),
where: {
- privacy: VideoPrivacy.PUBLIC
+ privacy: VideoPrivacy.PUBLIC,
+ isLive: false
},
include: [
await VideoRedundancyModel.buildVideoFileForDuplication(),
@@ -309,6 +311,7 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
order: getVideoSort('-publishedAt'),
where: {
privacy: VideoPrivacy.PUBLIC,
+ isLive: false,
views: {
[Op.gte]: minViews
}
diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts
index 0e834aee06..a130317f6e 100644
--- a/server/models/video/video-file.ts
+++ b/server/models/video/video-file.ts
@@ -334,7 +334,7 @@ export class VideoFileModel extends Model<VideoFileModel> {
}
isHLS () {
- return this.videoStreamingPlaylistId !== null
+ return !!this.videoStreamingPlaylistId
}
hasSameUniqueKeysThan (other: MVideoFile) {