import saccubus.properties.OutputVideoSetting;
import saccubus.util.FileDropTarget;
import saccubus.util.PopupRightClick;
+import saccubus.util.WayBackTimeParser;
import yukihane.nicovideo.NicoDBFinder;
/**
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(), wayBackField.getText());
+ back_comment, reduceCommentCheckBox.isSelected(), backLogPoint);
}
/**
private final boolean download;
private final boolean delete;
private final CommentGetInfo commentGetInfo;
- private final String backLogPoint;
+ private final long backLogPoint;
/**
* @param file 対象ファイル.
* @param download ダウンロードする必要があればtrue, ローカルファイルを用いるのであればfalse.
* @param delete 変換後にファイルを削除するのであればtrue, 残したままにするのであればfalse.
*/
- public InputFileSetting(SFile file, boolean download, boolean delete, CommentGetInfo cominfo, String backLogPoint) {
+ public InputFileSetting(SFile file, boolean download, boolean delete, CommentGetInfo cominfo, long backLogPoint) {
this.file = file;
this.download = download;
this.delete = delete;
}
@Override
- public String getBackLogPoint() {
+ public long getBackLogPoint() {
return backLogPoint;
}
}
InstanciationType tcommType,
LoinProfile li,
ProxyProfile proxy,
- String tag, String time) throws
+ String tag,
+ long time) throws
IOException {
FileInstanciator getter;
if (videoType.isDownload() || commentType.isDownload() || tcommType.isDownload()) {
LoinProfile li,
ProxyProfile proxy,
String tag,
- String time) throws IOException {
+ long time) throws IOException {
super(videoType, commentType, tcommType, tag);
if (li.getMail() == null || li.getPass() == null || li.getMail().equals("") || li.getPass().equals("")) {
try {
videoInfo = client.getVideoInfo(tag);
- if (StringUtils.isNotBlank(time)) {
+ if (time >= 0) {
System.out.print("Setting wayback time...");
- final long waybacktime = WayBackTimeParser.parse(time);
+ final long waybacktime = time;
String waybackkey = client.getWayBackKey(videoInfo);
commentInfo = new CommentInfo(waybackkey, waybacktime);
} else {
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, -1);
+ InputFileSetting newCommentSetting = new InputFileSetting(new SFile(true, new File(comm)), false, false, commentGetInfo, -1);
+ InputFileSetting newTcommentSetting = new InputFileSetting(new SFile(true, new File(tcomm)), false, false, commentGetInfo, -1);
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.
private final boolean selfAdjustNumOfComment;
private final int numOfComment;
private final boolean reduceComment;
- private final String backLogPoint;
+ private final long backLogPoint;
public InputCommentSetting(boolean download, boolean autoNaming, File folder, File file, boolean deleteAfterConvert,
- boolean adjust, int numOfCom, boolean reduceComment, String backLogPoint) {
+ boolean adjust, int numOfCom, boolean reduceComment, long backLogPoint) {
super(Boolean.valueOf(download), autoNaming, folder, file, deleteAfterConvert);
this.selfAdjustNumOfComment = adjust;
this.numOfComment = numOfCom;
return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete,
adjustNumOfComment,
- Integer.parseInt(numOfComment), false, "");
+ Integer.parseInt(numOfComment), false, -1);
}
public final boolean isSelfAdjustNumOfComment() {
return reduceComment;
}
- public String getBackLogPoint() {
+ public long getBackLogPoint() {
return backLogPoint;
}
}
boolean isReduceComment();
- // TODO 戻り値はlongにする
- /** @過去ログを取得する時点 */
- String getBackLogPoint();
+ /**
+ * @return 過去ログを取得する時点. 1970/1/1 00:00:00 GMT からの経過秒数(ミリ秒ではない).
+ * マイナス値指定の場合は過去ログ取得ではない.
+ */
+ long getBackLogPoint();
}