Commit graph

80 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
Roger Far
24321a55c9 Upgrade Angular to 21 and .NET to 10. 2026-02-11 19:40:23 -07:00
destrodxbad
27398ba993 Add automatic disk space monitoring for Bezzad downloader 2025-11-09 03:05:56 +01:00
Roger Versluis
123c4f29c6 Remove internal downloader. 2025-10-06 20:15:07 -06:00
Roger Far
d9858409db Cleanup, make sure the RD API adheres to the set timeout when trying to add a magnet or file. 2025-07-28 21:46:20 -06:00
Cucumberrbob
2bbbf0fd10
Use ISynologyClient (mockable) and inject IDelayProvider so SynologyTorrentClient is testable 2025-02-17 22:00:19 +00:00
Roger Far
f58b7d3e72 Refactored TorrentClientKind to Provider. Upgrade Downloader.NET 2025-02-12 20:24:22 -07: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
eeef6fb7fe Merge remote-tracking branch 'rogerfar/master'
# Conflicts:
#	server/RdtClient.Service/RdtClient.Service.csproj
#	server/RdtClient.Service/Services/DownloadClient.cs
2025-01-22 19:11:23 +01:00
Roger Far
e449bd7928 Refactored out goto statement. 2025-01-19 19:55:19 -07:00
YvesPa
735912da5d Change log position 2025-01-10 16:45:50 +01:00
YvesPa
7d2d7fa35f Merge remote-tracking branch 'rogerfar/master' 2025-01-10 16:27:04 +01:00
Sculas
56934e3183
refactor: Improve logging 2025-01-07 15:15:31 +01:00
Sculas
38a3bc1537
perf(SymlinkDownloader): Skip file search when using Alldebrid 2025-01-07 14:34:02 +01:00
Sculas
8fe277fa52
fix(SymlinkDownloader): Add search path to potential file paths 2025-01-07 14:26:26 +01:00
Roger Far
d43774d9b5 Fix hanging Aria2 downloads when files are being copied or cannot be found on the host. 2025-01-05 20:49:55 -07:00
YvesPa
f9335be163 Merge remote-tracking branch 'rogerfar/master' 2024-12-10 11:12:55 +01:00
YvesPa
346982fe8d Manage error 2024-12-10 11:05:39 +01:00
Roger Versluis
ee5b5f8dc3 Upgrade to .NET 9, code cleanup. 2024-11-18 03:39:12 -07: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
GabbeHags
df084bcebe download limit now takes in to consideration total active downloads 2024-09-15 21:04:55 +02:00
Mitchell Kelly
6d4440de20 Fixed issue moving downloaded files in the base directory 2024-08-04 20:07:54 -04:00
Roger Far
8dd0eec654 Add retry handler with polly to intercept 429 rate limit errors with Real-Debrid. 2024-07-13 19:54:36 -06:00
Roger Far
2bf1c997d8 Aria2c fix #2.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-05-04 19:13:56 -06:00
Roger Versluis
06c034f18a Fixed download path issue with Aria2c when a category is set.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-05-03 10:26:15 -06:00
Roger Versluis
d5aaad866b Fixed broken symlink recursive searching.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-04-24 07:29:02 -06:00
Roger Far
dbb502a164 Add recursive searching for the symlink downloader. 2024-04-20 09:47:51 -06:00
Roger Far
0bfb4974d8 Fixed another symlink path resolver issue.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-04-11 22:26:24 -06:00
Roger Far
ed8637931d Fixed symlink path matching bug.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-04-10 21:50:01 -06:00
Roger Far
05dd562be1 Add logging for the symlink downloader.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-04-10 17:56:11 -06:00
Roger Far
d36b9cf889 Add fix for symlink downloader.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-04-09 20:02:07 -06:00
Roger Far
367e195ed6 Symlink fixes.
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-04-08 20:36:42 -06:00
Roger Far
d6e549bb67 Added option to configure the buffersize for the internal downloader. 2024-04-07 00:14:48 -06:00
Roger Far
bec2dcd20b Add internal downloader logger. 2024-04-06 16:28:03 -06:00
Roger Far
c21d578a23 Style fixes. 2024-04-06 14:58:07 -06:00
Roger Far
e5dfb0e027 Add fixes for the symlink downloader from https://github.com/Pukabyte/rdtclient . 2024-04-06 14:52:11 -06:00
Roger Far
3b72463663 Added bit of logging to debug downloader issues, upgraded packages, cleaned up C# code. 2024-04-06 13:54:58 -06:00
Roger Far
6c47ebcfad Added the previous downloader back in, keep the Bezzad downloader in as a secondary. 2024-01-21 16:48:44 -07:00
Roger Far
c95f0171f7 no message
Some checks failed
Docker Image CI / build (push) Has been cancelled
2024-01-10 18:12:02 -07:00
Roger Far
486cea1006 Add ParallelCount setting back, don't calculate chunk count but use a setting value. 2024-01-10 18:11:46 -07:00
Roger Far
f80f041eeb Fixed symlink retrying. 2024-01-09 19:23:46 -07:00
Roger Far
70aae02d55 Return a fake ID from the symlink downloader when the symlink is done to accomodate a retry mechanism. 2024-01-08 19:52:00 -07:00
Roger Far
de9045d3f6 Tweaked the downloader a bit to fix the memory issues. 2024-01-08 19:51:32 -07:00