OSDN Git Service

過去ログ取得時点をConverterコンストラクタ引数からProfileに移動
[coroid/inqubus.git] / frontend / src / saccubus / properties / SProperties.java
index 5d43a72..66ab194 100644 (file)
@@ -5,35 +5,37 @@ import java.util.Properties;
 import java.io.IOException;
 import java.io.FileOutputStream;
 import java.io.FileInputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import saccubus.VideoSaveKind;
-import saccubus.converter.filegetter.LoginInfo;
-import saccubus.converter.profile.CommentGetInfo;
-import saccubus.converter.profile.Ffmpeg;
-import saccubus.converter.profile.FfmpegOption;
-import saccubus.converter.profile.GeneralSetting;
-import saccubus.converter.profile.InputFileSetting;
-import saccubus.converter.profile.OutputFileSetting;
-import saccubus.converter.profile.Profile;
-import saccubus.converter.profile.Proxy;
-import saccubus.converter.profile.SFile;
+import saccubus.converter.classic.profile.LoginInfo;
+import saccubus.converter.classic.profile.CommentGetInfo;
+import saccubus.converter.classic.profile.Ffmpeg;
+import saccubus.converter.classic.profile.FfmpegOption;
+import saccubus.converter.classic.profile.GeneralSetting;
+import saccubus.converter.classic.profile.InputFileSetting;
+import saccubus.converter.classic.profile.OutputFileSetting;
+import saccubus.converter.classic.profile.Profile;
+import saccubus.converter.classic.profile.Proxy;
+import saccubus.converter.classic.profile.SFile;
 
 /**
  * <p>
  * タイトル: さきゅばす
  * </p>
- * 
+ *
  * <p>
  * 説明: ニコニコ動画の動画をコメントつきで保存
  * </p>
- * 
+ *
  * <p>
  * 著作権: Copyright (c) 2007 PSI
  * </p>
- * 
+ *
  * <p>
  * 会社名:
  * </p>
- * 
+ *
  * @author 未入力
  * @version 1.0
  */
@@ -128,7 +130,7 @@ public class SProperties {
             final boolean isFile = (!setting.isAutoNaming() || setting.getProcessKind() == VideoSaveKind.NICOBROWSER);
             File video;
             if (setting.getProcessKind() == VideoSaveKind.NICOBROWSER) {
-                video = setting.getFile();
+                video = setting.getNicoBrowserFile();
             } else {
                 if (setting.isAutoNaming()) {
                     video = setting.getFolder();
@@ -140,7 +142,8 @@ public class SProperties {
             // Nicobrowserダウンロードファイルは削除対象にならない.
             boolean delete = setting.isDeleteAfterConvert() && (setting.getProcessKind() != VideoSaveKind.NICOBROWSER);
 
-            return new InputFileSetting(videoFile, (setting.getProcessKind() == VideoSaveKind.SAVE), delete);
+            return new InputFileSetting(videoFile, (setting.getProcessKind() == VideoSaveKind.SAVE), delete,
+                    buildCommentGetInfo(), inputCommentSetting.getBackLogPoint());
         }
 
         private InputFileSetting buildCommentSetting() {
@@ -149,7 +152,8 @@ public class SProperties {
 
         private CommentGetInfo buildCommentGetInfo() {
             final InputCommentSetting setting = getInputCommentSetting();
-            return new CommentGetInfo(setting.isSelfAdjustNumOfComment(), setting.getNumOfComment());
+            return new CommentGetInfo(setting.isSelfAdjustNumOfComment(), setting.getNumOfComment(), setting.
+                    isReduceComment());
         }
 
         private InputFileSetting buildTcommentSetting() {
@@ -159,7 +163,8 @@ public class SProperties {
         private InputFileSetting createCommentSetting(saccubus.properties.InputFileSetting<Boolean> setting) {
             SFile file = createSFile(setting);
 
-            return new InputFileSetting(file, setting.getProcessKind().booleanValue(), setting.isDeleteAfterConvert());
+            return new InputFileSetting(file, setting.getProcessKind().booleanValue(), setting.isDeleteAfterConvert(),
+                    buildCommentGetInfo(), inputCommentSetting.getBackLogPoint());
 
         }
 
@@ -223,7 +228,7 @@ public class SProperties {
         try {
             prop.storeToXML(new FileOutputStream(PROP_FILE), "settings");
         } catch (IOException ex) {
-            ex.printStackTrace();
+            Logger.getLogger(SProperties.class.getName()).log(Level.SEVERE, "コンフィグファイルの保存に失敗", ex);
         }
     }
 
@@ -232,7 +237,7 @@ public class SProperties {
         try {
             prop.loadFromXML(new FileInputStream(PROP_FILE));
         } catch (IOException ex) {
-            ex.printStackTrace();
+            Logger.getLogger(SProperties.class.getName()).log(Level.INFO, "コンフィグファイルが存在しないため自動生成します", ex);
         }
 
         return new SProperties(