OSDN Git Service

過去ログ取得時点をConverterコンストラクタ引数からProfileに移動
authoryukihane <yukihane.feather@gmail.com>
Fri, 19 Aug 2011 23:52:13 +0000 (08:52 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 19 Aug 2011 23:52:13 +0000 (08:52 +0900)
frontend/src/saccubus/MainFrame.java
frontend/src/saccubus/converter/Converter.java
frontend/src/saccubus/converter/classic/profile/InputFileSetting.java
frontend/src/saccubus/prompt/Prompt.java
frontend/src/saccubus/properties/InputCommentSetting.java
frontend/src/saccubus/properties/SProperties.java
frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java
frontend/test/saccubus/converter/ConverterTest.java

index ee6059b..5b7c34c 100644 (file)
@@ -968,7 +968,7 @@ public class MainFrame extends JFrame {
             }
         };
 
-        Converter = new Converter(url, wayBackField.getText(), getSetting().toProfile(), sl,
+        Converter = new Converter(url, getSetting().toProfile(), sl,
                 new ConvertStopFlag(scl));
         doButton.setText(DoButtonStopString);
         FutureTask<Boolean> task = new FutureTask<Boolean>(Converter);
@@ -1392,7 +1392,7 @@ public class MainFrame extends JFrame {
         boolean adjustNumOfCom = savePanel.getFixCommentNumCheckBox().isSelected();
 
         return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, adjustNumOfCom,
-                back_comment, reduceCommentCheckBox.isSelected());
+                back_comment, reduceCommentCheckBox.isSelected(), wayBackField.getText());
     }
 
     /**
index 2f7506e..84c934f 100644 (file)
@@ -27,7 +27,6 @@ public class Converter extends AbstractCommand implements Callable<Boolean> {
 
     private final Profile profile;
     private final String movieId;
-    private final String time;
 
     /**
      * コンバータを構築します.
@@ -37,7 +36,7 @@ public class Converter extends AbstractCommand implements Callable<Boolean> {
      * @param listener
      * @param flag
      */
-    public Converter(String url, String time, Profile profile,
+    public Converter(String url, Profile profile,
             TextProgressListener listener, ConvertStopFlag flag) {
         super(listener, flag);
 
@@ -52,7 +51,6 @@ public class Converter extends AbstractCommand implements Callable<Boolean> {
             throw new IllegalArgumentException("URL/IDの指定が不正です: " + url);
         }
 
-        this.time = time;
         this.profile = profile;
     }
 
@@ -165,7 +163,7 @@ public class Converter extends AbstractCommand implements Callable<Boolean> {
                 profile.getCommentSetting());
 
         fi = FileInstanciator.create(getStopFlag(), videoType, commentType, tcommType, profile.getLoginInfo(), profile.
-                getProxySetting(), movieId, time);
+                getProxySetting(), movieId, profile.getCommentSetting().getBackLogPoint());
         return fi;
     }
 
index 7870bb8..0e164fb 100644 (file)
@@ -14,17 +14,19 @@ public class InputFileSetting implements yukihane.saccubus.converter.profile.Inp
     private final boolean download;
     private final boolean delete;
     private final CommentGetInfo commentGetInfo;
+    private final String backLogPoint;
 
     /**
      * @param file 対象ファイル.
      * @param download ダウンロードする必要があればtrue, ローカルファイルを用いるのであればfalse.
      * @param delete 変換後にファイルを削除するのであればtrue, 残したままにするのであればfalse.
      */
-    public InputFileSetting(SFile file, boolean download, boolean delete, CommentGetInfo cominfo) {
+    public InputFileSetting(SFile file, boolean download, boolean delete, CommentGetInfo cominfo, String backLogPoint) {
         this.file = file;
         this.download = download;
         this.delete = delete;
         this.commentGetInfo = cominfo;
+        this.backLogPoint = backLogPoint;
     }
 
     @Override
@@ -55,4 +57,9 @@ public class InputFileSetting implements yukihane.saccubus.converter.profile.Inp
     public boolean isReduceComment() {
         return commentGetInfo.isReduceComment();
     }
+
+    @Override
+    public String getBackLogPoint() {
+        return backLogPoint;
+    }
 }
index e2f7fb1..21111d1 100644 (file)
@@ -79,7 +79,7 @@ public class Prompt {
             throw new IOException(e);
         }
 
