From 474555974e6af927798373c7893f7afc9f1c9176 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 28 Feb 2013 16:27:44 +0100 Subject: closed #25 --- module/plugins/accounts/PremiumizeMe.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 768fcd783..07187f908 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -4,7 +4,7 @@ from module.common.json_layer import json_loads class PremiumizeMe(Account): __name__ = "PremiumizeMe" - __version__ = "0.1" + __version__ = "0.11" __type__ = "account" __description__ = """Premiumize.Me account plugin""" @@ -15,10 +15,14 @@ class PremiumizeMe(Account): # Get user data from premiumize.me status = self.getAccountStatus(user, req) + self.logDebug("Api Result: " + status) # Parse account info account_info = {"validuntil": float(status['result']['expires']), - "trafficleft": status['result']['trafficleft_bytes'] / 1024} + "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} + + if status['result']['type'] == 'free': + account_info['premium'] = False return account_info -- cgit v1.2.3