-
Notifications
You must be signed in to change notification settings - Fork 3
/
rTorrentModel.cs
executable file
·54 lines (44 loc) · 1.48 KB
/
rTorrentModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System.Collections.Generic;
namespace rTorrentLib.Model
{
public class TorrentCommand
{
public string Command { get; }
public string[] Parameters { get; }
public TorrentCommand(string command, params string[] parameters)
{
Command = command;
Parameters = parameters;
}
}
public class TorrentDMultiCallCommand : TorrentCommand
{
public string View { get; }
public TorrentDMultiCallCommand(string view = "main", params string[] parameters):
base("d.multicall2", AddParameters(view, parameters))
{
View = view;
}
private static string[] AddParameters(string view, string[] parameters)
{
var parametersBase = new List<string> { "", view };
parametersBase.AddRange(parameters);
return parametersBase.ToArray();
}
}
public class TorrentFMultiCallCommand : TorrentCommand
{
public string Hash { get; }
public TorrentFMultiCallCommand(string hash, params string[] parameters):
base("f.multicall", AddParameters(hash, parameters))
{
Hash = hash;
}
private static string[] AddParameters(string hash, string[] parameters)
{
var parametersBase = new List<string> { hash, "" };
parametersBase.AddRange(parameters);
return parametersBase.ToArray();
}
}
}