country_mode in database/ payment options

This commit is contained in:
Vladless
2025-12-10 12:44:27 +03:00
parent 82c664fa68
commit 54c8b8cee9
10 changed files with 196 additions and 91 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.asyncio import AsyncSession
from config import USE_COUNTRY_SELECTION
from core.bootstrap import MODES_CONFIG
from database.models import Key, Server, User
@@ -17,7 +18,9 @@ async def import_keys_from_3xui_db(db_path: str, session: AsyncSession) -> tuple
imported = 0
skipped = 0
if USE_COUNTRY_SELECTION:
use_country_selection = bool(MODES_CONFIG.get("COUNTRY_SELECTION_ENABLED", USE_COUNTRY_SELECTION))
if use_country_selection:
result = await session.execute(
select(Server.server_name).where(Server.enabled.is_(True), Server.panel_type == "3x-ui")
)