diff --git a/client/src/routes/Transfers.svelte b/client/src/routes/Transfers.svelte index 30a989c..aaceefe 100644 --- a/client/src/routes/Transfers.svelte +++ b/client/src/routes/Transfers.svelte @@ -5,6 +5,8 @@ let torrents = []; let ws; let isAllPaused = false; + let totalDownloaded = 0; + let totalDownloadSpeed = 0; // Modal / player state let showModal = false; @@ -31,6 +33,8 @@ torrents = d.torrents || []; // Tüm torrentlerin pause durumunu kontrol et updateAllPausedState(); + // Toplam download miktarını ve hızını güncelle + updateTransferStats(); } }; } @@ -40,6 +44,7 @@ if (!r.ok) return; torrents = await r.json(); updateAllPausedState(); + updateTransferStats(); } async function upload(e) { @@ -121,6 +126,11 @@ isAllPaused = allPaused; } + function updateTransferStats() { + totalDownloaded = torrents.reduce((sum, t) => sum + (t.downloaded || 0), 0); + totalDownloadSpeed = torrents.reduce((sum, t) => sum + (t.downloadSpeed || 0), 0); + } + async function toggleSingleTorrent(hash) { const torrent = torrents.find(t => t.infoHash === hash); if (!torrent) return; @@ -397,7 +407,15 @@ MAGNET -