mirror of
https://github.com/transmission/transmission
synced 2025-02-13 01:44:40 +00:00
simplify the construction of the RPC constants object. Add a context argument to remote.
This commit is contained in:
parent
84afa05662
commit
f65c557048
1 changed files with 38 additions and 40 deletions
|
@ -6,44 +6,42 @@
|
|||
* Class TransmissionRemote
|
||||
*/
|
||||
|
||||
function RPC() { }
|
||||
//Prefs.prototype = { }
|
||||
|
||||
// Constants
|
||||
RPC._Root = '../rpc';
|
||||
RPC._DaemonVersion = 'version';
|
||||
RPC._Encryption = 'encryption';
|
||||
RPC._EncryptionPreferred = 'preferred';
|
||||
RPC._EncryptionRequired = 'required';
|
||||
RPC._UpSpeedLimit = 'speed-limit-up';
|
||||
RPC._DownSpeedLimit = 'speed-limit-down';
|
||||
RPC._DownloadDir = 'download-dir';
|
||||
RPC._PeerPort = 'peer-port';
|
||||
RPC._UpSpeedLimited = 'speed-limit-up-enabled';
|
||||
RPC._DownSpeedLimited = 'speed-limit-down-enabled';
|
||||
RPC._TurtleState = 'alt-speed-enabled';
|
||||
RPC._TurtleUpSpeedLimit = 'alt-speed-up';
|
||||
RPC._TurtleDownSpeedLimit = 'alt-speed-down';
|
||||
RPC._TurtleTimeEnabled = 'alt-speed-time-enabled';
|
||||
RPC._TurtleTimeBegin = 'alt-speed-time-begin';
|
||||
RPC._TurtleTimeEnd = 'alt-speed-time-end';
|
||||
RPC._TurtleTimeDay = 'alt-speed-time-day';
|
||||
RPC._PeerLimitGlobal = 'peer-limit-global';
|
||||
RPC._PeerLimitPerTorrent = 'peer-limit-per-torrent';
|
||||
RPC._PexEnabled = 'pex-enabled';
|
||||
RPC._DhtEnabled = 'dht-enabled';
|
||||
RPC._LpdEnabled = 'lpd-enabled';
|
||||
RPC._BlocklistEnabled = 'blocklist-enabled';
|
||||
RPC._BlocklistURL = 'blocklist-url';
|
||||
RPC._BlocklistSize = 'blocklist-size';
|
||||
RPC._UtpEnabled = 'utp-enabled';
|
||||
RPC._PeerPortRandom = 'peer-port-random-on-start';
|
||||
RPC._PortForwardingEnabled = 'port-forwarding-enabled';
|
||||
RPC._StartAddedTorrent = 'start-added-torrents';
|
||||
RPC._QueueMoveTop = 'queue-move-top';
|
||||
RPC._QueueMoveBottom = 'queue-move-bottom';
|
||||
RPC._QueueMoveUp = 'queue-move-up';
|
||||
RPC._QueueMoveDown = 'queue-move-down';
|
||||
var RPC = {
|
||||
_Root : '../rpc',
|
||||
_DaemonVersion : 'version',
|
||||
_Encryption : 'encryption',
|
||||
_EncryptionPreferred : 'preferred',
|
||||
_EncryptionRequired : 'required',
|
||||
_UpSpeedLimit : 'speed-limit-up',
|
||||
_DownSpeedLimit : 'speed-limit-down',
|
||||
_DownloadDir : 'download-dir',
|
||||
_PeerPort : 'peer-port',
|
||||
_UpSpeedLimited : 'speed-limit-up-enabled',
|
||||
_DownSpeedLimited : 'speed-limit-down-enabled',
|
||||
_TurtleState : 'alt-speed-enabled',
|
||||
_TurtleUpSpeedLimit : 'alt-speed-up',
|
||||
_TurtleDownSpeedLimit : 'alt-speed-down',
|
||||
_TurtleTimeEnabled : 'alt-speed-time-enabled',
|
||||
_TurtleTimeBegin : 'alt-speed-time-begin',
|
||||
_TurtleTimeEnd : 'alt-speed-time-end',
|
||||
_TurtleTimeDay : 'alt-speed-time-day',
|
||||
_PeerLimitGlobal : 'peer-limit-global',
|
||||
_PeerLimitPerTorrent : 'peer-limit-per-torrent',
|
||||
_PexEnabled : 'pex-enabled',
|
||||
_DhtEnabled : 'dht-enabled',
|
||||
_LpdEnabled : 'lpd-enabled',
|
||||
_BlocklistEnabled : 'blocklist-enabled',
|
||||
_BlocklistURL : 'blocklist-url',
|
||||
_BlocklistSize : 'blocklist-size',
|
||||
_UtpEnabled : 'utp-enabled',
|
||||
_PeerPortRandom : 'peer-port-random-on-start',
|
||||
_PortForwardingEnabled : 'port-forwarding-enabled',
|
||||
_StartAddedTorrent : 'start-added-torrents',
|
||||
_QueueMoveTop : 'queue-move-top',
|
||||
_QueueMoveBottom : 'queue-move-bottom',
|
||||
_QueueMoveUp : 'queue-move-up',
|
||||
_QueueMoveDown : 'queue-move-down'
|
||||
};
|
||||
|
||||
function TransmissionRemote(controller)
|
||||
{
|
||||
|
@ -210,8 +208,8 @@ TransmissionRemote.prototype =
|
|||
verifyTorrents: function(torrent_ids, callback, context) {
|
||||
this.sendTorrentActionRequests('torrent-verify', torrent_ids, callback, context);
|
||||
},
|
||||
reannounceTorrents: function(torrent_ids, callback) {
|
||||
this.sendTorrentActionRequests('torrent-reannounce', torrent_ids, callback);
|
||||
reannounceTorrents: function(torrent_ids, callback, context) {
|
||||
this.sendTorrentActionRequests('torrent-reannounce', torrent_ids, callback, context);
|
||||
},
|
||||
addTorrentByUrl: function(url, options) {
|
||||
var remote = this;
|
||||
|
|
Loading…
Reference in a new issue