OSDN Git Service

コメントと投稿者コメントを同一ファイルで取得する
authoryukihane <yukihane.feather@gmail.com>
Mon, 12 Sep 2011 05:54:07 +0000 (14:54 +0900)
committeryukihane <yukihane.feather@gmail.com>
Mon, 12 Sep 2011 05:54:07 +0000 (14:54 +0900)
frontend/src/saccubus/worker/impl/download/Download.java

index 682cc30..e9165ce 100644 (file)
@@ -5,7 +5,9 @@ import static saccubus.worker.impl.download.DownloadStatus.*;
 import java.io.File;
 import java.io.IOException;
 import java.util.Date;
+import java.util.EnumSet;
 import java.util.logging.Logger;
+import nicobrowser.DownloadCommentType;
 import nicobrowser.GetFlvResult;
 import nicobrowser.NamePattern;
 import nicobrowser.NicoHttpClient;
@@ -98,9 +100,14 @@ public class Download extends Worker<DownloadResult, DownloadProgress> {
             final String name = pattern.createFileName(videoId, true);
             final File file = new File(profile.getCommentProfile().getDir(), name);
 
-            commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentProfile().
-                    getLengthRelatedCommentSize(),
-                    profile.getCommentProfile().isDisablePerMinComment());
+            final EnumSet<DownloadCommentType> commentSet = EnumSet.of(DownloadCommentType.OWNER);
+            if(profile.getCommentProfile().isDisablePerMinComment()) {
+                commentSet.add(DownloadCommentType.COMMENT_OLD);
+            } else {
+                commentSet.add(DownloadCommentType.COMMENT);
+            }
+            commentFile = client.getCommentFile(vi, file.getPath(), commentSet, wbi, profile.getCommentProfile().
+                    getLengthRelatedCommentSize());
         } else {
             commentFile = profile.getCommentProfile().getLocalFile();
         }