diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-09 14:42:42 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-09 14:45:47 +0100 |
commit | 0d8de2756fdc43be61a82a96c17d12ee52ba0143 (patch) | |
tree | 85b02e683f0dc475e044356dc5adb6246181959d /server/lib | |
parent | e0fea785bf28966da09cdc16a274c9e750b488f4 (diff) | |
download | PeerTube-0d8de2756fdc43be61a82a96c17d12ee52ba0143.tar.gz PeerTube-0d8de2756fdc43be61a82a96c17d12ee52ba0143.tar.zst PeerTube-0d8de2756fdc43be61a82a96c17d12ee52ba0143.zip |
Fix live tests
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/process/process-delete.ts | 11 | ||||
-rw-r--r-- | server/lib/live-manager.ts | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.ts index b9fc5e792..a86def936 100644 --- a/server/lib/activitypub/process/process-delete.ts +++ b/server/lib/activitypub/process/process-delete.ts | |||
@@ -5,11 +5,11 @@ import { sequelizeTypescript } from '../../../initializers/database' | |||
5 | import { ActorModel } from '../../../models/activitypub/actor' | 5 | import { ActorModel } from '../../../models/activitypub/actor' |
6 | import { VideoModel } from '../../../models/video/video' | 6 | import { VideoModel } from '../../../models/video/video' |
7 | import { VideoCommentModel } from '../../../models/video/video-comment' | 7 | import { VideoCommentModel } from '../../../models/video/video-comment' |
8 | import { markCommentAsDeleted } from '../../video-comment' | ||
9 | import { forwardVideoRelatedActivity } from '../send/utils' | ||
10 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 8 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
11 | import { APProcessorOptions } from '../../../types/activitypub-processor.model' | 9 | import { APProcessorOptions } from '../../../types/activitypub-processor.model' |
12 | import { MAccountActor, MActor, MActorSignature, MChannelActor, MChannelActorAccountActor } from '../../../types/models' | 10 | import { MAccountActor, MActor, MActorSignature, MChannelActor, MChannelActorAccountActor, MCommentOwnerVideo } from '../../../types/models' |
11 | import { markCommentAsDeleted } from '../../video-comment' | ||
12 | import { forwardVideoRelatedActivity } from '../send/utils' | ||
13 | 13 | ||
14 | async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) { | 14 | async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) { |
15 | const { activity, byActor } = options | 15 | const { activity, byActor } = options |
@@ -121,7 +121,10 @@ async function processDeleteVideoChannel (videoChannelToRemove: MChannelActor) { | |||
121 | logger.info('Remote video channel %s removed.', videoChannelToRemove.Actor.url) | 121 | logger.info('Remote video channel %s removed.', videoChannelToRemove.Actor.url) |
122 | } | 122 | } |
123 | 123 | ||
124 | function processDeleteVideoComment (byActor: MActorSignature, videoComment: VideoCommentModel, activity: ActivityDelete) { | 124 | function processDeleteVideoComment (byActor: MActorSignature, videoComment: MCommentOwnerVideo, activity: ActivityDelete) { |
125 | // Already deleted | ||
126 | if (videoComment.isDeleted()) return | ||
127 | |||
125 | logger.debug('Removing remote video comment "%s".', videoComment.url) | 128 | logger.debug('Removing remote video comment "%s".', videoComment.url) |
126 | 129 | ||
127 | return sequelizeTypescript.transaction(async t => { | 130 | return sequelizeTypescript.transaction(async t => { |
diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts index ef50e3cdb..5d9b68756 100644 --- a/server/lib/live-manager.ts +++ b/server/lib/live-manager.ts | |||
@@ -287,16 +287,17 @@ class LiveManager { | |||
287 | for (let i = 0; i < allResolutions.length; i++) { | 287 | for (let i = 0; i < allResolutions.length; i++) { |
288 | const resolution = allResolutions[i] | 288 | const resolution = allResolutions[i] |
289 | 289 | ||
290 | VideoFileModel.upsert({ | 290 | const file = new VideoFileModel({ |
291 | resolution, | 291 | resolution, |
292 | size: -1, | 292 | size: -1, |
293 | extname: '.ts', | 293 | extname: '.ts', |
294 | infoHash: null, | 294 | infoHash: null, |
295 | fps, | 295 | fps, |
296 | videoStreamingPlaylistId: playlist.id | 296 | videoStreamingPlaylistId: playlist.id |
297 | }).catch(err => { | ||
298 | logger.error('Cannot create file for live streaming.', { err }) | ||
299 | }) | 297 | }) |
298 | |||
299 | VideoFileModel.customUpsert(file, 'streaming-playlist', null) | ||
300 | .catch(err => logger.error('Cannot create file for live streaming.', { err })) | ||
300 | } | 301 | } |
301 | 302 | ||
302 | const outPath = getHLSDirectory(videoLive.Video) | 303 | const outPath = getHLSDirectory(videoLive.Video) |