Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Quick-and-dirty hack to enable 'x of y transfers' display as per Tran…
Browse files Browse the repository at this point in the history
…smission.app.
  • Loading branch information
hawkman committed May 5, 2008
1 parent c2f3b74 commit bc8f65c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion web/javascript/transmission.js
Expand Up @@ -56,6 +56,7 @@ Transmission.prototype = {
this._num_selected_active_torrents = 0;
this._global_active_torrents = false;
this._global_paused_torrents = false;
this._total_torrents = 0;

// Pre-load the images
this.preloadImages();
Expand Down Expand Up @@ -1306,10 +1307,13 @@ Transmission.prototype = {
this._num_selected_paused_torrents = 0;
this._global_active_torrents = false;
this._global_paused_torrents = false;
this._total_torrents = 0;

// set bools for whether Transmission has active/paused torrents *anywhere*
this._global_active_torrents = data.active_torrents;
this._global_paused_torrents = data.paused_torrents;
// and the number of torrents Transmission currently has
this._total_torrents = data.total_torrents;

// If the length of the new torrent_list isn't equal to the number of torrents in
// the browser (if a torrent has been added/deleted/filtered for example), we
Expand Down Expand Up @@ -1430,7 +1434,7 @@ Transmission.prototype = {
* Set the global up and down speed in the interface
*/
setGlobalSpeeds: function(num_torrents, global_up_speed, global_down_speed) {
$('#torrent_global_transfer')[0].innerHTML = num_torrents + ' Transfers';
$('#torrent_global_transfer')[0].innerHTML = num_torrents + ' of ' + this._total_torrents + ' Transfers';
if (iPhone) {
if (global_up_speed != null) {
$('#torrent_global_upload')[0].innerHTML = 'UL: ' + Math.formatBytes(global_up_speed) + '/s';
Expand Down
7 changes: 5 additions & 2 deletions web/remote/lib/Clutch.class.php
Expand Up @@ -434,9 +434,11 @@ public function filterTorrents(
$TotalUploadRate = 0;
$ActiveTorrents = false;
$PausedTorrents = false;
$TotalTorrents = 0;
foreach ($TempTorrentList as $Row) {
$TotalDownloadRate += $Row['download_speed'];
$TotalUploadRate += $Row['upload_speed'];
$TotalTorrents += 1;
if ($FilterType == $Row['state'] || $FilterType == FilterAll) {
$IdList[] = (int) $Row['id'];
}
Expand Down Expand Up @@ -501,9 +503,10 @@ public function filterTorrents(
'free_space_percent' => $FreeSpacePercent,
'total_download_rate' => $TotalDownloadRate,
'total_upload_rate' => $TotalUploadRate,
'torrent_list' => $Result,
'total_torrents' => $TotalTorrents,
'active_torrents' => $ActiveTorrents,
'paused_torrents' => $PausedTorrents
'paused_torrents' => $PausedTorrents,
'torrent_list' => $Result
);

// Store these settings for the future
Expand Down

0 comments on commit bc8f65c

Please sign in to comment.