Don't add live videos in redundancy
This commit is contained in:
parent
3cabf3532b
commit
9e2b2e76ba
|
@ -271,6 +271,8 @@ type TranscodeOptions =
|
||||||
| QuickTranscodeOptions
|
| QuickTranscodeOptions
|
||||||
|
|
||||||
function transcode (options: TranscodeOptions) {
|
function transcode (options: TranscodeOptions) {
|
||||||
|
logger.debug('Will run transcode.', { options })
|
||||||
|
|
||||||
return new Promise<void>(async (res, rej) => {
|
return new Promise<void>(async (res, rej) => {
|
||||||
try {
|
try {
|
||||||
let command = getFFmpeg(options.inputPath)
|
let command = getFFmpeg(options.inputPath)
|
||||||
|
|
|
@ -123,7 +123,7 @@ async function saveLive (video: MVideo, live: MVideoLive) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function cleanupLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) {
|
async function cleanupLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) {
|
||||||
const hlsDirectory = getHLSDirectory(video, false)
|
const hlsDirectory = getHLSDirectory(video)
|
||||||
|
|
||||||
await remove(hlsDirectory)
|
await remove(hlsDirectory)
|
||||||
|
|
||||||
|
|
|
@ -174,8 +174,6 @@ async function generateHlsPlaylist (options: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug('Will run transcode.', { transcodeOptions })
|
|
||||||
|
|
||||||
await transcode(transcodeOptions)
|
await transcode(transcodeOptions)
|
||||||
|
|
||||||
const playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid)
|
const playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid)
|
||||||
|
|
|
@ -268,7 +268,8 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
|
||||||
limit: randomizedFactor,
|
limit: randomizedFactor,
|
||||||
order: getVideoSort('-views'),
|
order: getVideoSort('-views'),
|
||||||
where: {
|
where: {
|
||||||
privacy: VideoPrivacy.PUBLIC
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
|
isLive: false
|
||||||
},
|
},
|
||||||
include: [
|
include: [
|
||||||
await VideoRedundancyModel.buildVideoFileForDuplication(),
|
await VideoRedundancyModel.buildVideoFileForDuplication(),
|
||||||
|
@ -288,7 +289,8 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
|
||||||
limit: randomizedFactor,
|
limit: randomizedFactor,
|
||||||
order: getVideoSort('-trending'),
|
order: getVideoSort('-trending'),
|
||||||
where: {
|
where: {
|
||||||
privacy: VideoPrivacy.PUBLIC
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
|
isLive: false
|
||||||
},
|
},
|
||||||
include: [
|
include: [
|
||||||
await VideoRedundancyModel.buildVideoFileForDuplication(),
|
await VideoRedundancyModel.buildVideoFileForDuplication(),
|
||||||
|
@ -309,6 +311,7 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
|
||||||
order: getVideoSort('-publishedAt'),
|
order: getVideoSort('-publishedAt'),
|
||||||
where: {
|
where: {
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
|
isLive: false,
|
||||||
views: {
|
views: {
|
||||||
[Op.gte]: minViews
|
[Op.gte]: minViews
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,7 +334,7 @@ export class VideoFileModel extends Model<VideoFileModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
isHLS () {
|
isHLS () {
|
||||||
return this.videoStreamingPlaylistId !== null
|
return !!this.videoStreamingPlaylistId
|
||||||
}
|
}
|
||||||
|
|
||||||
hasSameUniqueKeysThan (other: MVideoFile) {
|
hasSameUniqueKeysThan (other: MVideoFile) {
|
||||||
|
|
Loading…
Reference in New Issue