diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/migrations/peertube-2.1.ts | 2 | ||||
-rw-r--r-- | scripts/print-transcode-command.ts | 2 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 10 | ||||
-rw-r--r-- | scripts/regenerate-thumbnails.ts | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/scripts/migrations/peertube-2.1.ts b/scripts/migrations/peertube-2.1.ts index e17e58166..4bbc203c1 100644 --- a/scripts/migrations/peertube-2.1.ts +++ b/scripts/migrations/peertube-2.1.ts | |||
@@ -8,7 +8,7 @@ import { HLS_STREAMING_PLAYLIST_DIRECTORY, STATIC_PATHS, WEBSERVER } from '@serv | |||
8 | import { pathExists, stat, writeFile } from 'fs-extra' | 8 | import { pathExists, stat, writeFile } from 'fs-extra' |
9 | import { createTorrentPromise } from '@server/helpers/webtorrent' | 9 | import { createTorrentPromise } from '@server/helpers/webtorrent' |
10 | import { CONFIG } from '@server/initializers/config' | 10 | import { CONFIG } from '@server/initializers/config' |
11 | import * as parseTorrent from 'parse-torrent' | 11 | import parseTorrent from 'parse-torrent' |
12 | import { logger } from '@server/helpers/logger' | 12 | import { logger } from '@server/helpers/logger' |
13 | 13 | ||
14 | run() | 14 | run() |
diff --git a/scripts/print-transcode-command.ts b/scripts/print-transcode-command.ts index d83363215..352145252 100644 --- a/scripts/print-transcode-command.ts +++ b/scripts/print-transcode-command.ts | |||
@@ -2,7 +2,7 @@ import { registerTSPaths } from '../server/helpers/register-ts-paths' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { program } from 'commander' | 4 | import { program } from 'commander' |
5 | import * as ffmpeg from 'fluent-ffmpeg' | 5 | import ffmpeg from 'fluent-ffmpeg' |
6 | import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' | 6 | import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' |
7 | import { exit } from 'process' | 7 | import { exit } from 'process' |
8 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' | 8 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 5b029d215..00141fec1 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -1,14 +1,14 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as prompt from 'prompt' | 4 | import { start, get } from 'prompt' |
5 | import { join, basename } from 'path' | 5 | import { join, basename } from 'path' |
6 | import { CONFIG } from '../server/initializers/config' | 6 | import { CONFIG } from '../server/initializers/config' |
7 | import { VideoModel } from '../server/models/video/video' | 7 | import { VideoModel } from '../server/models/video/video' |
8 | import { initDatabaseModels } from '../server/initializers/database' | 8 | import { initDatabaseModels } from '../server/initializers/database' |
9 | import { readdir, remove, stat } from 'fs-extra' | 9 | import { readdir, remove, stat } from 'fs-extra' |
10 | import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' | 10 | import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' |
11 | import * as Bluebird from 'bluebird' | 11 | import { map } from 'bluebird' |
12 | import { getUUIDFromFilename } from '../server/helpers/utils' | 12 | import { getUUIDFromFilename } from '../server/helpers/utils' |
13 | import { ThumbnailModel } from '../server/models/video/thumbnail' | 13 | import { ThumbnailModel } from '../server/models/video/thumbnail' |
14 | import { ActorImageModel } from '../server/models/actor/actor-image' | 14 | import { ActorImageModel } from '../server/models/actor/actor-image' |
@@ -78,7 +78,7 @@ async function pruneDirectory (directory: string, existFun: ExistFun) { | |||
78 | const files = await readdir(directory) | 78 | const files = await readdir(directory) |
79 | 79 | ||
80 | const toDelete: string[] = [] | 80 | const toDelete: string[] = [] |
81 | await Bluebird.map(files, async file => { | 81 | await map(files, async file => { |
82 | const filePath = join(directory, file) | 82 | const filePath = join(directory, file) |
83 | 83 | ||
84 | if (await existFun(filePath) !== true) { | 84 | if (await existFun(filePath) !== true) { |
@@ -141,7 +141,7 @@ async function doesRedundancyExist (filePath: string) { | |||
141 | 141 | ||
142 | async function askConfirmation () { | 142 | async function askConfirmation () { |
143 | return new Promise((res, rej) => { | 143 | return new Promise((res, rej) => { |
144 | prompt.start() | 144 | start() |
145 | const schema = { | 145 | const schema = { |
146 | properties: { | 146 | properties: { |
147 | confirm: { | 147 | confirm: { |
@@ -154,7 +154,7 @@ async function askConfirmation () { | |||
154 | } | 154 | } |
155 | } | 155 | } |
156 | } | 156 | } |
157 | prompt.get(schema, function (err, result) { | 157 | get(schema, function (err, result) { |
158 | if (err) return rej(err) | 158 | if (err) return rej(err) |
159 | 159 | ||
160 | return res(result.confirm?.match(/y/) !== null) | 160 | return res(result.confirm?.match(/y/) !== null) |
diff --git a/scripts/regenerate-thumbnails.ts b/scripts/regenerate-thumbnails.ts index 078f3830b..8075f90ba 100644 --- a/scripts/regenerate-thumbnails.ts +++ b/scripts/regenerate-thumbnails.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as Bluebird from 'bluebird' | 4 | import { map } from 'bluebird' |
5 | import { program } from 'commander' | 5 | import { program } from 'commander' |
6 | import { pathExists, remove } from 'fs-extra' | 6 | import { pathExists, remove } from 'fs-extra' |
7 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' | 7 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' |
@@ -23,7 +23,7 @@ async function run () { | |||
23 | 23 | ||
24 | const videos = await VideoModel.listLocal() | 24 | const videos = await VideoModel.listLocal() |
25 | 25 | ||
26 | await Bluebird.map(videos, v => { | 26 | await map(videos, v => { |
27 | return processVideo(v) | 27 | return processVideo(v) |
28 | .catch(err => console.error('Cannot process video %s.', v.url, err)) | 28 | .catch(err => console.error('Cannot process video %s.', v.url, err)) |
29 | }, { concurrency: 20 }) | 29 | }, { concurrency: 20 }) |