mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Prefer using Object.values
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { writeJSON } from 'fs-extra'
|
||||
import { values } from 'lodash'
|
||||
import { join } from 'path'
|
||||
import { root } from '@shared/core-utils'
|
||||
import {
|
||||
@@ -65,13 +64,13 @@ Object.assign(playerKeys, videojs)
|
||||
|
||||
// Server keys
|
||||
const serverKeys: any = {}
|
||||
values(VIDEO_CATEGORIES)
|
||||
.concat(values(VIDEO_LICENCES))
|
||||
.concat(values(VIDEO_PRIVACIES))
|
||||
.concat(values(VIDEO_STATES))
|
||||
.concat(values(VIDEO_IMPORT_STATES))
|
||||
.concat(values(VIDEO_PLAYLIST_PRIVACIES))
|
||||
.concat(values(VIDEO_PLAYLIST_TYPES))
|
||||
Object.values(VIDEO_CATEGORIES)
|
||||
.concat(Object.values(VIDEO_LICENCES))
|
||||
.concat(Object.values(VIDEO_PRIVACIES))
|
||||
.concat(Object.values(VIDEO_STATES))
|
||||
.concat(Object.values(VIDEO_IMPORT_STATES))
|
||||
.concat(Object.values(VIDEO_PLAYLIST_PRIVACIES))
|
||||
.concat(Object.values(VIDEO_PLAYLIST_TYPES))
|
||||
.concat([
|
||||
'This video does not exist.',
|
||||
'We cannot fetch the video. Please try again later.',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { map } from 'bluebird'
|
||||
import { readdir, remove, stat } from 'fs-extra'
|
||||
import { uniq, values } from 'lodash'
|
||||
import { basename, join } from 'path'
|
||||
import { get, start } from 'prompt'
|
||||
import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'
|
||||
import { VideoFileModel } from '@server/models/video/video-file'
|
||||
import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
|
||||
import { uniqify } from '@shared/core-utils'
|
||||
import { ThumbnailType } from '@shared/models'
|
||||
import { getUUIDFromFilename } from '../server/helpers/utils'
|
||||
import { CONFIG } from '../server/initializers/config'
|
||||
@@ -23,9 +23,9 @@ run()
|
||||
})
|
||||
|
||||
async function run () {
|
||||
const dirs = values(CONFIG.STORAGE)
|
||||
const dirs = Object.values(CONFIG.STORAGE)
|
||||
|
||||
if (uniq(dirs).length !== dirs.length) {
|
||||
if (uniqify(dirs).length !== dirs.length) {
|
||||
console.error('Cannot prune storage because you put multiple storage keys in the same directory.')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user