]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-channel.ts
Handle .srt subtitles
[github/Chocobozzz/PeerTube.git] / server / models / video / video-channel.ts
index b9df14eca77c6fd70d841a749a108a24d1a2a2a1..4251afce994d00ab7999b2fb92420b36b8d7bec1 100644 (file)
@@ -15,6 +15,7 @@ import { ActorModel } from '../activitypub/actor'
 import { getSort, throwIfNotValid } from '../utils'
 import { VideoModel } from './video'
 import { CONSTRAINTS_FIELDS } from '../../initializers'
+import { AvatarModel } from '../avatar/avatar'
 
 enum ScopeNames {
   WITH_ACCOUNT = 'WITH_ACCOUNT',
@@ -39,7 +40,13 @@ enum ScopeNames {
         include: [
           {
             model: () => ActorModel.unscoped(),
-            required: true
+            required: true,
+            include: [
+              {
+                model: () => AvatarModel.unscoped(),
+                required: false
+              }
+            ]
           }
         ]
       }
@@ -237,7 +244,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
     const actor = this.Actor.toFormattedJSON()
     const videoChannel = {
       id: this.id,
-      displayName: this.name,
+      displayName: this.getDisplayName(),
       description: this.description,
       support: this.support,
       isLocal: this.Actor.isOwned(),
@@ -266,4 +273,8 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
       ]
     })
   }
+
+  getDisplayName () {
+    return this.name
+  }
 }