JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10.03.2015, 15:10
thetoad thetoad is offline
Tornado
 
Join Date: Jan 2014
Posts: 229
Default add "actual" traffic left to fileparadox's account detail

Now that fileparadox is now marked as unlimited traffic if there's any traffic available, this patch provides the "Actual" traffic available (As reported by FP) in the detail window.

thoughts?

Code:
Index: src/jd/plugins/AccountInfo.java
===================================================================
--- src/jd/plugins/AccountInfo.java	(revision 29478)
+++ src/jd/plugins/AccountInfo.java	(working copy)
@@ -30,24 +30,25 @@
 
 public class AccountInfo extends Property {
 
-    private static final long serialVersionUID       = 1825140346023286206L;
+    private static final long serialVersionUID          = 1825140346023286206L;
 
-    private long              account_validUntil     = -1;
+    private long              account_validUntil        = -1;
 
-    private long              account_trafficLeft    = -1;
-    private long              account_trafficMax     = -1;
+    private long              account_actualTrafficLeft = -1;
+    private long              account_trafficLeft       = -1;
+    private long              account_trafficMax        = -1;
 
-    private long              account_filesNum       = -1;
-    private long              account_premiumPoints  = -1;
-    private long              account_accountBalance = -1;
-    private long              account_usedSpace      = -1;
+    private long              account_filesNum          = -1;
+    private long              account_premiumPoints     = -1;
+    private long              account_accountBalance    = -1;
+    private long              account_usedSpace         = -1;
 
     private String            account_status;
-    private long              account_createTime     = 0;
+    private long              account_createTime        = 0;
     /**
      * indicator that host, account has special traffic handling, do not temp disable if traffic =0
      */
-    private boolean           specialTraffic         = false;
+    private boolean           specialTraffic            = false;
 
     public long getCreateTime() {
         return account_createTime;
@@ -109,6 +110,10 @@
         return Math.max(getTrafficLeft(), account_trafficMax);
     }
 
+    public long getActualTrafficLeft() {
+        return account_actualTrafficLeft;
+    }
+
     /**
      * Gibt zurück wieviel Platz (bytes) die Oploads auf diesem Account belegen
      * 
@@ -179,6 +184,10 @@
         this.account_trafficLeft = Math.max(0, size);
     }
 
+    public void setActualTrafficLeft(long size) {
+        this.account_actualTrafficLeft = size;
+    }
+
     public void setUnlimitedTraffic() {
         account_trafficLeft = -1;
     }
@@ -191,6 +200,10 @@
         this.setTrafficLeft(SizeFormatter.getSize(freeTraffic, true, true));
     }
 
+    public void setActualTrafficLeft(final String actualFreeTraffic) {
+        this.setActualTrafficLeft(SizeFormatter.getSize(actualFreeTraffic, true, true));
+    }
+
     public void setTrafficMax(final long trafficMax) {
         this.account_trafficMax = Math.max(0, trafficMax);
     }
Index: src/jd/plugins/hoster/FileparadoxIn.java
===================================================================
--- src/jd/plugins/hoster/FileparadoxIn.java	(revision 29478)
+++ src/jd/plugins/hoster/FileparadoxIn.java	(working copy)
@@ -808,6 +808,7 @@
              * any filesize: https://board.jdownloader.org/showthread.php?t=62600
              */
             final long trafficLeftLong = SizeFormatter.getSize(availabletraffic, true, true);
+            ai.setActualTrafficLeft(trafficLeftLong);
             if (trafficLeftLong > 0) {
                 ai.setUnlimitedTraffic();
             } else {
@@ -1163,6 +1164,9 @@
         if (ai.getPremiumPoints() != -1) {
             message += "Premium Points: " + ai.getPremiumPoints() + "\r\n";
         }
+        if (ai.getActualTrafficLeft() != -1) {
+            message += "Actual Traffic Left: " + Formatter.formatReadable(ai.getActualTrafficLeft()) + "\r\n";
+        }
 
         jd.gui.UserIO.getInstance().requestMessageDialog(this.getHost() + " Account", message);
     }
Reply With Quote
  #2  
Old 10.03.2015, 15:11
thetoad thetoad is offline
Tornado
 
Join Date: Jan 2014
Posts: 229
Default

and presumably the serialVersionUID should be updated to?
Reply With Quote
  #3  
Old 10.03.2015, 16:53
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 56,494
Default

Hi
Please send me the FULL source via PM then I'll release it
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #4  
Old 10.03.2015, 18:09
thetoad thetoad is offline
Tornado
 
Join Date: Jan 2014
Posts: 229
Default

what do you mean full source? (more than the patch above?)
Reply With Quote
  #5  
Old 10.03.2015, 18:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 69,349
Default

Can you please send us a contributer agreement (see end of http://jdownloader.org/knowledge/wik...nt/get-started) via email, then we can give you write access.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #6  
Old 10.03.2015, 18:19
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 56,494
Default

That would be even better
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #7  
Old 22.03.2015, 03:34
thetoad thetoad is offline
Tornado
 
Join Date: Jan 2014
Posts: 229
Default

sent
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 09:23.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.