diff --git a/web/javascript/torrent.js b/web/javascript/torrent.js index f66404daa..51e215cde 100644 --- a/web/javascript/torrent.js +++ b/web/javascript/torrent.js @@ -18,6 +18,10 @@ Torrent._StatusSeeding = 8; Torrent._StatusPaused = 16; Torrent._InfiniteTimeRemaining = 215784000; // 999 Hours - may as well be infinite +Torrent._RatioUseGlobal = 0; +Torrent._RatioUseLocal = 1; +Torrent._RatioUnlimited = 2; + Torrent.prototype = { /* @@ -201,6 +205,13 @@ Torrent.prototype = this.fileList().show(); }, hideFileList: function() { this.fileList().hide(); }, + seedRatio: function(){ + switch( this._seed_ratio_mode ) { + case Torrent._RatioUseGlobal: return this._controller.seedRatio(); + case Torrent._RatioUseLocal: return this._seed_ratio_limit; + default: return -1; + } + }, /*-------------------------------------------- * @@ -294,7 +305,9 @@ Torrent.prototype = this._leftUntilDone = data.leftUntilDone; this._download_total = data.downloadedEver; this._upload_total = data.uploadedEver; - this._upload_ratio = data.uploadRatio + this._upload_ratio = data.uploadRatio; + this._seed_ratio_limit = data.seedRatioLimit; + this._seed_ratio_mode = data.seedRatioMode; this._download_speed = data.rateDownload; this._upload_speed = data.rateUpload; this._peers_connected = data.peersConnected; diff --git a/web/javascript/transmission.remote.js b/web/javascript/transmission.remote.js index ff34a92ca..8a33d232e 100644 --- a/web/javascript/transmission.remote.js +++ b/web/javascript/transmission.remote.js @@ -107,7 +107,8 @@ TransmissionRemote.prototype = 'isPrivate', 'leechers', 'leftUntilDone', 'name', 'peersConnected', 'peersGettingFromUs', 'peersSendingToUs', 'rateDownload', 'rateUpload', 'seeders', 'sizeWhenDone', - 'status', 'swarmSpeed', 'totalSize', 'uploadedEver', 'uploadRatio', + 'status', 'swarmSpeed', 'totalSize', + 'uploadedEver', 'uploadRatio', 'seedRatioLimit', 'seedRatioMode', 'downloadDir', 'files', 'fileStats' ] } }; @@ -127,7 +128,8 @@ TransmissionRemote.prototype = 'eta', 'haveUnchecked', 'haveValid', 'leechers', 'leftUntilDone', 'peersConnected', 'peersGettingFromUs', 'peersSendingToUs', 'rateDownload', 'rateUpload', 'recheckProgress', 'seeders', - 'sizeWhenDone', 'status', 'swarmSpeed', 'uploadedEver', 'uploadRatio', + 'sizeWhenDone', 'status', 'swarmSpeed', + 'uploadedEver', 'uploadRatio', 'seedRatioLimit', 'seedRatioMode', 'downloadDir' ] } };