+ // Redundancies
+ const redundancyVideos = config.get<VideosRedundancy[]>('redundancy.videos')
+ if (isArray(redundancyVideos)) {
+ for (const r of redundancyVideos) {
+ if ([ 'most-views', 'trending', 'recently-added' ].indexOf(r.strategy) === -1) {
+ return 'Redundancy video entries should have "most-views" strategy instead of ' + r.strategy
+ }
+ }
+
+ const filtered = uniq(redundancyVideos.map(r => r.strategy))
+ if (filtered.length !== redundancyVideos.length) {
+ return 'Redundancy video entries should have unique strategies'
+ }
+
+ const recentlyAddedStrategy = redundancyVideos.find(r => r.strategy === 'recently-added') as RecentlyAddedStrategy
+ if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) {
+ return 'Min views in recently added strategy is not a number'
+ }
+ }
+