// Redundancies
const redundancyVideos = CONFIG.REDUNDANCY.VIDEOS.STRATEGIES
+ console.log(redundancyVideos)
if (isArray(redundancyVideos)) {
const available = [ 'most-views', 'trending', 'recently-added' ]
for (const r of redundancyVideos) {
if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) {
return 'Min views in recently added strategy is not a number'
}
+ } else {
+ return 'Videos redundancy should be an array (you must uncomment lines containing - too)'
}
// Check storage directory locations
import * as config from 'config'
import { promisify0 } from '../helpers/core-utils'
-import { isArray } from '../helpers/custom-validators/misc'
// ONLY USE CORE MODULES IN THIS FILE!
}
const redundancyVideos = config.get<any>('redundancy.videos.strategies')
- if (isArray(redundancyVideos)) {
+
+ if (Array.isArray(redundancyVideos)) {
for (const r of redundancyVideos) {
if (!r.size) miss.push('redundancy.videos.strategies.size')
if (!r.min_lifetime) miss.push('redundancy.videos.strategies.min_lifetime')
function buildVideosRedundancy (objs: any[]): VideosRedundancy[] {
if (!objs) return []
+ if (!Array.isArray(objs)) return objs
+
return objs.map(obj => {
return Object.assign({}, obj, {
minLifetime: parseDuration(obj.min_lifetime),