diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:36:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:36:03 +0200 |
commit | 690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3 (patch) | |
tree | b16b8536acd2098aba8c1d6fe13a336dd6aa01a9 /scripts | |
parent | bbd5aa7ead5f1554a0872963f957effc26d8c630 (diff) | |
download | PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.tar.gz PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.tar.zst PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.zip |
Prefer using Object.values
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 15 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 6 |
2 files changed, 10 insertions, 11 deletions
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index e52909c43..8179cb43f 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { writeJSON } from 'fs-extra' | 1 | import { writeJSON } from 'fs-extra' |
2 | import { values } from 'lodash' | ||
3 | import { join } from 'path' | 2 | import { join } from 'path' |
4 | import { root } from '@shared/core-utils' | 3 | import { root } from '@shared/core-utils' |
5 | import { | 4 | import { |
@@ -65,13 +64,13 @@ Object.assign(playerKeys, videojs) | |||
65 | 64 | ||
66 | // Server keys | 65 | // Server keys |
67 | const serverKeys: any = {} | 66 | const serverKeys: any = {} |
68 | values(VIDEO_CATEGORIES) | 67 | Object.values(VIDEO_CATEGORIES) |
69 | .concat(values(VIDEO_LICENCES)) | 68 | .concat(Object.values(VIDEO_LICENCES)) |
70 | .concat(values(VIDEO_PRIVACIES)) | 69 | .concat(Object.values(VIDEO_PRIVACIES)) |
71 | .concat(values(VIDEO_STATES)) | 70 | .concat(Object.values(VIDEO_STATES)) |
72 | .concat(values(VIDEO_IMPORT_STATES)) | 71 | .concat(Object.values(VIDEO_IMPORT_STATES)) |
73 | .concat(values(VIDEO_PLAYLIST_PRIVACIES)) | 72 | .concat(Object.values(VIDEO_PLAYLIST_PRIVACIES)) |
74 | .concat(values(VIDEO_PLAYLIST_TYPES)) | 73 | .concat(Object.values(VIDEO_PLAYLIST_TYPES)) |
75 | .concat([ | 74 | .concat([ |
76 | 'This video does not exist.', | 75 | 'This video does not exist.', |
77 | 'We cannot fetch the video. Please try again later.', | 76 | 'We cannot fetch the video. Please try again later.', |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index bb1e8e024..3012bdb94 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { map } from 'bluebird' | 1 | import { map } from 'bluebird' |
2 | import { readdir, remove, stat } from 'fs-extra' | 2 | import { readdir, remove, stat } from 'fs-extra' |
3 | import { uniq, values } from 'lodash' | ||
4 | import { basename, join } from 'path' | 3 | import { basename, join } from 'path' |
5 | import { get, start } from 'prompt' | 4 | import { get, start } from 'prompt' |
6 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' | 5 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' |
7 | import { VideoFileModel } from '@server/models/video/video-file' | 6 | import { VideoFileModel } from '@server/models/video/video-file' |
8 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 7 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
8 | import { uniqify } from '@shared/core-utils' | ||
9 | import { ThumbnailType } from '@shared/models' | 9 | import { ThumbnailType } from '@shared/models' |
10 | import { getUUIDFromFilename } from '../server/helpers/utils' | 10 | import { getUUIDFromFilename } from '../server/helpers/utils' |
11 | import { CONFIG } from '../server/initializers/config' | 11 | import { CONFIG } from '../server/initializers/config' |
@@ -23,9 +23,9 @@ run() | |||
23 | }) | 23 | }) |
24 | 24 | ||
25 | async function run () { | 25 | async function run () { |
26 | const dirs = values(CONFIG.STORAGE) | 26 | const dirs = Object.values(CONFIG.STORAGE) |
27 | 27 | ||
28 | if (uniq(dirs).length !== dirs.length) { | 28 | if (uniqify(dirs).length !== dirs.length) { |
29 | console.error('Cannot prune storage because you put multiple storage keys in the same directory.') | 29 | console.error('Cannot prune storage because you put multiple storage keys in the same directory.') |
30 | process.exit(0) | 30 | process.exit(0) |
31 | } | 31 | } |