diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-12 15:26:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-16 16:41:36 +0200 |
commit | 7ad9b9846c44d198a736183fb186c2039f5236b5 (patch) | |
tree | 9c8456882a261c0522efb507f20e323c2741a0f8 /server/initializers | |
parent | dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb (diff) | |
download | PeerTube-7ad9b9846c44d198a736183fb186c2039f5236b5.tar.gz PeerTube-7ad9b9846c44d198a736183fb186c2039f5236b5.tar.zst PeerTube-7ad9b9846c44d198a736183fb186c2039f5236b5.zip |
Add ability for users to block an account/instance on server side
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 5 | ||||
-rw-r--r-- | server/initializers/database.ts | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 49ee13c10..cf00da2c7 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -47,7 +47,10 @@ const SORTABLE_COLUMNS = { | |||
47 | VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'trending' ], | 47 | VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'trending' ], |
48 | 48 | ||
49 | VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'match' ], | 49 | VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes', 'match' ], |
50 | VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ] | 50 | VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ], |
51 | |||
52 | ACCOUNTS_BLOCKLIST: [ 'createdAt' ], | ||
53 | SERVERS_BLOCKLIST: [ 'createdAt' ] | ||
51 | } | 54 | } |
52 | 55 | ||
53 | const OAUTH_LIFETIME = { | 56 | const OAUTH_LIFETIME = { |
diff --git a/server/initializers/database.ts b/server/initializers/database.ts index 482c03b31..dd5b9bf67 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts | |||
@@ -29,6 +29,8 @@ import { VideoViewModel } from '../models/video/video-views' | |||
29 | import { VideoChangeOwnershipModel } from '../models/video/video-change-ownership' | 29 | import { VideoChangeOwnershipModel } from '../models/video/video-change-ownership' |
30 | import { VideoRedundancyModel } from '../models/redundancy/video-redundancy' | 30 | import { VideoRedundancyModel } from '../models/redundancy/video-redundancy' |
31 | import { UserVideoHistoryModel } from '../models/account/user-video-history' | 31 | import { UserVideoHistoryModel } from '../models/account/user-video-history' |
32 | import { AccountBlocklistModel } from '../models/account/account-blocklist' | ||
33 | import { ServerBlocklistModel } from '../models/server/server-blocklist' | ||
32 | 34 | ||
33 | require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string | 35 | require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string |
34 | 36 | ||
@@ -91,7 +93,9 @@ async function initDatabaseModels (silent: boolean) { | |||
91 | VideoImportModel, | 93 | VideoImportModel, |
92 | VideoViewModel, | 94 | VideoViewModel, |
93 | VideoRedundancyModel, | 95 | VideoRedundancyModel, |
94 | UserVideoHistoryModel | 96 | UserVideoHistoryModel, |
97 | AccountBlocklistModel, | ||
98 | ServerBlocklistModel | ||
95 | ]) | 99 | ]) |
96 | 100 | ||
97 | // Check extensions exist in the database | 101 | // Check extensions exist in the database |