boolean adjustNumOfCom = savePanel.getFixCommentNumCheckBox().isSelected();
return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, adjustNumOfCom,
- back_comment);
+ back_comment, reduceCommentCheckBox.isSelected());
}
/**
FileInstanciator.CommentInstanciationType commentType = new FileInstanciator.CommentInstanciationType(Setting.
getCommentSetting(), Setting.getCommentGetInfo().isSelfAdjustCommentNum(), Setting.getCommentGetInfo().
- getBackComment());
+ getBackComment(), Setting.getCommentGetInfo().isReduceComment());
FileInstanciator.InstanciationType tcommType = new FileInstanciator.InstanciationType(
Setting.getTcommentSetting());
private final boolean autoCommentNum;
private final int backComment;
+ private final boolean reduceComment;
private final CommentInfo commentInfo;
- CommentFileWebGetter(NicoClient client, VideoInfo vi, CommentInfo ci, boolean autoCommentNum, int backComment) {
+ CommentFileWebGetter(NicoClient client, VideoInfo vi, CommentInfo ci, boolean autoCommentNum, int backComment, boolean reduceComment) {
super(client, vi);
this.autoCommentNum = autoCommentNum;
this.backComment = backComment;
+ this.reduceComment = reduceComment;
this.commentInfo = ci;
}
com = backComment;
}
- File res = getClient().getComment(getVideoInfo(), getCommentInfo(), file, listener, com);
+ File res = getClient().getComment(getVideoInfo(), getCommentInfo(), file, listener, com, reduceComment);
if (res == null) {
throw new IOException("コメントファイルのダウンロードに失敗しました。");
}
private final boolean autoCommentNum;
private final int backComment;
+ private final boolean reduceComment;
- public CommentInstanciationType(InputFileSetting fileSetting, boolean autoCommentNum, int backComment) {
+ public CommentInstanciationType(InputFileSetting fileSetting, boolean autoCommentNum, int backComment,
+ boolean reduceComment) {
super(fileSetting);
this.autoCommentNum = autoCommentNum;
this.backComment = backComment;
+ this.reduceComment = reduceComment;
}
public boolean isAutoCommentNum() {
public int getBackComment() {
return backComment;
}
+
+ boolean isReduceComment() {
+ return reduceComment;
+ }
}
}
if (commentType.isDownload()) {
setCommentFileGetter(new CommentFileWebGetter(client, videoInfo, commentInfo, commentType.isAutoCommentNum(),
- commentType.getBackComment()));
+ commentType.getBackComment(), commentType.isReduceComment()));
}
if (tcommType.isDownload()) {
private final boolean selfAdjustCommentNum;
/** コメント取得数を自動調整しない場合の取得数. */
private final int backComment;
+ /** 旧仕様(2010年末までバージョン)でコメントを取得する場合はtrue. */
+ private final boolean reduceComment;
- public CommentGetInfo(boolean selfAdjustCommentNum, int backComment) {
+ public CommentGetInfo(boolean selfAdjustCommentNum, int backComment, boolean reduceComment) {
this.selfAdjustCommentNum = selfAdjustCommentNum;
this.backComment = backComment;
+ this.reduceComment = reduceComment;
}
public boolean isSelfAdjustCommentNum() {
public int getBackComment() {
return backComment;
}
+
+ public boolean isReduceComment() {
+ return reduceComment;
+ }
}
File getVideo(VideoInfo videoInfo, File file, TextProgressListener listener);
- File getComment(VideoInfo videoInfo, CommentInfo commentInfo, File file, TextProgressListener listener, int com);
+ File getComment(VideoInfo videoInfo, CommentInfo commentInfo, File file, TextProgressListener listener,
+ int com, boolean reduceComment);
File getTcomment(VideoInfo videoInfo, File file, TextProgressListener listener);
}
* <p>
* 会社名:
* </p>
- *
+ * @deprecated 2011/2 以降のコメントダウンロード仕様には対応していません.
* @author 未入力
* @version 1.0
*/
+@Deprecated
public class NicoClientImpl implements NicoClient {
private String Cookie = null;
StopFlag = flag;
}
+ /**
+ * @deprecated reduceComment は無視されます(常にtrueの動作をします).
+ */
@Override
- public File getComment(VideoInfo vi, CommentInfo ci, final File file, final TextProgressListener status, int back_comment) {
+ public File getComment(VideoInfo vi, CommentInfo ci, final File file, final TextProgressListener status,
+ int back_comment, boolean reduceComment) {
return downloadComment(back_comment, file, vi, ci, status, false);
}
return downloadComment(back_comment, file, vi, null, status, isTcomm);
}
- private File downloadComment(int back_comment, final File file, VideoInfo vi, CommentInfo ci, final TextProgressListener status,
+ private File downloadComment(int back_comment, final File file, VideoInfo vi, CommentInfo ci,
+ final TextProgressListener status,
boolean isTcomm) throws NumberFormatException {
System.out.print("Downloading comment size:" + back_comment + "...");
try {
private static final String PROP_COMMENT_FILE = "CommentFile";
private final boolean selfAdjustNumOfComment;
private final int numOfComment;
+ private final boolean reduceComment;
public InputCommentSetting(boolean download, boolean autoNaming, File folder, File file, boolean deleteAfterConvert,
- boolean adjust, int numOfCom) {
+ boolean adjust, int numOfCom, boolean reduceComment) {
super(Boolean.valueOf(download), autoNaming, folder, file, deleteAfterConvert);
this.selfAdjustNumOfComment = adjust;
this.numOfComment = numOfCom;
+ this.reduceComment = reduceComment;
}
+ @Override
public void save(Properties prop) {
prop.setProperty(PROP_SAVE_COMMENT, getProcessKind().toString());
prop.setProperty(PROP_DEL_COMMENT_AFTER_CONV, Boolean.toString(isDeleteAfterConvert()));
return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete,
adjustNumOfComment,
- Integer.parseInt(numOfComment));
+ Integer.parseInt(numOfComment), false);
}
public final boolean isSelfAdjustNumOfComment() {
public final int getNumOfComment() {
return numOfComment;
}
+
+ public boolean isReduceComment(){
+ return reduceComment;
+ }
}
private CommentGetInfo buildCommentGetInfo() {
final InputCommentSetting setting = getInputCommentSetting();
- return new CommentGetInfo(setting.isSelfAdjustNumOfComment(), setting.getNumOfComment());
+ return new CommentGetInfo(setting.isSelfAdjustNumOfComment(), setting.getNumOfComment(), setting.isReduceComment());
}
private InputFileSetting buildTcommentSetting() {
@Override
public File getComment(VideoInfo videoInfo, CommentInfo commentInfo, File file, TextProgressListener listener,
- int commentNum) {
+ int commentNum, boolean reduceComment) {
try {
final WayBackInfo wbi = (commentInfo != null) ? new WayBackInfo(commentInfo.getWayBackKey(), commentInfo.
getWayBackTime()) : null;
- return client.getCommentFile(nicoBrowserVi, file.getPath(), wbi, commentNum);
+ return client.getCommentFile(nicoBrowserVi, file.getPath(), wbi, commentNum, reduceComment);
} catch (Exception ex) {
logger.log(Level.SEVERE, "コメント取得失敗", ex);
}