From 76d697ed8859b73ca4a072f2eafd7169dfe81717 Mon Sep 17 00:00:00 2001 From: coalado Date: Thu, 28 May 2009 18:37:43 +0000 Subject: [PATCH] git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@5911 ebf7c1c2-ba36-0410-9fe8-c592906822b4 --- src/jd/controlling/AccountController.java | 10 +++++++++- src/jd/plugins/Account.java | 17 +++++++++++++++-- src/jd/plugins/host/Rapidshare.java | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/jd/controlling/AccountController.java b/src/jd/controlling/AccountController.java index e2c458b3d5..7ac7bbee9c 100644 --- a/src/jd/controlling/AccountController.java +++ b/src/jd/controlling/AccountController.java @@ -322,7 +322,11 @@ public class AccountController extends SubConfiguration implements ActionListene } public Account getValidAccount(PluginForHost pluginForHost) { - if (!JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_USE_GLOBAL_PREMIUM, true)) return null; + + if (!JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_USE_GLOBAL_PREMIUM, true)){ + logger.finest("Premium globally disabled") ; + return null; + } synchronized (hosteraccounts) { ArrayList accounts = new ArrayList(); accounts.addAll(provider.collectAccountsFor(pluginForHost)); @@ -332,6 +336,7 @@ public class AccountController extends SubConfiguration implements ActionListene for (int i = 0; i < accounts.size(); i++) { Account next = accounts.get(i); if (!next.isTempDisabled() && next.isEnabled()) { + logger.finest("Found account "+next.getUser()) ; if (!this.broadcaster.fireEvent(new AccountControllerEvent(this, AccountControllerEvent.ACCOUNT_GET, pluginForHost.getHost(), next))) { ret = next; break; @@ -339,6 +344,9 @@ public class AccountController extends SubConfiguration implements ActionListene } } } + if(ret==null){ + logger.finest("No Account found") ; + } return ret; } } diff --git a/src/jd/plugins/Account.java b/src/jd/plugins/Account.java index 4281cf3f51..9e3f34569a 100644 --- a/src/jd/plugins/Account.java +++ b/src/jd/plugins/Account.java @@ -59,7 +59,15 @@ public class Account extends Property { } public boolean isTempDisabled() { - if (tempDisabled && (System.currentTimeMillis() - tmpDisabledTime) > this.getTmpDisabledInterval()) tempDisabled = false; + logger.finest(user + " tempDisabled: " + tempDisabled); + logger.finest(user + " tmpDisabledTime: " + tmpDisabledTime + " " + (System.currentTimeMillis() - tmpDisabledTime) + ">" + getTmpDisabledInterval()); + if (!tempDisabled) { + logger.finest(user + " ret: " + tempDisabled); + return false; + } + + if ((System.currentTimeMillis() - tmpDisabledTime) > this.getTmpDisabledInterval()) tempDisabled = false; + logger.finest(user + " ret: " + tempDisabled); return tempDisabled; } @@ -85,8 +93,13 @@ public class Account extends Property { } public void setTempDisabled(boolean tempDisabled) { - if (this.tempDisabled == tempDisabled) return; this.tmpDisabledTime = System.currentTimeMillis(); + if (tempDisabled) { + logger.finest("Account " + user + " disabled for " + tmpDisabledInterval + "ms"); + } else { + logger.finest("Account " + user + " free to use"); + } + if (this.tempDisabled == tempDisabled) return; this.tempDisabled = tempDisabled; } diff --git a/src/jd/plugins/host/Rapidshare.java b/src/jd/plugins/host/Rapidshare.java index fffb18c7a0..bb9c3e95b6 100644 --- a/src/jd/plugins/host/Rapidshare.java +++ b/src/jd/plugins/host/Rapidshare.java @@ -558,7 +558,7 @@ public class Rapidshare extends PluginForHost { } } - if(true) throw new PluginException(LinkStatus.ERROR_PREMIUM, "TEST", LinkStatus.VALUE_ID_PREMIUM_TEMP_DISABLE); + if(false) throw new PluginException(LinkStatus.ERROR_PREMIUM, "TEST", LinkStatus.VALUE_ID_PREMIUM_TEMP_DISABLE); if (downloadLink.getLinkType() == DownloadLink.LINKTYPE_CONTAINER) { if (Sniffy.hasSniffer()) throw new SnifferException(); }