OSDN Git Service

コミット漏れ
[coroid/inqubus.git] / frontend / src / saccubus / MainFrame.java
index cc64289..d50d5d4 100644 (file)
@@ -18,6 +18,7 @@ import java.awt.event.KeyEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.io.File;
+import java.util.concurrent.FutureTask;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.BorderFactory;
@@ -57,6 +58,8 @@ import saccubus.properties.MovieSetting;
 import saccubus.properties.OutputVideoSetting;
 import saccubus.util.FileDropTarget;
 import saccubus.util.PopupRightClick;
+import saccubus.util.WayBackTimeParser;
+import yukihane.Util;
 import yukihane.nicovideo.NicoDBFinder;
 
 /**
@@ -927,6 +930,7 @@ public class MainFrame extends JFrame {
                 if (info != null) {
                     url = info.getNicoId();
                 } else {
+                    // TODO これはダメ…だけどそのうちこの処理自体削除になる
                     url = "";
                 }
             } catch (Exception ex) {
@@ -967,10 +971,12 @@ public class MainFrame extends JFrame {
             }
         };
 
-        Converter = new Converter(url, wayBackField.getText(), getSetting().toProfile(), sl,
+        final String id = Util.getVideoId(url);
+        Converter = new Converter(id, getSetting().toProfile(), sl,
                 new ConvertStopFlag(scl));
         doButton.setText(DoButtonStopString);
-        new Thread(Converter).start();
+        FutureTask<Boolean> task = new FutureTask<Boolean>(Converter);
+        new Thread(task).start();
 
     }
 
@@ -1389,8 +1395,15 @@ public class MainFrame extends JFrame {
         String folder = savePanel.getCommentSavedFolderField().getText();
         boolean adjustNumOfCom = savePanel.getFixCommentNumCheckBox().isSelected();
 
+        final String txt = wayBackField.getText();
+        long backLogPoint;
+        try {
+            backLogPoint = (StringUtils.isNotBlank(txt)) ? WayBackTimeParser.parse(txt) : -1;
+        } catch (IOException ex) {
+            backLogPoint = -1;
+        }
         return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, adjustNumOfCom,
-                back_comment, reduceCommentCheckBox.isSelected());
+                back_comment, reduceCommentCheckBox.isSelected(), backLogPoint);
     }
 
     /**