From db2e02c3279ccee6154dc5f465a683aab609a1ad Mon Sep 17 00:00:00 2001 From: yukihane Date: Sat, 20 Aug 2011 08:52:13 +0900 Subject: [PATCH] =?utf8?q?=E9=81=8E=E5=8E=BB=E3=83=AD=E3=82=B0=E5=8F=96?= =?utf8?q?=E5=BE=97=E6=99=82=E7=82=B9=E3=82=92Converter=E3=82=B3=E3=83=B3?= =?utf8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E5=BC=95=E6=95=B0?= =?utf8?q?=E3=81=8B=E3=82=89Profile=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- frontend/src/saccubus/MainFrame.java | 4 ++-- frontend/src/saccubus/converter/Converter.java | 6 ++---- .../saccubus/converter/classic/profile/InputFileSetting.java | 9 ++++++++- frontend/src/saccubus/prompt/Prompt.java | 10 +++++----- frontend/src/saccubus/properties/InputCommentSetting.java | 10 ++++++++-- frontend/src/saccubus/properties/SProperties.java | 4 ++-- .../yukihane/saccubus/converter/profile/CommentProfile.java | 4 ++++ frontend/test/saccubus/converter/ConverterTest.java | 2 +- 8 files changed, 32 insertions(+), 17 deletions(-) diff --git a/frontend/src/saccubus/MainFrame.java b/frontend/src/saccubus/MainFrame.java index ee6059b..5b7c34c 100644 --- a/frontend/src/saccubus/MainFrame.java +++ b/frontend/src/saccubus/MainFrame.java @@ -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 task = new FutureTask(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()); } /** diff --git a/frontend/src/saccubus/converter/Converter.java b/frontend/src/saccubus/converter/Converter.java index 2f7506e..84c934f 100644 --- a/frontend/src/saccubus/converter/Converter.java +++ b/frontend/src/saccubus/converter/Converter.java @@ -27,7 +27,6 @@ public class Converter extends AbstractCommand implements Callable { private final Profile profile; private final String movieId; - private final String time; /** * コンバータを構築します. @@ -37,7 +36,7 @@ public class Converter extends AbstractCommand implements Callable { * @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 { throw new IllegalArgumentException("URL/IDの指定が不正です: " + url); } - this.time = time; this.profile = profile; } @@ -165,7 +163,7 @@ public class Converter extends AbstractCommand implements Callable { profile.getCommentSetting()); fi = FileInstanciator.create(getStopFlag(), videoType, commentType, tcommType, profile.getLoginInfo(), profile. - getProxySetting(), movieId, time); + getProxySetting(), movieId, profile.getCommentSetting().getBackLogPoint()); return fi; } diff --git a/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java b/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java index 7870bb8..0e164fb 100644 --- a/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java +++ b/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java @@ -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; + } } diff --git a/frontend/src/saccubus/prompt/Prompt.java b/frontend/src/saccubus/prompt/Prompt.java index e2f7fb1..21111d1 100644 --- a/frontend/src/saccubus/prompt/Prompt.java +++ b/frontend/src/saccubus/prompt/Prompt.java @@ -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 future = es.submit((Callable) 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"); diff --git a/frontend/src/saccubus/properties/InputCommentSetting.java b/frontend/src/saccubus/properties/InputCommentSetting.java index 8b52e05..69b7eb4 100644 --- a/frontend/src/saccubus/properties/InputCommentSetting.java +++ b/frontend/src/saccubus/properties/InputCommentSetting.java @@ -27,13 +27,15 @@ public class InputCommentSetting extends InputFileSetting { 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 { 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 { public boolean isReduceComment(){ return reduceComment; } + + public String getBackLogPoint() { + return backLogPoint; + } } diff --git a/frontend/src/saccubus/properties/SProperties.java b/frontend/src/saccubus/properties/SProperties.java index a2117e0..66ab194 100644 --- a/frontend/src/saccubus/properties/SProperties.java +++ b/frontend/src/saccubus/properties/SProperties.java @@ -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()); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java b/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java index edbc476..c1a65cb 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java @@ -11,4 +11,8 @@ public interface CommentProfile extends InputFileSetting { int getBackComment(); boolean isReduceComment(); + + // TODO 戻り値はlongにする + /** @過去ログを取得する時点 */ + String getBackLogPoint(); } diff --git a/frontend/test/saccubus/converter/ConverterTest.java b/frontend/test/saccubus/converter/ConverterTest.java index 487255d..6b2459c 100644 --- a/frontend/test/saccubus/converter/ConverterTest.java +++ b/frontend/test/saccubus/converter/ConverterTest.java @@ -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(); } // /** -- 2.11.0