aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-19 15:13:41 +0200
committerChocobozzz <me@florianbigard.com>2018-04-19 15:13:41 +0200
commit81e504b34e71e91633442c8021e05f9cd52a49c6 (patch)
tree69d2a63af1baa99216ec6a1eca1b9b2228171a5a /server
parent2243730c8edf210c0a3ffc161bac89785f6a52f0 (diff)
downloadPeerTube-81e504b34e71e91633442c8021e05f9cd52a49c6.tar.gz
PeerTube-81e504b34e71e91633442c8021e05f9cd52a49c6.tar.zst
PeerTube-81e504b34e71e91633442c8021e05f9cd52a49c6.zip
Better file name for torrent
Diffstat (limited to 'server')
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/models/video/video.ts8
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 = {
168 get DESCRIPTION () { return config.get<string>('instance.description') }, 168 get DESCRIPTION () { return config.get<string>('instance.description') },
169 get TERMS () { return config.get<string>('instance.terms') }, 169 get TERMS () { return config.get<string>('instance.terms') },
170 get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') }, 170 get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
171 get NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') }, 171 get DEFAULT_NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') },
172 CUSTOMIZATIONS: { 172 CUSTOMIZATIONS: {
173 get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') }, 173 get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') },
174 get CSS () { return config.get<string>('instance.customizations.css') } 174 get CSS () { return config.get<string>('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<VideoModel> {
944 return join(CONFIG.STORAGE.VIDEOS_DIR, this.getVideoFilename(videoFile)) 944 return join(CONFIG.STORAGE.VIDEOS_DIR, this.getVideoFilename(videoFile))
945 } 945 }
946 946
947 createTorrentAndSetInfoHash = async function (videoFile: VideoFileModel) { 947 async createTorrentAndSetInfoHash (videoFile: VideoFileModel) {
948 const options = { 948 const options = {
949 name: this.name + videoFile.extname,
950 createdBy: 'PeerTube',
949 announceList: [ 951 announceList: [
950 [ CONFIG.WEBSERVER.WS + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT + '/tracker/socket' ], 952 [ CONFIG.WEBSERVER.WS + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT + '/tracker/socket' ],
951 [ CONFIG.WEBSERVER.URL + '/tracker/announce' ] 953 [ CONFIG.WEBSERVER.URL + '/tracker/announce' ]
@@ -1240,7 +1242,7 @@ export class VideoModel extends Model<VideoModel> {
1240 return peertubeTruncate(this.description, maxLength) 1242 return peertubeTruncate(this.description, maxLength)
1241 } 1243 }
1242 1244
1243 optimizeOriginalVideofile = async function () { 1245 async optimizeOriginalVideofile () {
1244 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR 1246 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR
1245 const newExtname = '.mp4' 1247 const newExtname = '.mp4'
1246 const inputVideoFile = this.getOriginalFile() 1248 const inputVideoFile = this.getOriginalFile()
@@ -1277,7 +1279,7 @@ export class VideoModel extends Model<VideoModel> {
1277 } 1279 }
1278 } 1280 }
1279 1281
1280 transcodeOriginalVideofile = async function (resolution: VideoResolution, isPortraitMode: boolean) { 1282 async transcodeOriginalVideofile (resolution: VideoResolution, isPortraitMode: boolean) {
1281 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR 1283 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR
1282 const extname = '.mp4' 1284 const extname = '.mp4'
1283 1285