-function createEmptyCallback () {
- return function (err) {
- if (err) logger.error('Error in empty callback.', { error: err })
- }
+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
+})
+
+function generateVideoImportTmpPath (target: string | ParseTorrent) {
+ const id = typeof target === 'string' ? target : target.infoHash
+
+ const hash = sha256(id)
+ return join(CONFIG.STORAGE.TMP_DIR, hash + '-import.mp4')