DESCRIPTION: { min: 3, max: 3000 }, // Length
EXTNAME: [ '.mp4', '.ogv', '.webm' ],
INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2
- DURATION: { min: 1, max: 7200 }, // Number
+ DURATION: { min: 1 }, // Number
TAGS: { min: 0, max: 5 }, // Number of total tags
TAG: { min: 2, max: 30 }, // Length
THUMBNAIL: { min: 2, max: 30 },
VIEWS: { min: 0 },
LIKES: { min: 0 },
DISLIKES: { min: 0 },
- FILE_SIZE: { min: 10, max: 1024 * 1024 * 1024 * 10 /* 10Go */ },
+ FILE_SIZE: { min: 10 },
URL: { min: 3, max: 2000 } // Length
},
ACCOUNTS: {
// ---------------------------------------------------------------------------
-// Score a server has when we create it as a friend
-const FRIEND_SCORE = {
- BASE: 100,
- MAX: 1000
-}
-
const SERVER_ACCOUNT_NAME = 'peertube'
const ACTIVITY_PUB = {
// Number of points we add/remove from a friend after a successful/bad request
const SERVERS_SCORE = {
PENALTY: -10,
- BONUS: 10
+ BONUS: 10,
+ BASE: 100,
+ MAX: 1000
}
const FOLLOW_STATES: { [ id: string ]: FollowState } = {
// Special constants for a test instance
if (isTestInstance() === true) {
- CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14
- FRIEND_SCORE.BASE = 20
+ SERVERS_SCORE.BASE = 20
JOBS_FETCHING_INTERVAL = 1000
REMOTE_SCHEME.HTTP = 'http'
REMOTE_SCHEME.WS = 'ws'
CONFIG,
CONSTRAINTS_FIELDS,
EMBED_SIZE,
- FRIEND_SCORE,
JOB_STATES,
JOBS_FETCH_LIMIT_PER_CYCLE,
JOBS_FETCHING_INTERVAL,
import * as Sequelize from 'sequelize'
import { isHostValid, logger } from '../../helpers'
-import { FRIEND_SCORE, SERVERS_SCORE } from '../../initializers'
+import { SERVERS_SCORE } from '../../initializers'
import { addMethodsToModel } from '../utils'
import { ServerAttributes, ServerInstance, ServerMethods } from './server-interface'
},
score: {
type: DataTypes.INTEGER,
- defaultValue: FRIEND_SCORE.BASE,
+ defaultValue: SERVERS_SCORE.BASE,
allowNull: false,
validate: {
isInt: true,
- max: FRIEND_SCORE.MAX
+ max: SERVERS_SCORE.MAX
}
}
},
await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
- it('Should fail with a too big duration', async function () {
- const fields = getCompleteVideoUploadAttributes()
- const attaches = {
- 'videofile': join(__dirname, '..', 'fixtures', 'video_too_long.webm')
- }
- await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
- })
-
it('Should succeed with the correct parameters', async function () {
this.timeout(10000)