aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-08 16:50:56 +0200
committerChocobozzz <me@florianbigard.com>2018-10-08 16:50:56 +0200
commit9f1ddd249652c1e35b45db33885a00a005f9b059 (patch)
tree193c941c0019e897abf1e12faa504fff912f5546 /server/models/video
parentedb4ffc7e0b13659d7c73b120f2c87b27e4c26a1 (diff)
downloadPeerTube-9f1ddd249652c1e35b45db33885a00a005f9b059.tar.gz
PeerTube-9f1ddd249652c1e35b45db33885a00a005f9b059.tar.zst
PeerTube-9f1ddd249652c1e35b45db33885a00a005f9b059.zip
Change a little bit optimize-old-videos logic
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 46d823240..070ac7623 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -788,6 +788,16 @@ export class VideoModel extends Model<VideoModel> {
788 return VideoModel.scope(ScopeNames.WITH_FILES).findAll() 788 return VideoModel.scope(ScopeNames.WITH_FILES).findAll()
789 } 789 }
790 790
791 static listLocal () {
792 const query = {
793 where: {
794 remote: false
795 }
796 }
797
798 return VideoModel.scope(ScopeNames.WITH_FILES).findAll(query)
799 }
800
791 static listAllAndSharedByActorForOutbox (actorId: number, start: number, count: number) { 801 static listAllAndSharedByActorForOutbox (actorId: number, start: number, count: number) {
792 function getRawQuery (select: string) { 802 function getRawQuery (select: string) {
793 const queryVideo = 'SELECT ' + select + ' FROM "video" AS "Video" ' + 803 const queryVideo = 'SELECT ' + select + ' FROM "video" AS "Video" ' +