aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-03 16:02:29 +0200
committerChocobozzz <me@florianbigard.com>2021-06-03 16:40:32 +0200
commit136d7efde798d3dc0ec0dd18aac674365f7d162e (patch)
tree3a0e2a7a5d04dedf0d8ffda99c2787cecb838891 /server/lib/activitypub/videos
parent49af5ac8c2653cb0ef23479c9d3256c5b724d49d (diff)
downloadPeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.tar.gz
PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.tar.zst
PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.zip
Refactor AP actors
Diffstat (limited to 'server/lib/activitypub/videos')
-rw-r--r--server/lib/activitypub/videos/shared/abstract-builder.ts4
-rw-r--r--server/lib/activitypub/videos/updater.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/videos/shared/abstract-builder.ts b/server/lib/activitypub/videos/shared/abstract-builder.ts
index 953710f6c..f8e4d6aa3 100644
--- a/server/lib/activitypub/videos/shared/abstract-builder.ts
+++ b/server/lib/activitypub/videos/shared/abstract-builder.ts
@@ -10,7 +10,7 @@ import { VideoLiveModel } from '@server/models/video/video-live'
10import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 10import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
11import { MStreamingPlaylistFilesVideo, MThumbnail, MVideoCaption, MVideoFile, MVideoFullLight, MVideoThumbnail } from '@server/types/models' 11import { MStreamingPlaylistFilesVideo, MThumbnail, MVideoCaption, MVideoFile, MVideoFullLight, MVideoThumbnail } from '@server/types/models'
12import { ActivityTagObject, ThumbnailType, VideoObject, VideoStreamingPlaylistType } from '@shared/models' 12import { ActivityTagObject, ThumbnailType, VideoObject, VideoStreamingPlaylistType } from '@shared/models'
13import { getOrCreateActorAndServerAndModel } from '../../actor' 13import { getOrCreateAPActor } from '../../actors'
14import { 14import {
15 getCaptionAttributesFromObject, 15 getCaptionAttributesFromObject,
16 getFileAttributesFromUrl, 16 getFileAttributesFromUrl,
@@ -34,7 +34,7 @@ export abstract class APVideoAbstractBuilder {
34 throw new Error(`Video channel url ${channel.id} does not have the same host than video object id ${this.videoObject.id}`) 34 throw new Error(`Video channel url ${channel.id} does not have the same host than video object id ${this.videoObject.id}`)
35 } 35 }
36 36
37 return getOrCreateActorAndServerAndModel(channel.id, 'all') 37 return getOrCreateAPActor(channel.id, 'all')
38 } 38 }
39 39
40 protected tryToGenerateThumbnail (video: MVideoThumbnail): Promise<MThumbnail> { 40 protected tryToGenerateThumbnail (video: MVideoThumbnail): Promise<MThumbnail> {
diff --git a/server/lib/activitypub/videos/updater.ts b/server/lib/activitypub/videos/updater.ts
index 9e1c74969..6745e2efd 100644
--- a/server/lib/activitypub/videos/updater.ts
+++ b/server/lib/activitypub/videos/updater.ts
@@ -126,7 +126,7 @@ export class APVideoUpdater extends APVideoAbstractBuilder {
126 this.video.views = videoData.views 126 this.video.views = videoData.views
127 this.video.isLive = videoData.isLive 127 this.video.isLive = videoData.isLive
128 128
129 // Ensures we update the updated video attribute 129 // Ensures we update the updatedAt attribute, even if main attributes did not change
130 this.video.changed('updatedAt', true) 130 this.video.changed('updatedAt', true)
131 131
132 return this.video.save({ transaction }) as Promise<MVideoFullLight> 132 return this.video.save({ transaction }) as Promise<MVideoFullLight>