aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/server
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/server')
-rw-r--r--shared/server-commands/server/config-command.ts27
-rw-r--r--shared/server-commands/server/servers-command.ts8
2 files changed, 34 insertions, 1 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts
index 7f1e9d977..3521b2d69 100644
--- a/shared/server-commands/server/config-command.ts
+++ b/shared/server-commands/server/config-command.ts
@@ -74,6 +74,28 @@ export class ConfigCommand extends AbstractCommand {
74 74
75 // --------------------------------------------------------------------------- 75 // ---------------------------------------------------------------------------
76 76
77 disableFileUpdate () {
78 return this.setFileUpdateEnabled(false)
79 }
80
81 enableFileUpdate () {
82 return this.setFileUpdateEnabled(true)
83 }
84
85 private setFileUpdateEnabled (enabled: boolean) {
86 return this.updateExistingSubConfig({
87 newConfig: {
88 videoFile: {
89 update: {
90 enabled
91 }
92 }
93 }
94 })
95 }
96
97 // ---------------------------------------------------------------------------
98
77 enableChannelSync () { 99 enableChannelSync () {
78 return this.setChannelSyncEnabled(true) 100 return this.setChannelSyncEnabled(true)
79 } 101 }
@@ -466,6 +488,11 @@ export class ConfigCommand extends AbstractCommand {
466 enabled: false 488 enabled: false
467 } 489 }
468 }, 490 },
491 videoFile: {
492 update: {
493 enabled: false
494 }
495 },
469 import: { 496 import: {
470 videos: { 497 videos: {
471 concurrency: 3, 498 concurrency: 3,
diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts
index c91c2b008..54e586a18 100644
--- a/shared/server-commands/server/servers-command.ts
+++ b/shared/server-commands/server/servers-command.ts
@@ -1,5 +1,5 @@
1import { exec } from 'child_process' 1import { exec } from 'child_process'
2import { copy, ensureDir, readFile, remove } from 'fs-extra' 2import { copy, ensureDir, readFile, readdir, remove } from 'fs-extra'
3import { basename, join } from 'path' 3import { basename, join } from 'path'
4import { isGithubCI, root, wait } from '@shared/core-utils' 4import { isGithubCI, root, wait } from '@shared/core-utils'
5import { getFileSize } from '@shared/extra-utils' 5import { getFileSize } from '@shared/extra-utils'
@@ -77,6 +77,12 @@ export class ServersCommand extends AbstractCommand {
77 return join(root(), 'test' + this.server.internalServerNumber, directory) 77 return join(root(), 'test' + this.server.internalServerNumber, directory)
78 } 78 }
79 79
80 async countFiles (directory: string) {
81 const files = await readdir(this.buildDirectory(directory))
82
83 return files.length
84 }
85
80 buildWebVideoFilePath (fileUrl: string) { 86 buildWebVideoFilePath (fileUrl: string) {
81 return this.buildDirectory(join('web-videos', basename(fileUrl))) 87 return this.buildDirectory(join('web-videos', basename(fileUrl)))
82 } 88 }