Commit graph

13 commits

Author SHA1 Message Date
Antonin Lenfant-Kodia
b2a725c285 Simplify comments 2026-06-15 15:58:23 +02:00
Antonin Lenfant-Kodia
643a2e3d63 Share one authenticated Synology session across downloads
Init() created a new SynologyClient and logged in for every download. A
many-file download opened dozens of near-simultaneous sessions for one DSM
account; DSM invalidates older session IDs, so in-flight File Station calls
failed with error 119 "SID not found".

Add SynologyClientProvider: a thread-safe cache that authenticates once and
shares the client across downloads (concurrent first calls collapse to a
single login; later calls reuse it; a credential change re-authenticates).
Wrap every Synology call in a session-retry that drops the session and
re-authenticates once on a session error (119/106/107) so an expired SID
self-heals, reading credentials fresh from settings so edits take effect live.

Adds provider unit tests and a downloader test covering the 119 re-auth path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 15:42:10 +02:00
Antonin Lenfant-Kodia
c8313361a2 Fix and harden Synology Download Station support
The DownloadStation downloader left downloads stuck or silently failing.
This fixes the core flow and documents setup:

- Create the per-download destination folder via File Station (force_parent)
  before creating the task; DownloadStation does not create it for a
  direct-file task, which otherwise fails with "Destination does not exist".
- Auto-set the account's default destination when it has none (DSM leaves
  every task "Waiting" otherwise), preserving the other server settings.
- Detect completion across the terminal states (Finished/Downloaded/Seeding/
  PreSeeding or fully transferred), then verify the file is visible at the
  container path before signalling success, so a path-mapping mismatch is a
  clear error instead of a silent import failure.
- Surface DownloadStation errors (status_extra.error_detail, captcha) instead
  of polling progress forever.
- Harden task-list / get-info / delete handling against responses that fail
  to deserialize (upstream #723/#792) so one bad task can't abort a download.
- Make task creation idempotent: adopt an existing task instead of throwing
  "already added", which previously bricked every retry.

Adds unit tests, fixes a settings description typo, and documents Download
Station setup and the path-mapping requirement in the README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 15:42:10 +02:00
Roger Far
a9648248f4 Global formatting. 2026-02-11 19:44:49 -07:00
Cucumberrbob
2bbbf0fd10
Use ISynologyClient (mockable) and inject IDelayProvider so SynologyTorrentClient is testable 2025-02-17 22:00:19 +00:00
Roger Far
f379d4efb8 DownloadStation cleanup. 2025-01-29 18:55:24 -07:00
YvesPa
062787143f Throw an lisible error if not config 2025-01-28 14:12:37 +01:00
YvesPa
735912da5d Change log position 2025-01-10 16:45:50 +01:00
YvesPa
346982fe8d Manage error 2024-12-10 11:05:39 +01:00
YvesPa
5e52e2dd8c Use local Synology for test 2024-10-17 14:32:53 +02:00
YvesPa
c562e75a97 correct Path with category 2024-10-15 21:48:48 +02:00
YvesPa
fcbd9d8096 Correct Path using qbittorrent 2024-09-25 14:51:37 +02:00
YvesPa
047326a30f Add Synology Download Station 2024-09-23 12:51:04 +02:00