Trackers: libellé jetons unifié en "token" (torr9 + tr4ker)
This commit is contained in:
@@ -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"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user