Skip to content

Commit

Permalink
Merge pull request #1073 from ImMohammad20000/fix-hiddify
Browse files Browse the repository at this point in the history
Fix: subscription display in Hiddify
  • Loading branch information
SaintShit authored Jul 3, 2024
2 parents 987c16d + 6a434d5 commit ded483b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/views/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
from app import app
from app.db import Session, crud, get_db
from app.models.user import UserResponse
from app.subscription.share import encode_title, generate_subscription
from app.templates import render_template
from app.utils.jwt import get_subscription_payload
from app.subscription.share import encode_title, generate_subscription
from config import (
SUB_PROFILE_TITLE,
SUB_SUPPORT_URL,
SUB_UPDATE_INTERVAL,
SUBSCRIPTION_PAGE_TEMPLATE,
XRAY_SUBSCRIPTION_PATH,
USE_CUSTOM_JSON_DEFAULT,
USE_CUSTOM_JSON_FOR_STREISAND,
USE_CUSTOM_JSON_FOR_V2RAYN,
USE_CUSTOM_JSON_FOR_V2RAYNG,
USE_CUSTOM_JSON_FOR_STREISAND
XRAY_SUBSCRIPTION_PATH
)


Expand Down Expand Up @@ -192,8 +192,8 @@ def get_subscription_user_info(user: UserResponse) -> dict:
return {
"upload": 0,
"download": user.used_traffic,
"total": user.data_limit,
"expire": user.expire,
"total": user.data_limit if user.data_limit is not None else 0,
"expire": user.expire if user.expire is not None else 0,
}

sub = get_subscription_payload(token)
Expand All @@ -218,7 +218,6 @@ def get_subscription_user_info(user: UserResponse) -> dict:
"subscription-userinfo": "; ".join(
f"{key}={val}"
for key, val in get_subscription_user_info(user).items()
if val is not None
)
}

Expand Down

0 comments on commit ded483b

Please sign in to comment.