From daae806d02749e362de27b72985cf235aeb50ead Mon Sep 17 00:00:00 2001 From: ren Date: Mon, 16 Feb 2026 19:40:20 -0300 Subject: [PATCH] Fix MiniMax percentage calculation (API returns remaining, not used) --- dist/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index b6c8348..c84a8a5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -123,9 +123,11 @@ async function getMinimaxUsage() { const used = m.current_interval_usage_count; const total = m.current_interval_total_count; const pct = (used / total) * 100; + const isRemainingPct = pct > 50; + const finalPct = isRemainingPct ? 100 - pct : pct; const totalMinutes = remainingMinutes / (1 - used/total) || 0; - return { pct, remainingMinutes, totalMinutes, model: m.model_name, error: null }; + return { pct: finalPct, remainingMinutes, totalMinutes, model: m.model_name, error: null }; } catch (e) { return { pct: 0, remainingMinutes: 0, totalMinutes: 0, model: '?', error: e.message }; }