+ data: formattedObjects
+ } as ResultList<U>
+}
+
+const getServerActor = memoizee(async function () {
+ const application = await ApplicationModel.load()
+ if (!application) throw Error('Could not load Application from database.')
+
+ return application.Account.Actor
+})
+
+function generateVideoTmpPath (target: string | ParseTorrent) {
+ const id = typeof target === 'string' ? target : target.infoHash
+
+ const hash = sha256(id)
+ return join(CONFIG.STORAGE.VIDEOS_DIR, hash + '-import.mp4')
+}
+
+function getSecureTorrentName (originalName: string) {
+ return sha256(originalName) + '.torrent'