aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index b3543ddf2..9d89efa5b 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -783,21 +783,20 @@ export class VideoModel extends Model {
783 783
784 @BeforeDestroy 784 @BeforeDestroy
785 static async sendDelete (instance: MVideoAccountLight, options) { 785 static async sendDelete (instance: MVideoAccountLight, options) {
786 if (instance.isOwned()) { 786 if (!instance.isOwned()) return undefined
787 if (!instance.VideoChannel) {
788 instance.VideoChannel = await instance.$get('VideoChannel', {
789 include: [
790 ActorModel,
791 AccountModel
792 ],
793 transaction: options.transaction
794 }) as MChannelAccountDefault
795 }
796 787
797 return sendDeleteVideo(instance, options.transaction) 788 // Lazy load channels
789 if (!instance.VideoChannel) {
790 instance.VideoChannel = await instance.$get('VideoChannel', {
791 include: [
792 ActorModel,
793 AccountModel
794 ],
795 transaction: options.transaction
796 }) as MChannelAccountDefault
798 } 797 }
799 798
800 return undefined 799 return sendDeleteVideo(instance, options.transaction)
801 } 800 }
802 801
803 @BeforeDestroy 802 @BeforeDestroy
@@ -862,6 +861,7 @@ export class VideoModel extends Model {
862 861
863 logger.info('Saving video abuses details of video %s.', instance.url) 862 logger.info('Saving video abuses details of video %s.', instance.url)
864 863
864 if (!instance.Trackers) instance.Trackers = await instance.$get('Trackers', { transaction: options.transaction })
865 const details = instance.toFormattedDetailsJSON() 865 const details = instance.toFormattedDetailsJSON()
866 866
867 for (const abuse of instance.VideoAbuses) { 867 for (const abuse of instance.VideoAbuses) {