aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
authorFlorian CUNY <poslovitch@bentobox.world>2021-10-26 16:42:10 +0200
committerGitHub <noreply@github.com>2021-10-26 16:42:10 +0200
commit754b6f5f41bdc40aaaeefdb3c351666c305abe20 (patch)
treed36c8081f3137f1e2c9763879f71d41aa9a3efc1 /server/models/video
parent615836dbd4f48fc563551446529fa9d3b14dc329 (diff)
downloadPeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.tar.gz
PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.tar.zst
PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.zip
Made the video channels limit (per user) server-wide configurable (#4491)
* Made the video channels limit (per user) server-wide configurable Implements https://github.com/Chocobozzz/PeerTube/issues/3092 Also added a "quota bar" in the account's settings page * Fixed lint errors * Another pass at fixing lint errors * Applied code suggestions * Removed 'video channels quota'
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video-channel.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts
index 4151dc5b5..b652d8531 100644
--- a/server/models/video/video-channel.ts
+++ b/server/models/video/video-channel.ts
@@ -26,7 +26,7 @@ import {
26 isVideoChannelDisplayNameValid, 26 isVideoChannelDisplayNameValid,
27 isVideoChannelSupportValid 27 isVideoChannelSupportValid
28} from '../../helpers/custom-validators/video-channels' 28} from '../../helpers/custom-validators/video-channels'
29import { CONSTRAINTS_FIELDS, VIDEO_CHANNELS, WEBSERVER } from '../../initializers/constants' 29import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers/constants'
30import { sendDeleteActor } from '../../lib/activitypub/send' 30import { sendDeleteActor } from '../../lib/activitypub/send'
31import { 31import {
32 MChannelActor, 32 MChannelActor,
@@ -44,6 +44,7 @@ import { setAsUpdated } from '../shared'
44import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' 44import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils'
45import { VideoModel } from './video' 45import { VideoModel } from './video'
46import { VideoPlaylistModel } from './video-playlist' 46import { VideoPlaylistModel } from './video-playlist'
47import { CONFIG } from '@server/initializers/config'
47 48
48export enum ScopeNames { 49export enum ScopeNames {
49 FOR_API = 'FOR_API', 50 FOR_API = 'FOR_API',
@@ -584,7 +585,7 @@ ON "Account->Actor"."serverId" = "Account->Actor->Server"."id"`
584 585
585 static listAllByAccount (accountId: number) { 586 static listAllByAccount (accountId: number) {
586 const query = { 587 const query = {
587 limit: VIDEO_CHANNELS.MAX_PER_USER, 588 limit: CONFIG.VIDEO_CHANNELS.MAX_PER_USER,
588 include: [ 589 include: [
589 { 590 {
590 attributes: [], 591 attributes: [],