From 25b214c0d7c6c27ef69eb3c8dc97db17a710be9d Mon Sep 17 00:00:00 2001 From: chrispr Date: Sun, 13 Oct 2024 21:57:13 -0400 Subject: [PATCH] Fixed appSettings name to work on linux; Set newly added torrent's seed mode and ratio --- MassTorrentAdd/Program.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MassTorrentAdd/Program.cs b/MassTorrentAdd/Program.cs index 7b23aa1..7958581 100644 --- a/MassTorrentAdd/Program.cs +++ b/MassTorrentAdd/Program.cs @@ -22,7 +22,7 @@ namespace MassTorrentAdd var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); + .AddJsonFile("appSettings.json", optional: false, reloadOnChange: true); IConfigurationRoot configuration = builder.Build(); transmissionHost = configuration.GetValue("transmissionURI"); @@ -94,6 +94,14 @@ namespace MassTorrentAdd Metainfo = Convert.ToBase64String(torrentFileData) }; var torrentInfo = transmissionClient.TorrentAdd(newTorrent); + var seedSettings = new Transmission.API.RPC.Arguments.TorrentSettings() + { + SeedRatioLimit = 1.0, + SeedRatioMode = 1, + IDs = [torrentInfo.ID] + }; + + transmissionClient.TorrentSet(seedSettings); //transmissionClient.TorrentVerify(new object[] { torrentInfo.ID }); }