* @author 未入力
* @version 1.0
*/
-public class Converter extends AbstractCommand implements Runnable, Callable<Boolean> {
+public class Converter extends AbstractCommand implements Callable<Boolean> {
private final Profile profile;
private final String movieId;
- private final String time;
/**
* コンバータを構築します.
* @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);
throw new IllegalArgumentException("URL/IDの指定が不正です: " + url);
}
- this.time = time;
this.profile = profile;
}
+ @Override
public Boolean call() throws Exception {
boolean result = false;
try {
return Boolean.valueOf(result);
}
+ // TODO Runnableを実装しなくなったので削除する
public void run() {
try {
call();
File tcommFile = fi.getTcommFile(getListener());
- if (!profile.needsConvert()) {
+ if (!profile.getOutputFileSetting().isConvert()) {
sendText("動画・コメントを保存し、変換は行いませんでした。");
return true;
}
FileInstanciator.InstanciationType videoType = new FileInstanciator.InstanciationType(profile.getVideoSetting());
FileInstanciator.CommentInstanciationType commentType = new FileInstanciator.CommentInstanciationType(profile.
- getCommentSetting(), profile.getCommentGetInfo().isSelfAdjustCommentNum(), profile.getCommentGetInfo().
- getBackComment(), profile.getCommentGetInfo().isReduceComment());
+ getCommentSetting(), profile.getCommentSetting().isSelfAdjustCommentNum(), profile.getCommentSetting().
+ getBackComment(), profile.getCommentSetting().isReduceComment());
FileInstanciator.InstanciationType tcommType = new FileInstanciator.InstanciationType(
- profile.getTcommentSetting());
+ profile.getCommentSetting());
fi = FileInstanciator.create(getStopFlag(), videoType, commentType, tcommType, profile.getLoginInfo(), profile.
- getProxySetting(), movieId, time);
+ getProxySetting(), movieId, profile.getCommentSetting().getBackLogPoint());
return fi;
}
* @throws IllegalArgumentException 設定に不備がある場合.
*/
private void validSetting() {
- if (profile.needsConvert()) {
+ if (profile.getOutputFileSetting().isConvert()) {
File a = profile.getFfmpeg().getFfmpeg();
if (!a.canRead()) {
throw new IllegalArgumentException("FFmpegが見つかりません。");
/** @return 何かダウンロードするものがあればtrue. */
private static boolean needsDownload(Profile profile) {
- return (profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload() || profile.
- getTcommentSetting().isDownload());
+ return (profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload());
}
}