Fixed appSettings name to work on linux; Set newly added torrent's seed mode and ratio
This commit is contained in:
@@ -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<String>("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 });
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user