Procházet zdrojové kódy

Correct file source extension for the merge pass.

Godzil před 7 roky
rodič
revize
422d0827f9
2 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. 1 1
      src/episode.ts
  2. 10 2
      src/video/merge.ts

+ 1 - 1
src/episode.ts

@@ -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);
         });

+ 10 - 2
src/video/merge.ts

@@ -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 + '" ' +