Better file name for torrent

pull/525/head
Chocobozzz 2018-04-19 15:13:41 +02:00
parent 2243730c8e
commit 81e504b34e
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 6 additions and 4 deletions

View File

@ -168,7 +168,7 @@ const CONFIG = {
get DESCRIPTION () { return config.get<string>('instance.description') },
get TERMS () { return config.get<string>('instance.terms') },
get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
get NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') },
get DEFAULT_NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') },
CUSTOMIZATIONS: {
get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') },
get CSS () { return config.get<string>('instance.customizations.css') }

View File

@ -944,8 +944,10 @@ export class VideoModel extends Model<VideoModel> {
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<VideoModel> {
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<VideoModel> {
}
}
transcodeOriginalVideofile = async function (resolution: VideoResolution, isPortraitMode: boolean) {
async transcodeOriginalVideofile (resolution: VideoResolution, isPortraitMode: boolean) {
const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR
const extname = '.mp4'