Commit graph

26 commits

Author SHA1 Message Date
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