Permalink
Browse files

Merge pull request #43 from robgmills/feat/free-space

Add free-space RPC call
  • Loading branch information...
2 parents 31eabad + 7ab5005 commit bdb6d2bbdd1dee9fdf606d35334384b37602bda3 @FLYBYME committed on GitHub Jan 25, 2017
Showing with 21 additions and 2 deletions.
  1. +8 −0 README.md
  2. +12 −1 lib/transmission.js
  3. +1 −1 package.json
View
@@ -206,6 +206,14 @@ Get client session stats.
transmission.sessionStats(function(err, arg){});
```
+### transmission.freeSpace(path, callback)
+
+Get free space available on the server for the specified directory.
+
+```js
+transmission.freeSpace(path, function(err, arg){});
+```
+
### All together.
```js
View
@@ -413,6 +413,16 @@ Transmission.prototype.sessionStats = function (callback) {
this.callServer(options, callback);
};
+Transmission.prototype.freeSpace = function (path, callback) {
+ this.callServer({
+ arguments: {
+ path: path
+ },
+ method: this.methods.other.freeSpace
+ }, callback);
+ return this;
+};
+
Transmission.prototype.callServer = function (query, callBack) {
var self = this;
var queryJsonify = JSON.stringify(query);
@@ -574,6 +584,7 @@ Transmission.prototype.methods = {
},
other: {
blockList: 'blocklist-update',
- port: 'port-test'
+ port: 'port-test',
+ freeSpace: 'free-space'
}
};
View
@@ -5,7 +5,7 @@
],
"name": "transmission",
"description": "API client for transmissionbt",
- "version": "0.4.8",
+ "version": "0.4.9",
"scripts": {
"test": "mocha --ui bdd --reporter spec --colors --slow 10000"
},

0 comments on commit bdb6d2b

Please sign in to comment.