✨ qBittorrent: cle API native (>= 5.2, Bearer) + compatibilite login 204 + suppression torrent en bypass/port separe
This commit is contained in:
1 parent
c7344f8988
commit
8e76fb7112
8 files changed
+143
-15
No files matched your search
+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 && (
|
||||
|
||||
Reference in new issue
Block a user