diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index fb436366c..d1915586a 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -168,7 +168,7 @@ const CONFIG = { get DESCRIPTION () { return config.get('instance.description') }, get TERMS () { return config.get('instance.terms') }, get DEFAULT_CLIENT_ROUTE () { return config.get('instance.default_client_route') }, - get NSFW_POLICY () { return config.get('instance.default_nsfw_policy') }, + get DEFAULT_NSFW_POLICY () { return config.get('instance.default_nsfw_policy') }, CUSTOMIZATIONS: { get JAVASCRIPT () { return config.get('instance.customizations.javascript') }, get CSS () { return config.get('instance.customizations.css') } diff --git a/server/models/video/video.ts b/server/models/video/video.ts index c08d18b71..70d3948ee 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -944,8 +944,10 @@ export class VideoModel extends Model { return join(CONFIG.STORAGE.VIDEOS_DIR, this.getVideoFilename(videoFile)) } - createTorrentAndSetInfoHash = async function (videoFile: VideoFileModel) { + async createTorrentAndSetInfoHash (videoFile: VideoFileModel) { const options = { + name: this.name + videoFile.extname, + createdBy: 'PeerTube', announceList: [ [ CONFIG.WEBSERVER.WS + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT + '/tracker/socket' ], [ CONFIG.WEBSERVER.URL + '/tracker/announce' ] @@ -1240,7 +1242,7 @@ export class VideoModel extends Model { return peertubeTruncate(this.description, maxLength) } - optimizeOriginalVideofile = async function () { + async optimizeOriginalVideofile () { const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR const newExtname = '.mp4' const inputVideoFile = this.getOriginalFile() @@ -1277,7 +1279,7 @@ export class VideoModel extends Model { } } - transcodeOriginalVideofile = async function (resolution: VideoResolution, isPortraitMode: boolean) { + async transcodeOriginalVideofile (resolution: VideoResolution, isPortraitMode: boolean) { const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR const extname = '.mp4'