]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/utils.ts
Translated using Weblate (Arabic)
[github/Chocobozzz/PeerTube.git] / server / helpers / utils.ts
index 11c11829285954db39224a0e53c7945d87119acd..ad3b7949e586d6baeba36569b9f40a0faf9c9c72 100644 (file)
@@ -1,11 +1,9 @@
 import { ResultList } from '../../shared'
-import { ApplicationModel } from '../models/application/application'
 import { execPromise, execPromise2, randomBytesPromise, sha256 } from './core-utils'
 import { logger } from './logger'
 import { join } from 'path'
 import { Instance as ParseTorrent } from 'parse-torrent'
 import { remove } from 'fs-extra'
-import * as memoizee from 'memoizee'
 import { CONFIG } from '../initializers/config'
 import { isVideoFileExtnameValid } from './custom-validators/videos'
 
@@ -33,16 +31,6 @@ function getFormattedObjects<U, V, T extends FormattableToJSON<U, V>> (objects:
   } as ResultList<V>
 }
 
-const getServerActor = memoizee(async function () {
-  const application = await ApplicationModel.load()
-  if (!application) throw Error('Could not load Application from database.')
-
-  const actor = application.Account.Actor
-  actor.Account = application.Account
-
-  return actor
-}, { promise: true })
-
 function generateVideoImportTmpPath (target: string | ParseTorrent, extensionArg?: string) {
   const id = typeof target === 'string'
     ? target
@@ -105,7 +93,6 @@ export {
   generateRandomString,
   getFormattedObjects,
   getSecureTorrentName,
-  getServerActor,
   getServerCommit,
   generateVideoImportTmpPath,
   getUUIDFromFilename