diff options
Diffstat (limited to 'server/helpers/utils.ts')
-rw-r--r-- | server/helpers/utils.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts index 049c3f8bc..9b89e3e61 100644 --- a/server/helpers/utils.ts +++ b/server/helpers/utils.ts | |||
@@ -46,18 +46,18 @@ const getServerActor = memoizee(async function () { | |||
46 | return actor | 46 | return actor |
47 | }) | 47 | }) |
48 | 48 | ||
49 | function generateVideoTmpPath (target: string | ParseTorrent) { | 49 | function generateVideoImportTmpPath (target: string | ParseTorrent) { |
50 | const id = typeof target === 'string' ? target : target.infoHash | 50 | const id = typeof target === 'string' ? target : target.infoHash |
51 | 51 | ||
52 | const hash = sha256(id) | 52 | const hash = sha256(id) |
53 | return join(CONFIG.STORAGE.VIDEOS_DIR, hash + '-import.mp4') | 53 | return join(CONFIG.STORAGE.TMP_DIR, hash + '-import.mp4') |
54 | } | 54 | } |
55 | 55 | ||
56 | function getSecureTorrentName (originalName: string) { | 56 | function getSecureTorrentName (originalName: string) { |
57 | return sha256(originalName) + '.torrent' | 57 | return sha256(originalName) + '.torrent' |
58 | } | 58 | } |
59 | 59 | ||
60 | async function getVersion () { | 60 | async function getServerCommit () { |
61 | try { | 61 | try { |
62 | const tag = await execPromise2( | 62 | const tag = await execPromise2( |
63 | '[ ! -d .git ] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', | 63 | '[ ! -d .git ] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', |
@@ -77,7 +77,7 @@ async function getVersion () { | |||
77 | logger.debug('Cannot get version from git HEAD.', { err }) | 77 | logger.debug('Cannot get version from git HEAD.', { err }) |
78 | } | 78 | } |
79 | 79 | ||
80 | return require('../../../package.json').version | 80 | return '' |
81 | } | 81 | } |
82 | 82 | ||
83 | /** | 83 | /** |
@@ -102,7 +102,7 @@ export { | |||
102 | getFormattedObjects, | 102 | getFormattedObjects, |
103 | getSecureTorrentName, | 103 | getSecureTorrentName, |
104 | getServerActor, | 104 | getServerActor, |
105 | getVersion, | 105 | getServerCommit, |
106 | generateVideoTmpPath, | 106 | generateVideoImportTmpPath, |
107 | getUUIDFromFilename | 107 | getUUIDFromFilename |
108 | } | 108 | } |