From 23c741fd001582fa363c2723eff9facd3091618b Mon Sep 17 00:00:00 2001 From: Mika <1054229+mikabytes@users.noreply.github.com> Date: Sun, 5 May 2024 03:53:47 +0200 Subject: [PATCH] Add file-count for Transmission RPC --- .../Clients/Transmission/TransmissionProxy.cs | 3 ++- .../Clients/Transmission/TransmissionTorrent.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs index 2c53f103b..45190fb16 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs @@ -178,7 +178,8 @@ namespace NzbDrone.Core.Download.Clients.Transmission "seedRatioMode", "seedIdleLimit", "seedIdleMode", - "fileCount" + "fileCount", + "file-count" }; var arguments = new Dictionary(); diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs index e72fa55a7..3552c36e9 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs @@ -1,4 +1,6 @@ -namespace NzbDrone.Core.Download.Clients.Transmission +using Newtonsoft.Json; + +namespace NzbDrone.Core.Download.Clients.Transmission { public class TransmissionTorrent { @@ -20,6 +22,12 @@ public int SeedRatioMode { get; set; } public long SeedIdleLimit { get; set; } public int SeedIdleMode { get; set; } - public int FileCount { get; set; } + public int FileCount => TransmissionFileCount ?? VuzeFileCount ?? 0; + + [JsonProperty(PropertyName = "file-count")] + public int? TransmissionFileCount { get; set; } + + [JsonProperty(PropertyName = "fileCount")] + public int? VuzeFileCount { get; set; } } }