import { IConfig } from 'config'
import { dirname, join } from 'path'
-import { VideosRedundancy } from '../../shared/models'
+import { VideosRedundancyStrategy } from '../../shared/models'
// Do not use barrels, remain constants as independent as possible
import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-utils'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
IMPORT: {
VIDEOS: {
HTTP: {
- get ENABLED () { return config.get<boolean>('import.videos.http.enabled') }
+ get ENABLED () { return config.get<boolean>('import.videos.http.enabled') },
+ PROXY: {
+ get ENABLED () { return config.get<boolean>('import.videos.http.proxy.enabled') },
+ get URL () { return config.get<string>('import.videos.http.proxy.url') }
+ }
},
TORRENT: {
get ENABLED () { return config.get<boolean>('import.videos.torrent.enabled') }
if (process.env.NODE_ENV) filename += `-${process.env.NODE_ENV}`
if (process.env.NODE_APP_INSTANCE) filename += `-${process.env.NODE_APP_INSTANCE}`
- return join(dirname(configSources[ 0 ].name), filename + '.json')
+ return join(dirname(configSources[0].name), filename + '.json')
}
-function buildVideosRedundancy (objs: any[]): VideosRedundancy[] {
+function buildVideosRedundancy (objs: any[]): VideosRedundancyStrategy[] {
if (!objs) return []
if (!Array.isArray(objs)) return objs
function purge () {
for (const fileName in require.cache) {
- if (-1 === fileName.indexOf(directory())) {
+ if (fileName.indexOf(directory()) === -1) {
continue
}