mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add ability to customize views/playback interval
This commit is contained in:
@@ -300,6 +300,27 @@ export interface ServerConfig {
|
||||
homepage: {
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
openTelemetry: {
|
||||
metrics: {
|
||||
enabled: boolean
|
||||
|
||||
// milliseconds
|
||||
playbackStatsInterval: number
|
||||
}
|
||||
}
|
||||
|
||||
views: {
|
||||
videos: {
|
||||
watchingInterval: {
|
||||
// milliseconds
|
||||
anonymous: number
|
||||
|
||||
// milliseconds
|
||||
users: number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type HTMLServerConfig = Omit<ServerConfig, 'signup'>
|
||||
|
||||
@@ -498,6 +498,16 @@ describe('Test config', function () {
|
||||
await setAccessTokensToServers([ server ])
|
||||
})
|
||||
|
||||
it('Should have the correct default config', async function () {
|
||||
const data = await server.config.getConfig()
|
||||
|
||||
expect(data.openTelemetry.metrics.enabled).to.be.false
|
||||
expect(data.openTelemetry.metrics.playbackStatsInterval).to.equal(15000)
|
||||
|
||||
expect(data.views.videos.watchingInterval.anonymous).to.equal(5000)
|
||||
expect(data.views.videos.watchingInterval.users).to.equal(5000)
|
||||
})
|
||||
|
||||
it('Should have a correct config on a server with registration enabled', async function () {
|
||||
const data = await server.config.getConfig()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user