aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/migrations/peertube-2.1.ts2
-rw-r--r--scripts/print-transcode-command.ts2
-rwxr-xr-xscripts/prune-storage.ts10
-rw-r--r--scripts/regenerate-thumbnails.ts4
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
8import { pathExists, stat, writeFile } from 'fs-extra' 8import { pathExists, stat, writeFile } from 'fs-extra'
9import { createTorrentPromise } from '@server/helpers/webtorrent' 9import { createTorrentPromise } from '@server/helpers/webtorrent'
10import { CONFIG } from '@server/initializers/config' 10import { CONFIG } from '@server/initializers/config'
11import * as parseTorrent from 'parse-torrent' 11import parseTorrent from 'parse-torrent'
12import { logger } from '@server/helpers/logger' 12import { logger } from '@server/helpers/logger'
13 13
14run() 14run()
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'
2registerTSPaths() 2registerTSPaths()
3 3
4import { program } from 'commander' 4import { program } from 'commander'
5import * as ffmpeg from 'fluent-ffmpeg' 5import ffmpeg from 'fluent-ffmpeg'
6import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' 6import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils'
7import { exit } from 'process' 7import { exit } from 'process'
8import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' 8import { 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 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths' 1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths() 2registerTSPaths()
3 3
4import * as prompt from 'prompt' 4import { start, get } from 'prompt'
5import { join, basename } from 'path' 5import { join, basename } from 'path'
6import { CONFIG } from '../server/initializers/config' 6import { CONFIG } from '../server/initializers/config'
7import { VideoModel } from '../server/models/video/video' 7import { VideoModel } from '../server/models/video/video'
8import { initDatabaseModels } from '../server/initializers/database' 8import { initDatabaseModels } from '../server/initializers/database'
9import { readdir, remove, stat } from 'fs-extra' 9import { readdir, remove, stat } from 'fs-extra'
10import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' 10import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy'
11import * as Bluebird from 'bluebird' 11import { map } from 'bluebird'
12import { getUUIDFromFilename } from '../server/helpers/utils' 12import { getUUIDFromFilename } from '../server/helpers/utils'
13import { ThumbnailModel } from '../server/models/video/thumbnail' 13import { ThumbnailModel } from '../server/models/video/thumbnail'
14import { ActorImageModel } from '../server/models/actor/actor-image' 14import { 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
142async function askConfirmation () { 142async 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 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths' 1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths() 2registerTSPaths()
3 3
4import * as Bluebird from 'bluebird' 4import { map } from 'bluebird'
5import { program } from 'commander' 5import { program } from 'commander'
6import { pathExists, remove } from 'fs-extra' 6import { pathExists, remove } from 'fs-extra'
7import { generateImageFilename, processImage } from '@server/helpers/image-utils' 7import { 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 })