diff --git a/code/Domain/Models/Deluge/Response/TorrentStatus.cs b/code/Domain/Models/Deluge/Response/TorrentStatus.cs index a94c47a..74a539b 100644 --- a/code/Domain/Models/Deluge/Response/TorrentStatus.cs +++ b/code/Domain/Models/Deluge/Response/TorrentStatus.cs @@ -25,6 +25,9 @@ public sealed record TorrentStatus public float Ratio { get; init; } public required IReadOnlyList Trackers { get; init; } + + [JsonProperty("download_location")] + public required string DownloadLocation { get; init; } } public sealed record Tracker diff --git a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs index 9b589f5..70275a3 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs @@ -27,7 +27,8 @@ public sealed class DelugeClient "label", "seeding_time", "ratio", - "trackers" + "trackers", + "download_location" ]; public DelugeClient(IOptions config, IHttpClientFactory httpClientFactory) diff --git a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeService.cs b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeService.cs index 7598b69..cfdf1cb 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeService.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeService.cs @@ -360,7 +360,9 @@ public class DelugeService : DownloadService, IDelugeService ProcessFiles(contents?.Contents, (_, file) => { - long hardlinkCount = _hardLinkFileService.GetHardLinkCount(file.Path, !string.IsNullOrEmpty(_downloadCleanerConfig.UnlinkedIgnoredRootDir)); + string filePath = string.Join(Path.DirectorySeparatorChar, Path.Combine(download.DownloadLocation, file.Path).Split(['\\', '/'])); + + long hardlinkCount = _hardLinkFileService.GetHardLinkCount(filePath, !string.IsNullOrEmpty(_downloadCleanerConfig.UnlinkedIgnoredRootDir)); if (hardlinkCount < 0) {