From 81e504b34e71e91633442c8021e05f9cd52a49c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Apr 2018 15:13:41 +0200 Subject: [PATCH] Better file name for torrent --- server/initializers/constants.ts | 2 +- server/models/video/video.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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' -- 2.25.1