import { randomBytes } from 'crypto'
import { invert } from 'lodash'
import { join } from 'path'
-import { randomInt } from '../../shared/core-utils/miscs/miscs'
+import { randomInt } from '../../shared/core-utils/common/miscs'
import {
AbuseState,
JobType,
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 645
+const LAST_MIGRATION_VERSION = 660
// ---------------------------------------------------------------------------
// Don't forget to update peertube-search-index with the same values
VIDEOS_SEARCH: [ 'name', 'duration', 'createdAt', 'publishedAt', 'originallyPublishedAt', 'views', 'likes', 'match' ],
VIDEO_CHANNELS_SEARCH: [ 'match', 'displayName', 'createdAt' ],
+ VIDEO_PLAYLISTS_SEARCH: [ 'match', 'displayName', 'createdAt' ],
ABUSES: [ 'id', 'createdAt', 'state' ],
'videos-views': 1,
'activitypub-refresher': 1,
'video-redundancy': 1,
- 'video-live-ending': 1
+ 'video-live-ending': 1,
+ 'move-to-object-storage': 3
}
// Excluded keys are jobs that can be configured by admins
const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-import'>]: number } = {
'activitypub-http-broadcast': 1,
'activitypub-http-unicast': 5,
- 'activitypub-http-fetcher': 1,
+ 'activitypub-http-fetcher': 3,
'activitypub-cleaner': 1,
'activitypub-follow': 1,
'video-file-import': 1,
'videos-views': 1,
'activitypub-refresher': 1,
'video-redundancy': 1,
- 'video-live-ending': 10
+ 'video-live-ending': 10,
+ 'move-to-object-storage': 1
}
const JOB_TTL: { [id in JobType]: number } = {
'activitypub-http-broadcast': 60000 * 10, // 10 minutes
'videos-views': undefined, // Unlimited
'activitypub-refresher': 60000 * 10, // 10 minutes
'video-redundancy': 1000 * 3600 * 3, // 3 hours
- 'video-live-ending': 1000 * 60 * 10 // 10 minutes
+ 'video-live-ending': 1000 * 60 * 10, // 10 minutes
+ 'move-to-object-storage': 1000 * 60 * 60 * 3 // 3 hours
}
const REPEAT_JOBS: { [ id: string ]: EveryRepeatOptions | CronRepeatOptions } = {
'videos-views': {
CAPTION_FILE: {
EXTNAME: [ '.vtt', '.srt' ],
FILE_SIZE: {
- max: 2 * 1024 * 1024 // 2MB
+ max: 4 * 1024 * 1024 // 4MB
}
}
},
IMAGE: {
EXTNAME: [ '.png', '.jpg', '.jpeg', '.webp' ],
FILE_SIZE: {
- max: 2 * 1024 * 1024 // 2MB
+ max: 4 * 1024 * 1024 // 4MB
}
},
EXTNAME: [] as string[],
IMAGE: {
EXTNAME: [ '.jpg', '.jpeg' ],
FILE_SIZE: {
- max: 2 * 1024 * 1024 // 2MB
+ max: 4 * 1024 * 1024 // 4MB
}
}
},
IMAGE: {
EXTNAME: [ '.png', '.jpeg', '.jpg', '.gif', '.webp' ],
FILE_SIZE: {
- max: 2 * 1024 * 1024 // 2MB
+ max: 4 * 1024 * 1024 // 4MB
}
}
},
[VideoState.TO_TRANSCODE]: 'To transcode',
[VideoState.TO_IMPORT]: 'To import',
[VideoState.WAITING_FOR_LIVE]: 'Waiting for livestream',
- [VideoState.LIVE_ENDED]: 'Livestream ended'
+ [VideoState.LIVE_ENDED]: 'Livestream ended',
+ [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE]: 'To move to an external storage'
}
const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = {
'audio/ogg': '.ogg',
'audio/x-ms-wma': '.wma',
'audio/wav': '.wav',
+ 'audio/x-wav': '.wav',
'audio/x-flac': '.flac',
'audio/flac': '.flac',
- 'audio/aac': '.aac',
+ 'audio/aac': '.aac',
'audio/m4a': '.m4a',
'audio/mp4': '.m4a',
'audio/x-m4a': '.m4a',