Don't add live videos in redundancy

pull/3284/head
Chocobozzz 2020-11-06 14:33:31 +01:00 committed by Chocobozzz
parent 3cabf3532b
commit 9e2b2e76ba
5 changed files with 9 additions and 6 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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
}

View File

@ -334,7 +334,7 @@ export class VideoFileModel extends Model<VideoFileModel> {
}
isHLS () {
return this.videoStreamingPlaylistId !== null
return !!this.videoStreamingPlaylistId
}
hasSameUniqueKeysThan (other: MVideoFile) {