X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fconfig.ts;h=026a5e61c3e4869362bb537b6b9d04fce40849cf;hb=4024c44f9027a32809931de0692d40d001df721c;hp=eb06a151606fcfd048e9384abae0b9629a2c5373;hpb=5fb2e2888ce032c638e4b75d07458642f0833e52;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts index eb06a1516..026a5e61c 100644 --- a/shared/extra-utils/server/config.ts +++ b/shared/extra-utils/server/config.ts @@ -1,6 +1,6 @@ import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests' import { CustomConfig } from '../../models/server/custom-config.model' -import { DeepPartial } from '@server/typings/utils' +import { DeepPartial, HttpStatusCode } from '@shared/core-utils' import { merge } from 'lodash' function getConfig (url: string) { @@ -9,7 +9,7 @@ function getConfig (url: string) { return makeGetRequest({ url, path, - statusCodeExpected: 200 + statusCodeExpected: HttpStatusCode.OK_200 }) } @@ -19,11 +19,11 @@ function getAbout (url: string) { return makeGetRequest({ url, path, - statusCodeExpected: 200 + statusCodeExpected: HttpStatusCode.OK_200 }) } -function getCustomConfig (url: string, token: string, statusCodeExpected = 200) { +function getCustomConfig (url: string, token: string, statusCodeExpected = HttpStatusCode.OK_200) { const path = '/api/v1/config/custom' return makeGetRequest({ @@ -34,7 +34,7 @@ function getCustomConfig (url: string, token: string, statusCodeExpected = 200) }) } -function updateCustomConfig (url: string, token: string, newCustomConfig: CustomConfig, statusCodeExpected = 200) { +function updateCustomConfig (url: string, token: string, newCustomConfig: CustomConfig, statusCodeExpected = HttpStatusCode.OK_200) { const path = '/api/v1/config/custom' return makePutBodyRequest({ @@ -65,9 +65,11 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti languages: [ 'en', 'es' ], categories: [ 1, 2 ], - defaultClientRoute: '/videos/recently-added', isNSFW: true, defaultNSFWPolicy: 'blur', + + defaultClientRoute: '/videos/recently-added', + customizations: { javascript: 'alert("coucou")', css: 'body { background-color: red; }' @@ -88,6 +90,9 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti }, captions: { size: 3 + }, + torrents: { + size: 4 } }, signup: { @@ -110,6 +115,8 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti allowAdditionalExtensions: true, allowAudioFiles: true, threads: 1, + concurrency: 3, + profile: 'default', resolutions: { '0p': false, '240p': false, @@ -117,6 +124,7 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti '480p': true, '720p': false, '1080p': false, + '1440p': false, '2160p': false }, webtorrent: { @@ -126,8 +134,30 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti enabled: false } }, + live: { + enabled: true, + allowReplay: false, + maxDuration: -1, + maxInstanceLives: -1, + maxUserLives: 50, + transcoding: { + enabled: true, + threads: 4, + profile: 'default', + resolutions: { + '240p': true, + '360p': true, + '480p': true, + '720p': true, + '1080p': true, + '1440p': true, + '2160p': true + } + } + }, import: { videos: { + concurrency: 3, http: { enabled: false }, @@ -136,6 +166,14 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti } } }, + trending: { + videos: { + algorithms: { + enabled: [ 'best', 'hot', 'most-viewed', 'most-liked' ], + default: 'hot' + } + } + }, autoBlacklist: { videos: { ofUsers: { @@ -185,7 +223,7 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti return updateCustomConfig(url, token, updateParams) } -function deleteCustomConfig (url: string, token: string, statusCodeExpected = 200) { +function deleteCustomConfig (url: string, token: string, statusCodeExpected = HttpStatusCode.OK_200) { const path = '/api/v1/config/custom' return makeDeleteRequest({