From 9d1c345deb9d2a4b957e2febbc996b651474dfba Mon Sep 17 00:00:00 2001 From: yukihane Date: Thu, 25 Aug 2011 09:34:14 +0900 Subject: [PATCH] =?utf8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A1=E3=82=A4?= =?utf8?q?=E3=83=AB=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=95=E3=82=A7=E3=83=BC?= =?utf8?q?=E3=82=B9=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E5=90=8D=E5=A4=89?= =?utf8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- frontend/src/saccubus/worker/Download.java | 36 +++++++++++----------- frontend/src/saccubus/worker/TestFrame.java | 8 ++--- .../saccubus/worker/classic/profile/Profile.java | 8 ++--- .../saccubus/worker/profile/DownloadProfile.java | 8 ++--- frontend/src/yukihane/inqubus/gui/MainFrame.java | 8 ++--- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/frontend/src/saccubus/worker/Download.java b/frontend/src/saccubus/worker/Download.java index b042604..c10d0a3 100644 --- a/frontend/src/saccubus/worker/Download.java +++ b/frontend/src/saccubus/worker/Download.java @@ -84,43 +84,43 @@ public class Download extends SwingWorker impl client = createClientAndLogin(); vi = client.getVideoInfo(videoId); - final String name = profile.getVideoSetting().getFileName(); - final String replaceFrom = profile.getGeneralSetting().getReplaceFrom(); - final String replaceTo = profile.getGeneralSetting().getReplaceTo(); + final String name = profile.getVideoProfile().getFileName(); + final String replaceFrom = profile.getGeneralProfile().getReplaceFrom(); + final String replaceTo = profile.getGeneralProfile().getReplaceTo(); videoNamePattern = new NamePattern(name, replaceFrom, replaceTo, vi.getTitleInWatchPage()); if (needsBackLog()) { final String key = client.getWayBackKey(vi); - wbi = new WayBackInfo(key, profile.getCommentSetting().getBackLogPoint()); + wbi = new WayBackInfo(key, profile.getCommentProfile().getBackLogPoint()); } } checkStop(); File commentFile; - if (profile.getCommentSetting().isDownload()) { - final CommentProfile prof = profile.getCommentSetting(); - final GeneralProfile gene = profile.getGeneralSetting(); + if (profile.getCommentProfile().isDownload()) { + final CommentProfile prof = profile.getCommentProfile(); + final GeneralProfile gene = profile.getGeneralProfile(); final NamePattern pattern = new NamePattern(prof.getFileName(), gene.getReplaceFrom(), gene.getReplaceTo(), vi.getTitleInWatchPage()); // TODO コメントファイルに{low}は使えないことをどこかに書くべきか final String name = pattern.createFileName(videoId, true); - final File file = new File(profile.getCommentSetting().getDir(), name); + final File file = new File(profile.getCommentProfile().getDir(), name); - commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentSetting(). + commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentProfile(). getLengthRelatedCommentSize(), - profile.getCommentSetting().isDisablePerMinComment()); + profile.getCommentProfile().isDisablePerMinComment()); } else { - commentFile = profile.getCommentSetting().getLocalFile(); + commentFile = profile.getCommentProfile().getLocalFile(); } checkStop(); File videoFile; GetFlvResult vf; - if (profile.getVideoSetting().isDownload()) { - vf = client.getFlvFile(vi, profile.getVideoSetting().getDir(), videoNamePattern, + if (profile.getVideoProfile().isDownload()) { + vf = client.getFlvFile(vi, profile.getVideoProfile().getDir(), videoNamePattern, Status.GET_INFO, true, new ProgressListener() { @Override @@ -132,7 +132,7 @@ public class Download extends SwingWorker impl videoFile = vf.getFile(); } else { - videoFile = profile.getVideoSetting().getLocalFile(); + videoFile = profile.getVideoProfile().getLocalFile(); } return new DownloadResult(true, videoFile, commentFile); @@ -167,7 +167,7 @@ public class Download extends SwingWorker impl /** @return 何かダウンロードするものがあればtrue. */ private static boolean needsDownload(DownloadProfile profile) { - return (profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload()); + return (profile.getVideoProfile().isDownload() || profile.getCommentProfile().isDownload()); } // TODO どこかに処理を移す必要がある. @@ -203,7 +203,7 @@ public class Download extends SwingWorker impl */ // TODO HttpException を投げるのをやめたい. コンパイル時にHttpComponentが必要になるので. private NicoHttpClient createClientAndLogin() throws IOException, InterruptedException, HttpException { - final NicoHttpClient client = createClient(profile.getProxySetting()); + final NicoHttpClient client = createClient(profile.getProxyProfile()); final boolean hasLogin; try { hasLogin = client.login(profile.getLoginInfo().getMail(), profile.getLoginInfo().getPassword()); @@ -226,12 +226,12 @@ public class Download extends SwingWorker impl /** @return ログインする必要があればtrue. */ private boolean needsLogin() { - return profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload(); + return profile.getVideoProfile().isDownload() || profile.getCommentProfile().isDownload(); } /** @return 過去ログ取得の必要があればtrue. */ private boolean needsBackLog() { - return profile.getCommentSetting().getBackLogPoint() >= 0L; + return profile.getCommentProfile().getBackLogPoint() >= 0L; } private void checkStop() throws InterruptedException { diff --git a/frontend/src/saccubus/worker/TestFrame.java b/frontend/src/saccubus/worker/TestFrame.java index 8e80277..aaf1c1f 100644 --- a/frontend/src/saccubus/worker/TestFrame.java +++ b/frontend/src/saccubus/worker/TestFrame.java @@ -185,7 +185,7 @@ public class TestFrame extends JFrame { } @Override - public ProxyProfile getProxySetting() { + public ProxyProfile getProxyProfile() { return new ProxyProfile() { @Override @@ -206,7 +206,7 @@ public class TestFrame extends JFrame { } @Override - public VideoProfile getVideoSetting() { + public VideoProfile getVideoProfile() { return new VideoProfile() { @Override @@ -232,7 +232,7 @@ public class TestFrame extends JFrame { } @Override - public CommentProfile getCommentSetting() { + public CommentProfile getCommentProfile() { return new CommentProfile() { @Override @@ -303,7 +303,7 @@ public class TestFrame extends JFrame { // }; // } @Override - public GeneralProfile getGeneralSetting() { + public GeneralProfile getGeneralProfile() { return new GeneralProfile() { @Override diff --git a/frontend/src/saccubus/worker/classic/profile/Profile.java b/frontend/src/saccubus/worker/classic/profile/Profile.java index 0793fe9..1a4cf86 100644 --- a/frontend/src/saccubus/worker/classic/profile/Profile.java +++ b/frontend/src/saccubus/worker/classic/profile/Profile.java @@ -44,17 +44,17 @@ public class Profile implements saccubus.worker.profile.DownloadProfile { } @Override - public Proxy getProxySetting(){ + public Proxy getProxyProfile(){ return loginInfo.getProxy(); } @Override - public VideoProfile getVideoSetting() { + public VideoProfile getVideoProfile() { return videoSetting; } @Override - public CommentProfile getCommentSetting() { + public CommentProfile getCommentProfile() { return commentSetting; } @@ -75,7 +75,7 @@ public class Profile implements saccubus.worker.profile.DownloadProfile { } @Override - public GeneralSetting getGeneralSetting() { + public GeneralSetting getGeneralProfile() { return generalSetting; } } diff --git a/frontend/src/saccubus/worker/profile/DownloadProfile.java b/frontend/src/saccubus/worker/profile/DownloadProfile.java index 948e327..1d4cfa9 100644 --- a/frontend/src/saccubus/worker/profile/DownloadProfile.java +++ b/frontend/src/saccubus/worker/profile/DownloadProfile.java @@ -10,11 +10,11 @@ public interface DownloadProfile { LoginProfile getLoginInfo(); - ProxyProfile getProxySetting(); + ProxyProfile getProxyProfile(); - VideoProfile getVideoSetting(); + VideoProfile getVideoProfile(); - CommentProfile getCommentSetting(); + CommentProfile getCommentProfile(); - GeneralProfile getGeneralSetting(); + GeneralProfile getGeneralProfile(); } diff --git a/frontend/src/yukihane/inqubus/gui/MainFrame.java b/frontend/src/yukihane/inqubus/gui/MainFrame.java index c701682..e985f49 100644 --- a/frontend/src/yukihane/inqubus/gui/MainFrame.java +++ b/frontend/src/yukihane/inqubus/gui/MainFrame.java @@ -584,22 +584,22 @@ public class MainFrame extends JFrame { } @Override - public ProxyProfile getProxySetting() { + public ProxyProfile getProxyProfile() { return this.proxyProfile; } @Override - public VideoProfile getVideoSetting() { + public VideoProfile getVideoProfile() { throw new UnsupportedOperationException("Not supported yet."); } @Override - public CommentProfile getCommentSetting() { + public CommentProfile getCommentProfile() { throw new UnsupportedOperationException("Not supported yet."); } @Override - public GeneralProfile getGeneralSetting() { + public GeneralProfile getGeneralProfile() { throw new UnsupportedOperationException("Not supported yet."); } } -- 2.11.0