From 25877685eaf02b3b1c02ff06db618a37aebf0e6b Mon Sep 17 00:00:00 2001 From: MasutaYunikon Date: Wed, 27 May 2026 23:31:23 +0200 Subject: [PATCH] fix(synology): double prefix dbid_ et fallback hash --- server/torrent-clients/synology-ds.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/torrent-clients/synology-ds.ts b/server/torrent-clients/synology-ds.ts index 8b29c3e..61cf235 100644 --- a/server/torrent-clients/synology-ds.ts +++ b/server/torrent-clients/synology-ds.ts @@ -116,11 +116,13 @@ const DS: TorrentClientDriver = { const dl = transfer.size_downloaded ?? 0 // Synology expose le hash BT dans additional.detail.hash - // Fallback sur dbid_ pour les tâches non-BT (DDL, etc.) - const rawHash = detail.hash - const hash = (typeof rawHash === 'string' && rawHash.length > 0) + // Fallback sur l'ID Synology natif (déjà au format "dbid_X") + const rawHash = String(detail.hash ?? '').trim() + const hash = rawHash.length > 0 ? rawHash.toLowerCase() - : `dbid_${t.id}` + : String(t.id ?? '').toLowerCase() + + if (!rawHash) logger.debug('synology-ds', `Hash BT absent pour "${t.title}" — matching par titre (ID: ${t.id})`) return { hash,