Correct file source extension for the merge pass.

This commit is contained in:
Godzil 2016-08-13 16:32:56 +01:00
parent 546a849aa5
commit 422d0827f9
2 changed files with 11 additions and 3 deletions

View File

@ -50,7 +50,7 @@ function download(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, d
if (err) return done(err);
if (config.merge) return complete('Finished ' + fileName, now, done);
var isSubtited = Boolean(player.subtitle);
video.merge(config, isSubtited, player.video.file, filePath, err => {
video.merge(config, isSubtited, player.video.file, filePath, player.mode, err => {
if (err) return done(err);
complete('Finished ' + fileName, now, done);
});

View File

@ -8,9 +8,17 @@ import subtitle from '../subtitle/index';
/**
* Merges the subtitle and video files into a Matroska Multimedia Container.
*/
export default function(config: IConfig, isSubtitled: boolean, rtmpInputPath: string, filePath: string, done: (err: Error) => void) {
export default function(config: IConfig, isSubtitled: boolean, rtmpInputPath: string, filePath: string, streamMode: string, done: (err: Error) => void) {
var subtitlePath = filePath + '.' + (subtitle.formats[config.format] ? config.format : 'ass');
var videoPath = filePath + path.extname(rtmpInputPath);
var videoPath = filePath;
if (streamMode == "RTMP")
{
videoPath += path.extname(rtmpInputPath);
}
else
{
videoPath += ".mp4";
}
childProcess.exec(command() + ' ' +
'-o "' + filePath + '.mkv" ' +
'"' + videoPath + '" ' +