* @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;
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("\89½\82à\82·\82é\82±\82Æ\82ª\82 \82è\82Ü\82¹\82ñ");
return;
}
}
}
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("")
}
VideoTitle = client.getVideoTitle();
}
- if (Setting.isSaveVideo()) {
+ if (Setting.getVideoSaveKind() == VideoSaveKind.SAVE) {
if (Setting.isVideoFixFileName()) {
Setting.getVideoFixFileNameFolder().mkdir();
VideoFile = new File(Setting.getVideoFixFileNameFolder(),
}
} else {
if (Setting.isSaveConverted()) {
- if (Setting.isVideoFixFileName()) {
- if(!detectVideoTitle(Setting.getVideoFixFileNameFolder())){
- Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\91¶\8dÝ\82µ\82Ü\82¹\82ñ\81B");
- return;
- }
- VideoFile = new File(Setting
- .getVideoFixFileNameFolder(), VideoID
- + VideoTitle + ".flv");
- if (!VideoFile.canRead()) {
- Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\93Ç\82Ý\8d\9e\82ß\82Ü\82¹\82ñ\81B");
- return;
- }
- } else {
- VideoFile = Setting.getVideoFile();
- if (!VideoFile.exists()) {
- Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\91¶\8dÝ\82µ\82Ü\82¹\82ñ\81B");
- return;
- }
- }
- }
+ if (Setting.getVideoSaveKind() == VideoSaveKind.NO_SAVE) {
+ if (Setting.isVideoFixFileName()) {
+ if (!detectVideoTitle(Setting.getVideoFixFileNameFolder())) {
+ Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\91¶\8dÝ\82µ\82Ü\82¹\82ñ\81B");
+ return;
+ }
+ VideoFile = new File(Setting.getVideoFixFileNameFolder(), VideoID
+ + VideoTitle + ".flv");
+ if (!VideoFile.canRead()) {
+ Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\93Ç\82Ý\8d\9e\82ß\82Ü\82¹\82ñ\81B");
+ return;
+ }
+ } else {
+ VideoFile = Setting.getVideoFile();
+ if (!VideoFile.exists()) {
+ Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\91¶\8dÝ\82µ\82Ü\82¹\82ñ\81B");
+ return;
+ }
+ }
+ } else if (Setting.getVideoSaveKind() == VideoSaveKind.NICOBROWSER) {
+ VideoFile = Setting.getVideoFile();
+ if (!VideoFile.isFile()) {
+ Status.setText("\93®\89æ\83t\83@\83C\83\8b\82ª\91¶\8dÝ\82µ\82Ü\82¹\82ñ\81B");
+ return;
+ }
+ }
+ }
}
if (stopFlagReturn()) {