Skip to content

Commit

Permalink
*:fix get_sub_info_header
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Mar 4, 2024
1 parent eaf0b8a commit 5ab6943
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/sspanel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,17 @@ def get_sub_info_header(self, for_android=False):
https://github.com/crossutility/Quantumult/blob/master/extra-subscription-feature.md
"""
if for_android:
expire = self.level_expire_time.timestamp()
expire = int(self.level_expire_time.timestamp())
up = self.upload_traffic
down = self.download_traffic
total = self.total_traffic
info = f"upload={up}; download={down}; total={total}; expire={expire}"
else:
expire = self.level_expire_time.date().strftime("%Y-%m-%d")
info = f"u={traffic_format(self.upload_traffic)}; d={traffic_format(self.download_traffic)}; t={traffic_format(self.total_traffic)}; expire={expire}"
up = traffic_format(self.upload_traffic)
down = traffic_format(self.download_traffic)
total = traffic_format(self.total_traffic)
info = f"u={up}; d={down}; t={total}; expire={expire}"
return {"Subscription-Userinfo": info}

def reset_sub_uid(self):
Expand Down

0 comments on commit 5ab6943

Please sign in to comment.