Adjust torrent status logic, Remove debug info

This commit is contained in:
John F
2015-05-07 22:49:21 -04:00
parent 27ee683ac2
commit 7b912be7fd
7 changed files with 19 additions and 11 deletions
+2 -6
View File
@@ -233,8 +233,7 @@ client.prototype.getTorrentList = function(callback) {
if (torrent['isHashChecking'] === '1') {
torrentStatus.push('is-checking');
} else if (torrent['isComplete'] === '1' && torrent['isOpen'] === '1' && torrent['state'] === '1') {
// torrentStatus.push('is-seeding');
torrentStatus.push('is-completed');
torrentStatus.push('is-seeding');
} else if (torrent['isComplete'] === '1' && torrent['isOpen'] === '1' && torrent['state'] === '0') {
torrentStatus.push('is-paused');
} else if (torrent['isComplete'] === '1' && torrent['isOpen'] === '0' && torrent['state'] === '0') {
@@ -291,12 +290,9 @@ client.prototype.stopTorrent = function(hash, callback) {
hash = [hash];
}
console.log('stopping: ' + hash);
for (i = 0, len = hash.length; i < len; i++) {
rTorrent.get('d.stop', [hash[i]]).then(function(data) {
console.log('success: ' + data);
rTorrent.get('d.close', [hash[i]]).then(function(data) {
callback(null, data);
}, function(error) {
callback(error, null);
-1
View File
@@ -16,7 +16,6 @@ rtorrent.get = function(api, array) {
try {
xml = Serializer.serializeMethodCall(api, array);
console.log(xml);
} catch (error) {
console.trace(error);
}
+2 -2
View File
@@ -31911,10 +31911,10 @@ var Torrent = React.createClass({displayName: "Torrent",
'is-stopped': torrent.status.indexOf('is-stopped') > -1,
'is-paused': torrent.status.indexOf('is-paused') > -1,
'is-downloading': torrent.status.indexOf('is-downloading') > -1,
// 'is-seeding': torrent.status.indexOf('is-seeding') > -1,
'is-seeding': torrent.status.indexOf('is-seeding') > -1,
'is-completed': torrent.status.indexOf('is-completed') > -1,
'is-checking': torrent.status.indexOf('is-checking') > -1,
'is-active': torrent.status.indexOf('is-active'),
'is-active': torrent.status.indexOf('is-active') > -1,
'is-inactive': torrent.status.indexOf('is-inactive') > -1
});
+4
View File
@@ -816,6 +816,10 @@ body {
-webkit-transition: background 0.25s, width 0.25s;
-o-transition: background 0.25s, width 0.25s;
transition: background 0.25s, width 0.25s; }
.is-completed .progress-bar__fill {
background: #5b585c; }
.is-seeding .progress-bar__fill {
background: #385f7d; }
.is-stopped .progress-bar__fill {
background: #5b585c; }
+8
View File
@@ -9,6 +9,14 @@
height: 100%;
transition: background 0.25s, width 0.25s;
.is-completed & {
background: $progress-bar--fill--stopped;
}
.is-seeding & {
background: $progress-bar--fill--completed;
}
.is-stopped & {
background: $progress-bar--fill--stopped;
}
+1
View File
@@ -51,6 +51,7 @@ $progress-bar--background: #28242a;
$progress-bar--fill: #0e8761;
$progress-bar--fill--stopped: desaturate(lighten($progress-bar--background, 20%), 5%);
$progress-bar--fill--completed: #385f7d;
// modal windows
@@ -29,10 +29,10 @@ var Torrent = React.createClass({
'is-stopped': torrent.status.indexOf('is-stopped') > -1,
'is-paused': torrent.status.indexOf('is-paused') > -1,
'is-downloading': torrent.status.indexOf('is-downloading') > -1,
// 'is-seeding': torrent.status.indexOf('is-seeding') > -1,
'is-seeding': torrent.status.indexOf('is-seeding') > -1,
'is-completed': torrent.status.indexOf('is-completed') > -1,
'is-checking': torrent.status.indexOf('is-checking') > -1,
'is-active': torrent.status.indexOf('is-active'),
'is-active': torrent.status.indexOf('is-active') > -1,
'is-inactive': torrent.status.indexOf('is-inactive') > -1
});