Fixed post torrent %F parameter.
This commit is contained in:
parent
8114baa7b8
commit
2b39f92106
2 changed files with 11 additions and 2 deletions
|
|
@ -47,7 +47,7 @@ public class DbSettingsGeneral
|
|||
public Int32 UnpackLimit { get; set; } = 1;
|
||||
|
||||
[DisplayName("Categories")]
|
||||
[Description("Expose these categories through the QBittorrent API.")]
|
||||
[Description("Expose these categories through the QBittorrent API. Define multiple categories by separating them with a comma.")]
|
||||
public String? Categories { get; set; } = null;
|
||||
|
||||
[DisplayName("Run external program on torrent completion")]
|
||||
|
|
|
|||
|
|
@ -713,9 +713,18 @@ public class Torrents
|
|||
var downloadPath = DownloadPath(torrent);
|
||||
var torrentPath = Path.Combine(downloadPath, torrent.RdName ?? "Unknown");
|
||||
|
||||
var filePath = torrentPath;
|
||||
|
||||
var files = Directory.GetFiles(filePath);
|
||||
|
||||
if (files.Length == 1)
|
||||
{
|
||||
filePath = Path.Combine(torrentPath, files[0]);
|
||||
}
|
||||
|
||||
arguments = arguments.Replace("%N", $"\"{torrent.RdName}\"");
|
||||
arguments = arguments.Replace("%L", $"\"{torrent.Category}\"");
|
||||
arguments = arguments.Replace("%F", $"\"{torrentPath}\"");
|
||||
arguments = arguments.Replace("%F", $"\"{filePath}\"");
|
||||
arguments = arguments.Replace("%R", $"\"{downloadPath}\"");
|
||||
arguments = arguments.Replace("%D", $"\"{torrentPath}\"");
|
||||
arguments = arguments.Replace("%C", downloads.Count.ToString(CultureInfo.InvariantCulture).Replace(",", "").Replace(".", ""));
|
||||
|
|
|
|||
Loading…
Reference in a new issue