import { exec } from 'child_process'
import { copy, ensureDir, readFile, remove } from 'fs-extra'
-import { join } from 'path'
+import { basename, join } from 'path'
import { root } from '@server/helpers/core-utils'
-import { HttpStatusCode } from '@shared/core-utils'
-import { getFileSize } from '@uploadx/core'
-import { isGithubCI, wait } from '../miscs'
+import { HttpStatusCode } from '@shared/models'
+import { getFileSize, isGithubCI, wait } from '../miscs'
import { AbstractCommand, OverrideCommandOptions } from '../shared'
export class ServersCommand extends AbstractCommand {
if (isGithubCI()) {
await ensureDir('artifacts')
- const origin = this.server.servers.buildDirectory('logs/peertube.log')
+ const origin = this.buildDirectory('logs/peertube.log')
const destname = `peertube-${this.server.internalServerNumber}.log`
console.log('Saving logs %s.', destname)
return join(root(), 'test' + this.server.internalServerNumber, directory)
}
+ buildWebTorrentFilePath (fileUrl: string) {
+ return this.buildDirectory(join('videos', basename(fileUrl)))
+ }
+
+ buildFragmentedFilePath (videoUUID: string, fileUrl: string) {
+ return this.buildDirectory(join('streaming-playlists', 'hls', videoUUID, basename(fileUrl)))
+ }
+
async getServerFileSize (subPath: string) {
const path = this.server.servers.buildDirectory(subPath)