X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=frontend%2Fsrc%2Fsaccubus%2FConverter.java;h=f630148867db917550e6ace7ff58066d8e4d22f5;hb=f2b23e9cc9878a47ff3593096798e71add2abf1d;hp=48163f00b09476258a7b46f6165093719cc0f7d5;hpb=7d99109cc8fe2e19468317590a6d47222b03471c;p=coroid%2Finqubus.git diff --git a/frontend/src/saccubus/Converter.java b/frontend/src/saccubus/Converter.java index 48163f0..f630148 100644 --- a/frontend/src/saccubus/Converter.java +++ b/frontend/src/saccubus/Converter.java @@ -22,15 +22,15 @@ import yukihane.swf.Cws2Fws; * @version 1.0 */ public class Converter extends Thread { - private ConvertingSetting Setting; + private final ConvertingSetting Setting; - private String Tag; + private final String Tag; - private String VideoID; + private final String VideoID; private String VideoTitle; - private String Time; + private final String Time; private JLabel Status; @@ -67,11 +67,12 @@ public class Converter extends Thread { private File CommentMiddleFile = null; + @Override public void run() { boolean converted = false; try { if (!Setting.isSaveConverted() && !Setting.isSaveComment() - && !Setting.isSaveVideo()) { + && (Setting.getVideoSaveKind() != VideoSaveKind.SAVE)) { Status.setText("‰½‚à‚·‚邱‚Æ‚ª‚ ‚è‚Ü‚¹‚ñ"); return; } @@ -110,7 +111,7 @@ public class Converter extends Thread { } } NicoClient client = null; - if (Setting.isSaveVideo() || Setting.isSaveComment()) { + if ((Setting.getVideoSaveKind() == VideoSaveKind.SAVE) || Setting.isSaveComment()) { if (Setting.getMailAddress() == null || Setting.getPassword() == null || Setting.getMailAddress().equals("") @@ -159,7 +160,7 @@ public class Converter extends Thread { } VideoTitle = client.getVideoTitle(); } - if (Setting.isSaveVideo()) { + if (Setting.getVideoSaveKind() == VideoSaveKind.SAVE) { if (Setting.isVideoFixFileName()) { Setting.getVideoFixFileNameFolder().mkdir(); VideoFile = new File(Setting.getVideoFixFileNameFolder(), @@ -178,26 +179,33 @@ public class Converter extends Thread { } } else { if (Setting.isSaveConverted()) { - if (Setting.isVideoFixFileName()) { - if(!detectVideoTitle(Setting.getVideoFixFileNameFolder())){ - Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ü‚¹‚ñB"); - return; - } - VideoFile = new File(Setting - .getVideoFixFileNameFolder(), VideoID - + VideoTitle + ".flv"); - if (!VideoFile.canRead()) { - Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª“ǂݍž‚ß‚Ü‚¹‚ñB"); - return; - } - } else { - VideoFile = Setting.getVideoFile(); - if (!VideoFile.exists()) { - Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ü‚¹‚ñB"); - return; - } - } - } + if (Setting.getVideoSaveKind() == VideoSaveKind.NO_SAVE) { + if (Setting.isVideoFixFileName()) { + if (!detectVideoTitle(Setting.getVideoFixFileNameFolder())) { + Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ü‚¹‚ñB"); + return; + } + VideoFile = new File(Setting.getVideoFixFileNameFolder(), VideoID + + VideoTitle + ".flv"); + if (!VideoFile.canRead()) { + Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª“ǂݍž‚ß‚Ü‚¹‚ñB"); + return; + } + } else { + VideoFile = Setting.getVideoFile(); + if (!VideoFile.exists()) { + Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ü‚¹‚ñB"); + return; + } + } + } else if (Setting.getVideoSaveKind() == VideoSaveKind.NICOBROWSER) { + VideoFile = Setting.getVideoFile(); + if (!VideoFile.isFile()) { + Status.setText("“®‰æƒtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ü‚¹‚ñB"); + return; + } + } + } } if (stopFlagReturn()) {