Skip to content

Commit

Permalink
Fixed status for uTorrent 2.2.1 resolves #27
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanix committed Dec 2, 2016
1 parent 437db36 commit 5e58ad6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions scripts/bittorrent/abstracttorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,26 @@ angular.module('torrentApp').factory('AbstractTorrent', function() {
}
};

AbstractTorrent.prototype.manualStatusText = function () {
if (this.isStatusPaused()){
return 'Paused';
} else if (this.isStatusStopped()){
return 'Stopped';
} else if (this.isStatusSeeding()){
return 'Seeding';
} else if (this.isStatusDownloading()){
return 'Downloading';
} else if (this.isStatusError()){
return 'Error';
} else if (this.isStatusCompleted()){
return 'Finished';
} else {
return 'Unknown';
}
};

AbstractTorrent.prototype.statusText = function () {
if (!this.statusMessage) return this.manualStatusText();
return this.statusMessage.replace(statusRegex, '');
};

Expand Down
2 changes: 1 addition & 1 deletion scripts/bittorrent/utorrent/torrentu.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ angular.module('torrentApp').factory('TorrentU', ['AbstractTorrent', function(Ab
this.rssFeedUrl = rssFeedUrl;
this.appUpdateUrl = appUpdateUrl;
this.additionalData = additionalData;

}

// Inherit by prototypal inheritance
Expand Down

0 comments on commit 5e58ad6

Please sign in to comment.