diff options
author | Florian CUNY <poslovitch@bentobox.world> | 2021-10-26 16:42:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 16:42:10 +0200 |
commit | 754b6f5f41bdc40aaaeefdb3c351666c305abe20 (patch) | |
tree | d36c8081f3137f1e2c9763879f71d41aa9a3efc1 /server/models/video/video-channel.ts | |
parent | 615836dbd4f48fc563551446529fa9d3b14dc329 (diff) | |
download | PeerTube-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/video-channel.ts')
-rw-r--r-- | server/models/video/video-channel.ts | 5 |
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' |
29 | import { CONSTRAINTS_FIELDS, VIDEO_CHANNELS, WEBSERVER } from '../../initializers/constants' | 29 | import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers/constants' |
30 | import { sendDeleteActor } from '../../lib/activitypub/send' | 30 | import { sendDeleteActor } from '../../lib/activitypub/send' |
31 | import { | 31 | import { |
32 | MChannelActor, | 32 | MChannelActor, |
@@ -44,6 +44,7 @@ import { setAsUpdated } from '../shared' | |||
44 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' | 44 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' |
45 | import { VideoModel } from './video' | 45 | import { VideoModel } from './video' |
46 | import { VideoPlaylistModel } from './video-playlist' | 46 | import { VideoPlaylistModel } from './video-playlist' |
47 | import { CONFIG } from '@server/initializers/config' | ||
47 | 48 | ||
48 | export enum ScopeNames { | 49 | export 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: [], |