import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
import { CustomConfig } from '../../models/server/custom-config.model'
-import { DeepPartial } from '@shared/core-utils'
+import { DeepPartial, HttpStatusCode } from '@shared/core-utils'
import { merge } from 'lodash'
function getConfig (url: string) {
return makeGetRequest({
url,
path,
- statusCodeExpected: 200
+ statusCodeExpected: HttpStatusCode.OK_200
})
}
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({
})
}
-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({
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; }'
allowAdditionalExtensions: true,
allowAudioFiles: true,
threads: 1,
+ profile: 'default',
resolutions: {
'0p': false,
'240p': false,
'480p': true,
'720p': false,
'1080p': false,
+ '1440p': false,
'2160p': false
},
webtorrent: {
live: {
enabled: true,
allowReplay: false,
- maxDuration: null,
+ 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
}
}
}
}
},
+ trending: {
+ videos: {
+ algorithms: {
+ enabled: [ 'hot', 'most-viewed', 'most-liked' ],
+ default: 'hot'
+ }
+ }
+ },
autoBlacklist: {
videos: {
ofUsers: {
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({