]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-change-ownership.ts
Fix RSS feed when HLS only is enabled
[github/Chocobozzz/PeerTube.git] / server / models / video / video-change-ownership.ts
index 2d0ff48fb212e608fac91f4e729dd17b084e4794..ac0ab7e8b9088c1a3158b4696cb5c2bc7dd6c3a0 100644 (file)
@@ -3,7 +3,7 @@ import { AccountModel } from '../account/account'
 import { ScopeNames as VideoScopeNames, VideoModel } from './video'
 import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos'
 import { getSort } from '../utils'
-import { MVideoChangeOwnershipFull } from '@server/typings/models/video/video-change-ownership'
+import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
 import * as Bluebird from 'bluebird'
 
 enum ScopeNames {
@@ -43,7 +43,12 @@ enum ScopeNames {
   [ScopeNames.WITH_VIDEO]: {
     include: [
       {
-        model: VideoModel.scope([ VideoScopeNames.WITH_THUMBNAILS, VideoScopeNames.WITH_FILES ]),
+        model: VideoModel.scope([
+          VideoScopeNames.WITH_THUMBNAILS,
+          VideoScopeNames.WITH_WEBTORRENT_FILES,
+          VideoScopeNames.WITH_STREAMING_PLAYLISTS,
+          VideoScopeNames.WITH_ACCOUNT_DETAILS
+        ]),
         required: true
       }
     ]
@@ -119,18 +124,13 @@ export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel>
                                     .findByPk(id)
   }
 
-  toFormattedJSON (): VideoChangeOwnership {
+  toFormattedJSON (this: MVideoChangeOwnershipFormattable): VideoChangeOwnership {
     return {
       id: this.id,
       status: this.status,
       initiatorAccount: this.Initiator.toFormattedJSON(),
       nextOwnerAccount: this.NextOwner.toFormattedJSON(),
-      video: {
-        id: this.Video.id,
-        uuid: this.Video.uuid,
-        url: this.Video.url,
-        name: this.Video.name
-      },
+      video: this.Video.toFormattedJSON(),
       createdAt: this.createdAt
     }
   }