From 7f5bbd6b08c4a005bcaf5176600e47cd814b608c Mon Sep 17 00:00:00 2001 From: jerem Date: Wed, 17 Jun 2026 11:50:13 +0200 Subject: [PATCH] =?UTF-8?q?Trackers:=20libell=C3=A9=20jetons=20unifi=C3=A9?= =?UTF-8?q?=20en=20"token"=20(torr9=20+=20tr4ker)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/integrations/trackers.py | 5 ++--- dev/preview.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/integrations/trackers.py b/backend/integrations/trackers.py index 9c870f9..a3dfb94 100644 --- a/backend/integrations/trackers.py +++ b/backend/integrations/trackers.py @@ -47,7 +47,7 @@ class TrackerStat: up_str: str | None = None down_str: str | None = None tokens: int | None = None # jetons/points de seed (None = le tracker n'en a pas) - tokens_label: str = "jetons" + tokens_label: str = "token" @property def has_io(self) -> bool: @@ -180,7 +180,7 @@ async def _fetch_tr4ker(spec: TrackerSpec) -> TrackerStat: `POST /api/auth/login` body `{identifier,password}` -> `{ok:true}`, puis `GET /api/me`. Ratio comme le site : (uploaded + bonus_upload) / (downloaded + bonus_download) ; si rien n'a été téléchargé, on compte 1 Go (le site fait pareil via bonus_download, - ça évite un ratio infini). Système de jetons = champ `money` (libellé `token_currency_name`).""" + ça évite un ratio infini). Système de jetons = champ `money` (libellé unifié « token »).""" if not (spec.base_url and spec.username and spec.password): return TrackerStat(spec.key, spec.label, ok=False, error="non configuré") @@ -211,7 +211,6 @@ async def _fetch_tr4ker(spec: TrackerSpec) -> TrackerStat: spec.key, spec.label, ok=True, ratio=up / down, up_bytes=up, down_bytes=down, tokens=int(money) if money is not None else None, - tokens_label=str(u.get("token_currency_name") or "crédits"), ) diff --git a/dev/preview.py b/dev/preview.py index d21d598..06db57e 100644 --- a/dev/preview.py +++ b/dev/preview.py @@ -68,8 +68,8 @@ CTX = { }, "trackers": [ {"ok": True, "label": "c411", "ratio_h": "1,04", "has_io": True, "up_h": "378 Go", "down_h": "365 Go", "tokens": None}, - {"ok": True, "label": "torr9", "ratio_h": "1,62", "has_io": True, "up_h": "226 Go", "down_h": "140 Go", "tokens": 2168, "tokens_h": "2 168", "tokens_label": "jetons"}, - {"ok": True, "label": "tr4ker", "ratio_h": "5233,52", "has_io": True, "up_h": "5,62 To", "down_h": "1 Go", "tokens": 223, "tokens_h": "223", "tokens_label": "Crédit"}, + {"ok": True, "label": "torr9", "ratio_h": "1,62", "has_io": True, "up_h": "226 Go", "down_h": "140 Go", "tokens": 2168, "tokens_h": "2 168", "tokens_label": "token"}, + {"ok": True, "label": "tr4ker", "ratio_h": "5233,52", "has_io": True, "up_h": "5,62 To", "down_h": "1 Go", "tokens": 223, "tokens_h": "223", "tokens_label": "token"}, {"ok": True, "label": "yggreborn", "ratio_h": "7,63", "has_io": True, "up_h": "60,55 Go", "down_h": "7,94 Go", "tokens": None}, ], "kobo": {"ok": True, "percent": 63, "charging": False, "low": False, "stale": False},