Don't add live videos in redundancy
This commit is contained in:
parent
3cabf3532b
commit
9e2b2e76ba
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -334,7 +334,7 @@ export class VideoFileModel extends Model<VideoFileModel> {
|
|||
}
|
||||
|
||||
isHLS () {
|
||||
return this.videoStreamingPlaylistId !== null
|
||||
return !!this.videoStreamingPlaylistId
|
||||
}
|
||||
|
||||
hasSameUniqueKeysThan (other: MVideoFile) {
|
||||
|
|
Loading…
Reference in New Issue