Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87fd6b39fd | ||
|
|
acc1609b4d | ||
|
|
8e76fb7112 |
No files matched your search
+5
-1
@@ -56,7 +56,11 @@ COPY app/ app/
|
||||
COPY --from=web /web/dist /app/web/dist
|
||||
COPY docker/entrypoint.py /entrypoint.py
|
||||
|
||||
ENV MKVTOOL_CONFIG_DIR=/config \
|
||||
# HOME pointe vers /config pour que MakeMKV y lise et y ecrite sa
|
||||
# configuration (settings.conf, cle d'activation) : le processus tourne sous
|
||||
# PUID/PGID et ne peut pas acceder a /root, et /config est le volume persistant.
|
||||
ENV HOME=/config \
|
||||
MKVTOOL_CONFIG_DIR=/config \
|
||||
MKVTOOL_WEB_DIR=/app/web/dist \
|
||||
MKVTOOL_FILMS_DIR=/films \
|
||||
MKVTOOL_RADARR_FILMS_DIR=/nas_storage/jellyfin/films \
|
||||
|
||||
@@ -29,6 +29,37 @@ MakeMKV (`makemkvcon`) est compile dans l'image a partir de la version definie
|
||||
par l'argument de build `MAKEMKV_VERSION` (par defaut `2.0.0`). Le build local
|
||||
reste possible : `docker build -t mkvtool .`.
|
||||
|
||||
## Activation de MakeMKV
|
||||
|
||||
MakeMKV est shareware : sans clé d'activation, `makemkvcon` ne peut pas
|
||||
convertir en mode non interactif (il demande le lancement de la période
|
||||
d'évaluation, puis s'arrête). Deux options :
|
||||
|
||||
- **Clé bêta gratuite**, publiée par l'éditeur sur le forum officiel
|
||||
(https://forum.makemkv.com/forum/viewtopic.php?t=1053) et renouvelée tous
|
||||
les un à deux mois tant que MakeMKV reste en bêta. C'est la voie gratuite
|
||||
usuelle.
|
||||
- **Clé permanente** achetée (~60 USD, achat à vie) — l'achat est
|
||||
ponctuellement indisponible côté éditeur, la clé bêta fait alors foi.
|
||||
|
||||
L'image positionne `HOME=/config` : MakeMKV lit et écrit sa configuration
|
||||
dans `/config/.MakeMKV/settings.conf`, donc sur le volume persistant. Pour
|
||||
activer :
|
||||
|
||||
```bash
|
||||
docker exec mkvtool makemkvcon reg T-VOTRE-CLE
|
||||
```
|
||||
|
||||
Ou en créant le fichier `<montage de /config>/.MakeMKV/settings.conf` sur
|
||||
l'hôte :
|
||||
|
||||
```
|
||||
app_MakeMKV_key = "T-VOTRE-CLE"
|
||||
```
|
||||
|
||||
Si une conversion échoue avec le message d'activation, la clé a expiré :
|
||||
reprenez la clé courante sur le forum et relancez la commande ci-dessus.
|
||||
|
||||
## Variables d'environnement
|
||||
|
||||
| Variable | Defaut image | Role |
|
||||
|
||||
@@ -31,6 +31,8 @@ class QbittorrentConfig(BaseModel):
|
||||
port: int | None = None
|
||||
username: str | None = None
|
||||
password: str | None = None
|
||||
# Cle API native qBittorrent >= 5.2 (qbt_...), en-tete Authorization: Bearer.
|
||||
api_key: str | None = None
|
||||
test: TestState = Field(default_factory=TestState)
|
||||
|
||||
|
||||
|
||||
@@ -94,6 +94,14 @@ def extract_mkv(movie: IsoMovie, mkv_path: Path) -> None:
|
||||
)
|
||||
if result.returncode != 0:
|
||||
detail = result.stderr.strip() or result.stdout.strip()
|
||||
if "purchase an activation key" in detail or "evaluation period" in detail:
|
||||
raise RuntimeError(
|
||||
"MakeMKV n'est pas activé: une clé est requise pour la conversion. "
|
||||
"Utilisez la clé bêta gratuite du forum officiel MakeMKV ou une clé "
|
||||
"achetée, puis `docker exec mkvtool makemkvcon reg <clé>` "
|
||||
"(ou renseignez app_MakeMKV_key dans /config/.MakeMKV/settings.conf). "
|
||||
"Voir IMAGE.md."
|
||||
)
|
||||
raise RuntimeError(f"MakeMKV a echoue: {detail}")
|
||||
produced = sorted(mkv_path.parent.glob("*.mkv"))
|
||||
if not produced:
|
||||
|
||||
+23
-5
@@ -100,6 +100,7 @@ def _qbittorrent_read(qb: QbittorrentConfig) -> QbittorrentSettingsRead:
|
||||
port=qb.port,
|
||||
username=qb.username,
|
||||
password_configured=qb.password is not None,
|
||||
api_key_configured=qb.api_key is not None,
|
||||
status=service_status(qb),
|
||||
tested_version=qb.test.version,
|
||||
tested_at=qb.test.at,
|
||||
@@ -200,6 +201,7 @@ def put_settings(payload: SettingsWrite) -> SettingsRead:
|
||||
qb_changed = bool(qb.url) and str(qb.url).rstrip("/") != (cfg.qbittorrent.url or "")
|
||||
qb_changed = qb_changed or bool(qb.username and qb.username != cfg.qbittorrent.username)
|
||||
qb_changed = qb_changed or bool(qb.password)
|
||||
qb_changed = qb_changed or bool(qb.api_key)
|
||||
if qb_changed:
|
||||
reset_test(cfg.qbittorrent)
|
||||
if qb.url is not None:
|
||||
@@ -208,6 +210,8 @@ def put_settings(payload: SettingsWrite) -> SettingsRead:
|
||||
cfg.qbittorrent.username = qb.username
|
||||
if qb.password:
|
||||
cfg.qbittorrent.password = qb.password
|
||||
if qb.api_key:
|
||||
cfg.qbittorrent.api_key = qb.api_key
|
||||
|
||||
write_config(cfg)
|
||||
return _settings_read()
|
||||
@@ -301,7 +305,7 @@ def qbittorrent_from_config() -> QbittorrentClient:
|
||||
url = build_base_url(qb.url, qb.port)
|
||||
if not url:
|
||||
raise HTTPException(status_code=409, detail="La connexion qBittorrent n'est pas configurée")
|
||||
return QbittorrentClient(url, qb.username, qb.password)
|
||||
return QbittorrentClient(url, qb.username, qb.password, qb.api_key)
|
||||
|
||||
|
||||
@app.get("/api/settings/qbittorrent", response_model=QbittorrentSettingsRead)
|
||||
@@ -318,6 +322,7 @@ def put_qbittorrent_settings(payload: QbittorrentSettingsWrite) -> QbittorrentSe
|
||||
)
|
||||
qb_changed = qb_changed or bool(payload.username and payload.username != qb.username)
|
||||
qb_changed = qb_changed or bool(payload.password)
|
||||
qb_changed = qb_changed or bool(payload.api_key)
|
||||
if qb_changed:
|
||||
reset_test(qb)
|
||||
if payload.url is not None:
|
||||
@@ -334,6 +339,8 @@ def put_qbittorrent_settings(payload: QbittorrentSettingsWrite) -> QbittorrentSe
|
||||
# Champs vides: mode bypass d'authentification qBittorrent, sans identifiants.
|
||||
qb.username = None
|
||||
qb.password = None
|
||||
if payload.api_key:
|
||||
qb.api_key = payload.api_key
|
||||
write_config(cfg)
|
||||
return _qbittorrent_read(qb)
|
||||
|
||||
@@ -381,7 +388,12 @@ def _log_config_summary() -> None:
|
||||
if getattr(cfg, name).url
|
||||
]
|
||||
if cfg.qbittorrent.url:
|
||||
mode = "identifiants" if cfg.qbittorrent.username else "bypass d'authentification"
|
||||
if cfg.qbittorrent.api_key:
|
||||
mode = "cle API"
|
||||
elif cfg.qbittorrent.username:
|
||||
mode = "identifiants"
|
||||
else:
|
||||
mode = "bypass d'authentification"
|
||||
configured.append(f"qbittorrent ({mode})")
|
||||
if configured:
|
||||
print(f"conf.json charge: {', '.join(configured)}", flush=True)
|
||||
@@ -480,12 +492,18 @@ def _linked_mkv(movie: IsoMovie) -> Path | None:
|
||||
|
||||
|
||||
async def _delete_iso_torrent(iso_path: str) -> None:
|
||||
"""Supprime le torrent qBittorrent de l'ISO (best effort, sans bloquer)."""
|
||||
"""Supprime le torrent qBittorrent de l'ISO (best effort, sans bloquer).
|
||||
|
||||
Fonctionne dans tous les modes d'authentification: cle API, identifiants
|
||||
ou bypass (l'URL doit simplement etre configuree). Le port separe est
|
||||
pris en compte via build_base_url.
|
||||
"""
|
||||
qb = read_config().qbittorrent
|
||||
if not qb.url or not qb.username or not qb.password:
|
||||
url = build_base_url(qb.url, qb.port)
|
||||
if not url:
|
||||
return
|
||||
try:
|
||||
client = QbittorrentClient(qb.url, qb.username, qb.password)
|
||||
client = QbittorrentClient(url, qb.username, qb.password, qb.api_key)
|
||||
torrents = await client.torrents()
|
||||
match = match_torrent(torrents, iso_path)
|
||||
if match is not None and match.get("hash"):
|
||||
|
||||
+26
-7
@@ -6,32 +6,51 @@ import httpx
|
||||
|
||||
|
||||
class QbittorrentClient:
|
||||
"""Client WebUI (API v2). Identifiants optionnels: sans eux, aucun login
|
||||
n'est effectue — qBittorrent doit alors autoriser la plage IP (bypass
|
||||
d'authentification), car il n'existe pas d'API key cote qBittorrent."""
|
||||
"""Client WebUI (API v2).
|
||||
|
||||
Modes d'authentification, dans l'ordre de priorite:
|
||||
|
||||
1. Cle API (qBittorrent >= 5.2): envoyee en en-tete ``Authorization:
|
||||
Bearer <cle>`` sur chaque appel, sans login ni session.
|
||||
2. Identifiants (login ``POST /api/v2/auth/login`` + cookie de session).
|
||||
qBittorrent >= 5.2 repond 204 sans corps; les versions anterieures
|
||||
renvoient 200 avec le corps "Ok.".
|
||||
3. Sans rien: bypass d'authentification qBittorrent (la plage IP du
|
||||
conteneur doit etre autorisee dans la WebUI), aucune API key native
|
||||
n'existait avant la 5.2.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, url: str, username: str | None = None, password: str | None = None
|
||||
self,
|
||||
url: str,
|
||||
username: str | None = None,
|
||||
password: str | None = None,
|
||||
api_key: str | None = None,
|
||||
) -> None:
|
||||
self._url = url.rstrip("/")
|
||||
self._username = username
|
||||
self._password = password
|
||||
self._api_key = api_key
|
||||
|
||||
async def _request(self, method: str, endpoint: str, **kwargs) -> httpx.Response:
|
||||
headers = {"Referer": self._url}
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
if self._username and self._password:
|
||||
if self._api_key:
|
||||
headers["Authorization"] = f"Bearer {self._api_key}"
|
||||
elif self._username and self._password:
|
||||
login = await client.post(
|
||||
f"{self._url}/api/v2/auth/login",
|
||||
data={"username": self._username, "password": self._password},
|
||||
headers={"Referer": self._url},
|
||||
)
|
||||
login.raise_for_status()
|
||||
if login.text.strip() != "Ok.":
|
||||
# qBittorrent >= 5.2 renvoie 204 sans corps.
|
||||
if login.status_code != 204 and login.text.strip() != "Ok.":
|
||||
raise ValueError("Authentification qBittorrent refusée")
|
||||
response = await client.request(
|
||||
method,
|
||||
f"{self._url}{endpoint}",
|
||||
headers={"Referer": self._url},
|
||||
headers=headers,
|
||||
**kwargs,
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
@@ -40,6 +40,7 @@ class QbittorrentSettingsRead(BaseModel):
|
||||
port: int | None = None
|
||||
username: str | None
|
||||
password_configured: bool
|
||||
api_key_configured: bool
|
||||
status: str
|
||||
tested_version: str | None = None
|
||||
tested_at: str | None = None
|
||||
@@ -52,6 +53,8 @@ class QbittorrentSettingsWrite(BaseModel):
|
||||
# Utilisateur vide = bypass d'authentification qBittorrent.
|
||||
username: str | None = None
|
||||
password: str | None = Field(default=None, min_length=1)
|
||||
# Cle API native qBittorrent >= 5.2, prioritaire sur le login.
|
||||
api_key: str | None = Field(default=None, min_length=1)
|
||||
|
||||
|
||||
class SettingsRead(BaseModel):
|
||||
|
||||
@@ -25,6 +25,19 @@ if os.geteuid() == 0 and puid:
|
||||
subprocess.run(
|
||||
["chown", "-R", f"{puid}:{pgid or puid}", config_dir], check=False
|
||||
)
|
||||
# Entree passwd pour PUID: certains binaires (MakeMKV) resolvent le
|
||||
# repertoire utilisateur via getpwuid et non via $HOME. Sans entree,
|
||||
# makemkvcon ne trouve pas sa configuration (/config/.MakeMKV).
|
||||
try:
|
||||
with open("/etc/passwd", encoding="utf-8") as handle:
|
||||
known_uids = {line.split(":")[2] for line in handle if ":" in line}
|
||||
if str(puid) not in known_uids:
|
||||
with open("/etc/passwd", "a", encoding="utf-8") as handle:
|
||||
handle.write(
|
||||
f"mkvtool:x:{puid}:{pgid or puid}::{config_dir}:/usr/sbin/nologin\n"
|
||||
)
|
||||
except OSError:
|
||||
pass
|
||||
os.setgroups([pgid] if pgid else [])
|
||||
if pgid:
|
||||
os.setgid(pgid)
|
||||
|
||||
@@ -230,6 +230,58 @@ def test_qbittorrent_connection_without_credentials() -> None:
|
||||
assert test.json()["version"] == "v5.0.2"
|
||||
|
||||
|
||||
@respx.mock
|
||||
def test_qbittorrent_login_204_modern() -> None:
|
||||
"""qBittorrent >= 5.2: le login repond 204 sans corps (plus "200 Ok.")."""
|
||||
respx.post("http://192.168.1.50:8080/api/v2/auth/login").mock(
|
||||
return_value=Response(204)
|
||||
)
|
||||
respx.get("http://192.168.1.50:8080/api/v2/app/version").mock(
|
||||
return_value=Response(200, text="v5.2.0")
|
||||
)
|
||||
with TestClient(app) as client:
|
||||
client.put(
|
||||
"/api/settings/qbittorrent",
|
||||
json={
|
||||
"url": "192.168.1.50",
|
||||
"port": 8080,
|
||||
"username": "admin",
|
||||
"password": "pass",
|
||||
},
|
||||
)
|
||||
test = client.post("/api/settings/qbittorrent/test")
|
||||
assert test.status_code == 200
|
||||
assert test.json()["version"] == "v5.2.0"
|
||||
|
||||
|
||||
@respx.mock
|
||||
def test_qbittorrent_api_key_mode() -> None:
|
||||
"""Cle API native (qBittorrent >= 5.2): en-tete Authorization: Bearer sur
|
||||
chaque appel, aucun login."""
|
||||
login_route = respx.post("http://192.168.1.50:8080/api/v2/auth/login").mock(
|
||||
return_value=Response(404)
|
||||
)
|
||||
version_route = respx.get("http://192.168.1.50:8080/api/v2/app/version").mock(
|
||||
return_value=Response(200, text="v5.2.0")
|
||||
)
|
||||
with TestClient(app) as client:
|
||||
put = client.put(
|
||||
"/api/settings/qbittorrent",
|
||||
json={"url": "192.168.1.50", "port": 8080, "api_key": "qbt_test_key"},
|
||||
)
|
||||
assert put.json()["api_key_configured"] is True
|
||||
test = client.post("/api/settings/qbittorrent/test")
|
||||
raw = json.loads(config_path().read_text(encoding="utf-8"))
|
||||
assert test.status_code == 200
|
||||
assert test.json()["version"] == "v5.2.0"
|
||||
assert not login_route.called
|
||||
assert version_route.called
|
||||
assert (
|
||||
version_route.calls.last.request.headers["authorization"] == "Bearer qbt_test_key"
|
||||
)
|
||||
assert raw["qbittorrent"]["api_key"] == "qbt_test_key"
|
||||
|
||||
|
||||
def test_settings_persist_to_conf_json() -> None:
|
||||
with TestClient(app) as client:
|
||||
put = client.put(
|
||||
@@ -293,7 +345,11 @@ def test_setup_link_only_without_existing_account() -> None:
|
||||
|
||||
def test_startup_logs_conf_json_summary(capsys) -> None:
|
||||
"""Au lancement, le log indique si conf.json est charge et ce qu'il contient."""
|
||||
from app.conf_store import AppConfig, write_config
|
||||
|
||||
with TestClient(app) as client:
|
||||
# Repart d'une conf vierge: les tests precedents remplissent conf.json.
|
||||
write_config(AppConfig())
|
||||
client.put(
|
||||
"/api/settings/qbittorrent",
|
||||
json={"url": "192.168.1.50", "port": 8555},
|
||||
|
||||
@@ -7,6 +7,7 @@ from fastapi.testclient import TestClient
|
||||
from httpx import Response
|
||||
|
||||
from app.config import settings
|
||||
from app.converter import extract_mkv
|
||||
from app.database import SessionLocal
|
||||
from app.main import app
|
||||
from app.models import IsoMovie
|
||||
@@ -161,3 +162,36 @@ def test_scan_marks_missing_radarr_files_as_unlinked() -> None:
|
||||
movie = client.get("/api/movies").json()[0]
|
||||
assert movie["radarr_linked"] is False
|
||||
assert movie["status"] == "detected"
|
||||
|
||||
|
||||
def test_extract_fails_with_activation_error_when_makemkv_unactivated(
|
||||
monkeypatch, tmp_path
|
||||
) -> None:
|
||||
"""Sans cle MakeMKV (message shareware), l'erreur guide vers l'activation."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
monkeypatch.setattr(settings, "simulate_conversion", False)
|
||||
monkeypatch.setattr("app.converter.shutil.which", lambda _: "/usr/bin/makemkvcon")
|
||||
monkeypatch.setattr(
|
||||
"app.converter.subprocess.run",
|
||||
lambda *args, **kwargs: SimpleNamespace(
|
||||
returncode=10,
|
||||
stdout=(
|
||||
"This functionality is shareware. You may evaluate it for 30 days "
|
||||
"after what you would need to purchase an activation key.\n"
|
||||
"Do you want to start evaluation period now?\n"
|
||||
"Evaluation version, 30 day(s) out of 30 remaining"
|
||||
),
|
||||
stderr="",
|
||||
),
|
||||
)
|
||||
movie = IsoMovie(
|
||||
radarr_movie_id=1, radarr_movie_file_id=2, title="ISO Movie", path="/x.iso"
|
||||
)
|
||||
try:
|
||||
extract_mkv(movie, tmp_path / "out" / "movie.mkv")
|
||||
except RuntimeError as error:
|
||||
assert "MakeMKV n'est pas activé" in str(error)
|
||||
assert "makemkvcon reg" in str(error)
|
||||
else:
|
||||
raise AssertionError("RuntimeError attendue")
|
||||
+15
-2
@@ -30,6 +30,7 @@ type QbittorrentSettings = {
|
||||
port: number | null;
|
||||
username: string | null;
|
||||
password_configured: boolean;
|
||||
api_key_configured: boolean;
|
||||
};
|
||||
|
||||
const jsonHeaders = { "Content-Type": "application/json" };
|
||||
@@ -119,6 +120,7 @@ export default function App() {
|
||||
const [qbitPort, setQbitPort] = useState("");
|
||||
const [qbitUsername, setQbitUsername] = useState("");
|
||||
const [qbitPassword, setQbitPassword] = useState("");
|
||||
const [qbitApiKey, setQbitApiKey] = useState("");
|
||||
const [qbitConfigured, setQbitConfigured] = useState(false);
|
||||
const [selected, setSelected] = useState<Movie | null>(null);
|
||||
const [posterUrl, setPosterUrl] = useState<string | null>(null);
|
||||
@@ -211,7 +213,7 @@ export default function App() {
|
||||
setQbitUrl(qbittorrent.url ?? "");
|
||||
setQbitPort(qbittorrent.port?.toString() ?? "");
|
||||
setQbitUsername(qbittorrent.username ?? "");
|
||||
setQbitConfigured(qbittorrent.password_configured);
|
||||
setQbitConfigured(qbittorrent.password_configured || qbittorrent.api_key_configured);
|
||||
if (!radarr.api_key_configured || !qbittorrent.password_configured) {
|
||||
notify(
|
||||
"Configuration incomplète — renseignez les connexions Radarr et qBittorrent dans la page Configuration.",
|
||||
@@ -332,10 +334,12 @@ export default function App() {
|
||||
port: qbitPort ? Number(qbitPort) : null,
|
||||
username: qbitUsername,
|
||||
password: qbitPassword || null,
|
||||
api_key: qbitApiKey || null,
|
||||
}),
|
||||
});
|
||||
setQbitConfigured(settings.password_configured);
|
||||
setQbitConfigured(settings.password_configured || settings.api_key_configured);
|
||||
setQbitPassword("");
|
||||
setQbitApiKey("");
|
||||
const result = await api<{ message: string }>("/api/settings/qbittorrent/test", {
|
||||
method: "POST",
|
||||
});
|
||||
@@ -1008,6 +1012,15 @@ export default function App() {
|
||||
onChange={(event) => setQbitPassword(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Clé API (optionnel — qBittorrent ≥ 5.2)
|
||||
<input
|
||||
type="password"
|
||||
placeholder="qbt_... — prioritaire sur les identifiants"
|
||||
value={qbitApiKey}
|
||||
onChange={(event) => setQbitApiKey(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<button disabled={busy}>Enregistrer et tester</button>
|
||||
</form>
|
||||
{qbitConfigured && (
|
||||
|
||||
@@ -30,6 +30,8 @@ export default function Settings() {
|
||||
const [qbitUsername, setQbitUsername] = useState("");
|
||||
const [qbitPassword, setQbitPassword] = useState("");
|
||||
const [qbitPasswordConfigured, setQbitPasswordConfigured] = useState(false);
|
||||
const [qbitApiKey, setQbitApiKey] = useState("");
|
||||
const [qbitApiKeyConfigured, setQbitApiKeyConfigured] = useState(false);
|
||||
|
||||
const [message, setMessage] = useState("");
|
||||
const [busy, setBusy] = useState(false);
|
||||
@@ -56,6 +58,7 @@ export default function Settings() {
|
||||
setQbitUrl(settings.qbittorrent.url ?? "");
|
||||
setQbitUsername(settings.qbittorrent.username ?? "");
|
||||
setQbitPasswordConfigured(settings.qbittorrent.password_configured);
|
||||
setQbitApiKeyConfigured(settings.qbittorrent.api_key_configured);
|
||||
}, []);
|
||||
|
||||
const refreshSettings = useCallback(async (): Promise<SettingsRead> => {
|
||||
@@ -157,11 +160,13 @@ export default function Settings() {
|
||||
url: qbitUrl || null,
|
||||
username: qbitUsername || null,
|
||||
password: qbitPassword || null,
|
||||
api_key: qbitApiKey || null,
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
setQbitPassword("");
|
||||
setQbitApiKey("");
|
||||
const fresh = await refreshSettings();
|
||||
if (fresh.qbittorrent.status === "unconfigured") {
|
||||
setMessage("Configuration enregistrée");
|
||||
@@ -353,7 +358,7 @@ export default function Settings() {
|
||||
</div>
|
||||
<p className="muted">Optionnel: nécessaire pour supprimer torrent + données après import validé.</p>
|
||||
</div>
|
||||
<form onSubmit={saveQbittorrent} className="form-3">
|
||||
<form onSubmit={saveQbittorrent} className="form-4">
|
||||
<label>
|
||||
URL WebUI
|
||||
<input
|
||||
@@ -381,6 +386,17 @@ export default function Settings() {
|
||||
onChange={(event) => setQbitPassword(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Clé API {qbitApiKeyConfigured && <span>· configurée</span>}
|
||||
<input
|
||||
type="password"
|
||||
placeholder={
|
||||
qbitApiKeyConfigured ? "Laisser vide pour conserver" : "qbt_... (qBittorrent ≥ 5.2)"
|
||||
}
|
||||
value={qbitApiKey}
|
||||
onChange={(event) => setQbitApiKey(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<button disabled={busy}>Enregistrer et tester</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
@@ -22,6 +22,7 @@ export type QbittorrentSettingsRead = ServiceStatus & {
|
||||
url: string | null;
|
||||
username: string | null;
|
||||
password_configured: boolean;
|
||||
api_key_configured: boolean;
|
||||
};
|
||||
|
||||
export type SettingsRead = {
|
||||
|
||||
Reference in new issue
Block a user