Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/scripts/bittorrent/qbittorrent/qbittorrentservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export class QBittorrentClient extends TorrentClient<QBittorrentTorrent> {
all: [],
changed: [],
deleted: [],
freeDiskSpace: 0
};

if (Array.isArray(data.categories) || Array.isArray(data.labels)) {
torrents.labels = data.categories || data.labels;
} else if (typeof data.categories === "object") {
Expand All @@ -97,6 +97,9 @@ export class QBittorrentClient extends TorrentClient<QBittorrentTorrent> {
}

torrents.deleted = data.torrents_removed || [];
if (data.full_update) {
torrents.freeDiskSpace = data.server_state.free_space_on_disk;
}
return torrents;
}

Expand Down
1 change: 1 addition & 0 deletions src/scripts/bittorrent/torrentclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface TorrentUpdates {
all?: any[],
changed?: any[],
deletes?: [],
freeDiskSpace?: number
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/controllers/torrents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export let torrentsController = ["$rootScope", "$scope", "$timeout", "$filter",
$scope.totalUploadSpeed = 0;
$scope.totalDownloaded = 0;
$scope.totalUploaded = 0;
$scope.freeDiskSpace = 0;
$scope.contextMenu = null;
$scope.showDragAndDrop = false;
$scope.labelsDrowdown = null;
Expand Down Expand Up @@ -532,6 +533,7 @@ export let torrentsController = ["$rootScope", "$scope", "$timeout", "$filter",
changeTorrents(torrents);
updateLabels(torrents);
updateTrackers(torrents);
$scope.freeDiskSpace = torrents.freeDiskSpace > 0 ? torrents.freeDiskSpace : $scope.freeDiskSpace;
}).then(function() {
if (!$scope.arrayTorrents || $scope.arrayTorrents.length === 0) {
$scope.renderDone()
Expand Down
6 changes: 6 additions & 0 deletions src/views/torrents.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ <h2 class="ui center aligned icon header">
<i class="ui orange arrow up icon"></i>
{{ totalUploadSpeed | speed }} <span ng-if="totalUploaded">({{ totalUploaded | bytes:2 }})</span>
</div>
<ng-container ng-if="$server.client == 'qbittorrent'">
<div class="free-disk-space" ></div>
<i class="ui grey disk outline icon"></i>
{{ freeDiskSpace | bytes:2 }}
</div>
</ng-container>
</div>
</div>

Expand Down
Loading