Commit graph

45 commits

Author SHA1 Message Date
Roger Far
66bd4560a8 Run formatters. 2026-03-14 13:41:30 -06:00
Roger Far
683ac44c12 Upgrade packages.
Migrate Angular to new injector constructors.
2026-03-14 13:39:51 -06:00
Roger Far
095a25f04a
Merge pull request #947 from AlexandreVassard/main
fix(symlink): strip duplicate torrent name from subpath
2026-03-14 13:26:56 -06:00
Alexandre Vassard
6743bd472e fix(symlink): normalize subpath first component before comparing torrent name prefix
The previous fix compared subPath directly against the sanitized torrent
name, which fails when RdName contains characters removed by
RemoveInvalidPathChars (e.g. ':' on Windows). Extract and normalize the
first component of subPath before comparing so both sides go through the
same sanitization. Add tests covering the duplicate-prefix stripping case.
2026-03-08 21:29:33 +01:00
omgbeez
67afe189b5 Refactor TorBoxDebridClientTest to include IRateLimitCoordinator and improve test consistency across methods. Updated logging and error handling for rate-limiting scenarios. 2026-03-07 17:57:42 -05:00
Roger Far
41f816ab80 Cleanup. 2026-02-23 20:04:53 -07:00
Roger Far
81dd3dd9f8
Merge pull request #923 from omgbeez/upstream/resilience
Add resilience handler, predictive rate limit handling
2026-02-23 08:36:35 -07:00
Roger Far
480d881d92 Reverted SharpCompress to 0.42.1 due to file locking issues.
Some checks failed
Release Docker Image / build (map[arch:amd64 platform:linux/amd64 runs-on:ubuntu-latest]) (push) Has been cancelled
Release Docker Image / build (map[arch:arm64 platform:linux/arm64 runs-on:ubuntu-24.04-arm]) (push) Has been cancelled
Create GitHub Release / Test, Build, and Bundle (push) Has been cancelled
dotnet test / build (push) Has been cancelled
Release Docker Image / push-images (push) Has been cancelled
Create GitHub Release / Create GitHub release (push) Has been cancelled
2026-02-21 16:04:36 -07:00
Roger Far
b7df2bfb15 Added test helper to make sure tests pass on Windows. 2026-02-21 15:33:12 -07:00
omgbeez
0ca2517eb6 Fix ETA calculation for QBittorrent API 2026-02-20 10:56:56 -05:00
omgbeez
a023d33d90 Add resilience handler, predictive rate limit handling
- Applied to TorBox, can be extended easily to other providers
- Reads response headers commonplace for pre-emptive rate limit throttling and retry-after
- When a rate limit is reached, displays a warning in the UI
- Fix socket leak from direct allocation of HttpClient, replaced with factory which handles pooling and re-use of sockets.

