fix: автодетект --cli в Bootstrap, отображение локальных сборок в JFX, обработка ошибок установки и друзей

This commit is contained in:
SashegDev
2026-06-30 13:44:26 +00:00
parent 0a2b80ed06
commit e49e630afe
10 changed files with 569 additions and 50 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ def parse_args():
parser.add_argument("--workers", type=int, default=1, help="Number of workers for production mode (default: 1, more causes file download slowdown)")
parser.add_argument("--reload", action="store_true", help="Enable auto-reload (development)")
return parser.parse_args()
return parser.parse_known_args()[0]
async def run_test_mode():
"""Validate all packs and generate/update manifests"""
+4 -4
View File
@@ -232,10 +232,10 @@ async def lifespan(app: FastAPI):
# ====================== MIRROR SYNC HELPERS ======================
async def _calculate_file_hash_async(file_path: Path) -> Optional[str]:
"""Calculate SHA256 hash of a file asynchronously"""
try:
loop = asyncio.get_running_loop()
async def _calculate_file_hash_async(file_path: Path) -> Optional[str]:
"""Calculate SHA256 hash of a file asynchronously"""
try:
loop = asyncio.get_running_loop()
def _hash():
h = hashlib.sha256()
with open(file_path, "rb") as f:
+4 -4
View File
@@ -48,9 +48,9 @@ async def sync_playtime(
else:
conn.execute(
"INSERT INTO playtime (user_id, pack_name, minutes) VALUES (?, ?, ?)",
(current_user["user_id"], req.pack_name, req.minutes)
(current_user["id"], req.pack_name, req.minutes)
)
logger.info("Playtime synced", user=current_user["user_id"], minutes=req.minutes)
logger.info("Playtime synced", user=current_user["id"], minutes=req.minutes)
return {"status": "ok"}
@router.get("/playtime/stats")
@@ -60,13 +60,13 @@ async def get_playtime_stats(current_user: dict = Depends(get_current_user)):
with get_db() as conn:
rows = conn.execute(
"SELECT COALESCE(SUM(minutes), 0) FROM playtime WHERE user_id = ?",
(current_user["user_id"],)
(current_user["id"],)
)
total_minutes = rows.fetchone()[0]
rows = conn.execute(
"SELECT pack_name, minutes FROM playtime WHERE user_id = ? AND pack_name != '' ORDER BY minutes DESC",
(current_user["user_id"],)
(current_user["id"],)
)
for row in rows:
pack_stats.append({