Trackers: libellé jetons unifié en "token" (torr9 + tr4ker)

This commit is contained in:
jerem
2026-06-17 11:50:13 +02:00
parent 31ff8636b3
commit 7f5bbd6b08
2 changed files with 4 additions and 5 deletions

View File

@@ -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"),
)

View File

@@ -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},