fixed missing download location

This commit is contained in:
Flaminel
2025-03-26 02:05:05 +02:00
parent 4b38a6fee1
commit ac086fcd47
3 changed files with 8 additions and 2 deletions
@@ -25,6 +25,9 @@ public sealed record TorrentStatus
public float Ratio { get; init; } public float Ratio { get; init; }
public required IReadOnlyList<Tracker> Trackers { get; init; } public required IReadOnlyList<Tracker> Trackers { get; init; }
[JsonProperty("download_location")]
public required string DownloadLocation { get; init; }
} }
public sealed record Tracker public sealed record Tracker
@@ -27,7 +27,8 @@ public sealed class DelugeClient
"label", "label",
"seeding_time", "seeding_time",
"ratio", "ratio",
"trackers" "trackers",
"download_location"
]; ];
public DelugeClient(IOptions<DelugeConfig> config, IHttpClientFactory httpClientFactory) public DelugeClient(IOptions<DelugeConfig> config, IHttpClientFactory httpClientFactory)
@@ -360,7 +360,9 @@ public class DelugeService : DownloadService, IDelugeService
ProcessFiles(contents?.Contents, (_, file) => 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) if (hardlinkCount < 0)
{ {