]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Clearer video creation from API regarding rates
authorChocobozzz <me@florianbigard.com>
Wed, 8 Jun 2022 13:42:09 +0000 (15:42 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 8 Jun 2022 13:42:09 +0000 (15:42 +0200)
server/lib/activitypub/videos/shared/creator.ts
server/lib/activitypub/videos/shared/object-to-model-attributes.ts

index 688bcbb534b344059a2a9707501eaebdd4708c55..07252fea20a215f0a1ff268a12140f98ccf25df7 100644 (file)
@@ -24,7 +24,7 @@ export class APVideoCreator extends APVideoAbstractBuilder {
     const channel = channelActor.VideoChannel
 
     const videoData = getVideoAttributesFromObject(channel, this.videoObject, this.videoObject.to)
-    const video = VideoModel.build(videoData) as MVideoThumbnail
+    const video = VideoModel.build({ ...videoData, likes: 0, dislikes: 0 }) as MVideoThumbnail
 
     const promiseThumbnail = this.tryToGenerateThumbnail(video)
 
index f02b9cba63215655f6326309512a35d72340a52b..86699c5b8dd30d5be44cfa615c8cd1f2ef339e21 100644 (file)
@@ -210,8 +210,6 @@ function getVideoAttributesFromObject (videoChannel: MChannelId, videoObject: Vi
 
     updatedAt: new Date(videoObject.updated),
     views: videoObject.views,
-    likes: 0,
-    dislikes: 0,
     remote: true,
     privacy
   }