From 3a6d603a9e02ebfde263e138e30281b91fc82384 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 (cherry picked from commit 23c741fd001582fa363c2723eff9facd3091618b) Closes #9973 --- .../Download/Clients/Transmission/TransmissionProxy.cs | 3 ++- .../Clients/Transmission/TransmissionTorrent.cs | 10 +++++++++- 2 files changed, 11 insertions(+), 2 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 @@ private TransmissionResponse GetTorrentStatus(IEnumerable hashStrings, T "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 70ab8a3b9..3552c36e9 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs @@ -1,3 +1,5 @@ +using Newtonsoft.Json; + namespace NzbDrone.Core.Download.Clients.Transmission { public class TransmissionTorrent @@ -20,6 +22,12 @@ public class TransmissionTorrent 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; } } }