-        Converter conv = new Converter("dummy", "", profile, tpl, new ConvertStopFlag(scl));
+        Converter conv = new Converter("dummy", profile, tpl, new ConvertStopFlag(scl));
         ExecutorService es = Executors.newSingleThreadExecutor();
         Future<Boolean> future = es.submit((Callable<Boolean>) conv);
         try {
@@ -139,9 +139,9 @@ public class Prompt {
 
         FfmpegOption newFfmpegOption = new FfmpegOption(ffmpeg.getFfmpegOption().getExtOption(), "", "", ff, "", false,
                 "", "", false);
-        InputFileSetting newVideoSetting = new InputFileSetting(new SFile(true, new File(video)), false, false, commentGetInfo);
-        InputFileSetting newCommentSetting = new InputFileSetting(new SFile(true, new File(comm)), false, false, commentGetInfo);
-        InputFileSetting newTcommentSetting = new InputFileSetting(new SFile(true, new File(tcomm)), false, false, commentGetInfo);
+        InputFileSetting newVideoSetting = new InputFileSetting(new SFile(true, new File(video)), false, false, commentGetInfo, "");
+        InputFileSetting newCommentSetting = new InputFileSetting(new SFile(true, new File(comm)), false, false, commentGetInfo, "");
+        InputFileSetting newTcommentSetting = new InputFileSetting(new SFile(true, new File(tcomm)), false, false, commentGetInfo, "");
         OutputFileSetting newOutputFileSetting = new OutputFileSetting(new SFile(true, new File(output)), true, false,
                 true, true);
         Ffmpeg newFfmpeg = new Ffmpeg(ffmpeg.getFfmpeg(), ffmpeg.getVhook(), newFfmpegOption, ffmpeg.isVhookDisabled(), ffmpeg.
@@ -163,7 +163,7 @@ public class Prompt {
         String tag = args[2];
         String time = args.length < 4 ? "" : args[3];
         SProperties setting = SProperties.loadSetting(mail, pass);
-        Converter conv = new Converter(tag, time, setting.toProfile(), TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag(
+        Converter conv = new Converter(tag, setting.toProfile(), TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag(
                 ConvertStopFlag.StateChangeListener.EMPTY_LISTENER));
         System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
         System.out.println("Saccubus on CUI");
index 8b52e05..69b7eb4 100644 (file)
@@ -27,13 +27,15 @@ public class InputCommentSetting extends InputFileSetting<Boolean> {
     private final boolean selfAdjustNumOfComment;
     private final int numOfComment;
     private final boolean reduceComment;
+    private final String backLogPoint;
 
     public InputCommentSetting(boolean download, boolean autoNaming, File folder, File file, boolean deleteAfterConvert,
-            boolean adjust, int numOfCom, boolean reduceComment) {
+            boolean adjust, int numOfCom, boolean reduceComment, String backLogPoint) {
         super(Boolean.valueOf(download), autoNaming, folder, file, deleteAfterConvert);
         this.selfAdjustNumOfComment = adjust;
         this.numOfComment = numOfCom;
         this.reduceComment = reduceComment;
+        this.backLogPoint = backLogPoint;
     }
 
     @Override
@@ -59,7 +61,7 @@ public class InputCommentSetting extends InputFileSetting<Boolean> {
 
         return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete,
                 adjustNumOfComment,
-                Integer.parseInt(numOfComment), false);
+                Integer.parseInt(numOfComment), false, "");
     }
 
     public final boolean isSelfAdjustNumOfComment() {
@@ -73,4 +75,8 @@ public class InputCommentSetting extends InputFileSetting<Boolean> {
     public boolean isReduceComment(){
         return reduceComment;
     }
+
+    public String getBackLogPoint() {
+        return backLogPoint;
+    }
 }
index a2117e0..66ab194 100644 (file)
@@ -143,7 +143,7 @@ public class SProperties {
             boolean delete = setting.isDeleteAfterConvert() && (setting.getProcessKind() != VideoSaveKind.NICOBROWSER);
 
             return new InputFileSetting(videoFile, (setting.getProcessKind() == VideoSaveKind.SAVE), delete,
-                    buildCommentGetInfo());
+                    buildCommentGetInfo(), inputCommentSetting.getBackLogPoint());
         }
 
         private InputFileSetting buildCommentSetting() {
@@ -164,7 +164,7 @@ public class SProperties {
             SFile file = createSFile(setting);
 
             return new InputFileSetting(file, setting.getProcessKind().booleanValue(), setting.isDeleteAfterConvert(),
-                    buildCommentGetInfo());
+                    buildCommentGetInfo(), inputCommentSetting.getBackLogPoint());
 
         }
 
index edbc476..c1a65cb 100644 (file)
@@ -11,4 +11,8 @@ public interface CommentProfile extends InputFileSetting {
     int getBackComment();
 
     boolean isReduceComment();
+
+    // TODO 戻り値はlongにする
+    /** @過去ログを取得する時点 */
+    String getBackLogPoint();
 }
index 487255d..6b2459c 100644 (file)
@@ -45,7 +45,7 @@ public class ConverterTest {
         };
         ConvertStopFlag flag = new ConvertStopFlag(ConvertStopFlag.StateChangeListener.EMPTY_LISTENER);
 
-        Converter conv = new Converter("sm7139747", null, null, listener, flag);
+        Converter conv = new Converter("sm7139747", null, listener, flag);
         conv.call();
     }
 //    /**