aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-change-ownership.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-04 10:22:10 +0200
committerChocobozzz <me@florianbigard.com>2018-09-04 10:49:53 +0200
commit5cf84858d49f4231cc4efec5e3132f17f65f6cf6 (patch)
treef1ff23476ff54c32c3fa34db79c11f242855d3b4 /server/models/video/video-change-ownership.ts
parent0b74c74abe5a44e9f564ab6adb5177ab17d28e91 (diff)
downloadPeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.tar.gz
PeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.tar.zst
PeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.zip
Add federation to ownership change
Diffstat (limited to 'server/models/video/video-change-ownership.ts')
-rw-r--r--server/models/video/video-change-ownership.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/models/video/video-change-ownership.ts b/server/models/video/video-change-ownership.ts
index c9cff5054..48c07728f 100644
--- a/server/models/video/video-change-ownership.ts
+++ b/server/models/video/video-change-ownership.ts
@@ -39,7 +39,9 @@ enum ScopeNames {
39 { 39 {
40 model: () => VideoModel, 40 model: () => VideoModel,
41 required: true, 41 required: true,
42 include: [{ model: () => VideoFileModel }] 42 include: [
43 { model: () => VideoFileModel }
44 ]
43 } 45 }
44 ] 46 ]
45 } 47 }
@@ -94,15 +96,17 @@ export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel>
94 Video: VideoModel 96 Video: VideoModel
95 97
96 static listForApi (nextOwnerId: number, start: number, count: number, sort: string) { 98 static listForApi (nextOwnerId: number, start: number, count: number, sort: string) {
97 return VideoChangeOwnershipModel.scope(ScopeNames.FULL).findAndCountAll({ 99 const query = {
98 offset: start, 100 offset: start,
99 limit: count, 101 limit: count,
100 order: getSort(sort), 102 order: getSort(sort),
101 where: { 103 where: {
102 nextOwnerAccountId: nextOwnerId 104 nextOwnerAccountId: nextOwnerId
103 } 105 }
104 }) 106 }
105 .then(({ rows, count }) => ({ total: count, data: rows })) 107
108 return VideoChangeOwnershipModel.scope(ScopeNames.FULL).findAndCountAll(query)
109 .then(({ rows, count }) => ({ total: count, data: rows }))
106 } 110 }
107 111
108 static load (id: number) { 112 static load (id: number) {