From bedb588f5011db06c03cd543d23449f3f131fd96 Mon Sep 17 00:00:00 2001 From: Froidefond Julien Date: Sun, 29 Mar 2026 17:52:16 +0200 Subject: [PATCH] fix: envoyer expected_volumes lors d'un replace pour tracker le download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quand on fait un replace sans volumes manquants, expected_volumes n'était pas envoyé → is_managed=false → pas d'insertion dans torrent_downloads → le torrent n'apparaissait pas dans la page downloads. Maintenant un replace avec libraryId envoie toujours expected_volumes (même vide) pour garantir le tracking. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/backoffice/app/components/QbittorrentDownloadButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/backoffice/app/components/QbittorrentDownloadButton.tsx b/apps/backoffice/app/components/QbittorrentDownloadButton.tsx index 55e0cae..5e2f988 100644 --- a/apps/backoffice/app/components/QbittorrentDownloadButton.tsx +++ b/apps/backoffice/app/components/QbittorrentDownloadButton.tsx @@ -63,6 +63,7 @@ export function QbittorrentDownloadButton({ setSending(true); setError(null); try { + const vols = volumes || expectedVolumes; const resp = await fetch("/api/qbittorrent/add", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -70,7 +71,7 @@ export function QbittorrentDownloadButton({ url: downloadUrl, ...(libraryId && { library_id: libraryId }), ...(seriesName && { series_name: seriesName }), - ...((volumes || expectedVolumes) && { expected_volumes: volumes || expectedVolumes }), + ...(vols && vols.length > 0 ? { expected_volumes: vols } : replaceExisting && libraryId ? { expected_volumes: [] } : {}), ...(replaceExisting && { replace_existing: true }), }), });