While HttpClient is Disposable, it doesn't gaurantee (and does not) directly release underlying sockets for queries at the time the client is disposed. These sockets will go into a TCP WAIT state often for a very long time. The expected pattern in C# is to always use the HttClientFactory which will correctly handle re-use of the OS sockets in suqsequent queries reducing resource and memory leaks.
2026-02-20 09:47:13 -05:00
Roger Far
ccee652572 Upgrade packages. 2026-02-18 21:35:02 -07:00
Roger Far
d6020594ef Cleanup. 2026-02-18 21:34:51 -07:00
omgbeez
f25cef711b Improve TorBox status mapping to TorrentStatus and log any unmapped statuses for debugging. 2026-02-13 17:06:57 -05:00
omgbeez
40be170677 Refactor download progress calculation to use centralized stats and simplify logic across services.
- Fixes an issue where progress goes back to 50% as soon as downloads are done
- Prevents copy and update of torrent/nzb list by not updating download stats on every use, most callers don't require this data, notable perf/memory improvement.
2026-02-13 17:06:12 -05:00
omgbeez
e93e4f6f22 Usenet support 2026-02-13 13:15:57 -05: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
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
32fe929f48
Merge pull request #816 from mentalblank/magnet-enrichment
Tracker Enrichment
2025-05-31 12:42:13 +01:00
MentalBlank
60263ca685 Tracker enrichment test changes 2025-05-29 23:54:47 +10:00
MentalBlank
98042f8040 Improved enrichment validation, logging, and test coverage.
Strengthened URL Validation.
Improved HTTP Client Configuration.
Logged total rejected tracker count at the information level.
Logged individual rejected tracker details at the debug level.
Debug logs for bytes and enriched bytes are now conditional.
Converted some tests from Fact to Theory.
Used Assert.Collection in EnricherTest.cs.
Standardized URL Encoding in Enricher.cs.
2025-05-25 21:50:26 +10:00
MentalBlank
4be3280c3a Enricher code refactoring with small tweaks.
Added additional tests.
Changed enricher class to sealed.
Changed logging.
Changed how trackers are added.
Fixed some issues around edge cases.
2025-05-24 02:16:27 +10:00
MentalBlank
452d8cc1cf Split tracker grabbing and parsing logic.
Split grab and parse logic, recheck cache after semaphore lock, timeouts, add URL validation check, add torrent file tests, replace test hash with valid SHA1 format, tracker URL validation, fix token disposal issue
2025-05-23 00:02:07 +10:00
MentalBlank
80a8a1020c Expand enrichment to torrent files 2025-05-20 03:27:41 +10:00
Roger Far
4801b94c64 Upgrade packages. 2025-05-18 11:31:38 -06:00
MentalBlank
ae66b40a3d Allow user to define tracker list 2025-05-16 07:57:48 +10:00
Roger Far
b4385bcaad no message 2025-04-13 09:33:36 -06:00
Roger Far
c651d21e81 Cleanup, upgrade packages. 2025-04-13 07:55:22 -06:00
Cucumberrbob
5a1b96b909
Merge remote-tracking branch 'origin/main' into fork/Cucumberrbob/refactor/get-download-info
# Conflicts:
#	server/RdtClient.Service.Test/Services/TorrentClients/AllDebridTorrentClientTest.cs
#	server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs
#	server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs
2025-03-23 13:30:05 +00:00
Roger Far
091b976b9b Update packages. 2025-03-21 15:10:54 -06:00
Cucumberrbob
88af15b3bc
[AD] GetDownloadLinks -> GetDownloadInfos
Also makes the tests work wiith this new method
2025-03-11 12:13:24 +00:00
Cucumberrbob
097ea93410
[AD] mark torrent failed when all files excluded by filters 2025-03-08 13:46:02 +00:00
Roger Far
309a91ace2 no message
Some checks failed
Docker Image CI / build (push) Has been cancelled
2025-03-07 12:33:00 -07:00
Roger Far
13bb353644
Merge pull request #729 from Cucumberrbob/refactor/download-filtering
refactor!: DRY Download Filtering
2025-03-07 12:21:32 -07:00
Cucumberrbob
2944101657
Use DownloadableFileFilter in AllDebridTorrentClient to filter files
Also updates unit tests to not test if filter works. Test filter is used appropriately instead.
2025-03-03 11:57:43 +00:00
Cucumberrbob
b95dbcc824
Add DownloadableFileFilter + unit tests
`DownloadableFileFilter` is an abstraction of the filtering we do in most of the `TorrentClient`s.
It operates on a single file at a time, not the entire torrent.
2025-03-03 11:52:19 +00:00
Cucumberrbob
d683c45dbd
tests: use theorydata 2025-02-23 18:54:31 +00:00
Roger Far
85d6b820f3 Upgrade packages, fixed few formatting issues. 2025-02-23 11:42:38 -07:00
Cucumberrbob
1d15b0d651
Add tests for AllDebridTorrentClient
Tests:
- `GetDownloadLinks`
  - `IncludeRegex` filter works
  - `ExcludeRegex` filter works
  - `DownloadMinSize` filter works
  - only `IncludeRegex` is used when both `IncludeRegex` and `ExcludeRegex` are set
  - gets links for all files if none of the above filters are set
  - returns null if `torrent.RdId` is null
- `GetTorrents`
  - [Both full/partial sync] returns empty list when no torrents present in api response
  - [full sync] overrides any previous torrents in cache, deleting those not present in the api response
  - [partial sync] updates torrents in cache according to the api response
  - [partial sync] adds torrents to cache according to the api response
  - `Map` (private so tested via `GetTorrents`)
    - Computes progress correctly from `Downloaded / Size`
  - `UpdateData`
    - [`torrentClientTorrent != null`] does not get from api, updates the `torrent` accordingly
    - [`torrentClientTorrent == null`] gets from api, updates the `torrent` accordingly
    - [`torrentClientTorrent == null`] when torrent deleted from rd, updates `RdStatusRaw = "deleted""`
    - when `torrent.RdId == null`, returns the `torrent` unmodified
2025-02-17 22:04:18 +00:00
Cucumberrbob
e0264a6e29
Add tests for DownloadHelper (GetDownloadPath)
Tests:
- [Both overloads] uses the `download.Link` to guess the filenamem if it's not present
- [Both overloads] returns null if `download.Link` is null
- [Both overloads] returns nuyll if `download.RdName` is null
- [Both overloads] works for a file in a deeply nested subdirectory
- [overload with `downloadPath` argument only] creates the correct directory
2025-02-17 22:01:53 +00:00
Cucumberrbob
95ef1f42b8
Add tests for DownloadStationDownloader
Tests:
- Downloads successfully when everything goes right first time
- Downloads successfully when the 5th api call is successful after 4 failures
- Fails to download when 5 api calls fail in a row
- Fails to download if the file has already been added to `Download Station` (when `GetInfoAsync` does not error)
- FAils to download if `remotePath` cannot be parsed by `Path.GetDirectoryName()`
2025-02-17 22:01:16 +00:00
Cucumberrbob
f4ca137e83
Add tests for Torrents#RunTorrentComplete
Tests:
- doesn't run command when not present
- does run command when present
- listens to events on process for stdout/stderr
2025-02-17 22:00:57 +00:00
Cucumberrbob
3dee900be6
Add test project RdtClient.Service.Test 2025-02-17 22:00:33 +00:00