From 526b2fc5a2ce8844d739c6db4e47d6a1be85cdcf Mon Sep 17 00:00:00 2001 From: NoCrypt <57245077+NoCrypt@users.noreply.github.com> Date: Wed, 24 Jul 2024 23:38:25 +0700 Subject: [PATCH] feat: option to seperate DL and UL --- common/modules/util.js | 6 ++-- common/modules/webtorrent.js | 4 +-- common/views/Settings/TorrentSettings.svelte | 29 +++++++++++++++++++- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/common/modules/util.js b/common/modules/util.js index 8857420..3ed3394 100644 --- a/common/modules/util.js +++ b/common/modules/util.js @@ -128,8 +128,10 @@ export const defaults = { playerDeband: false, rssQuality: '1080', rssFeedsNew: SUPPORTS.extensions ? [['New Releases', 'SubsPlease']] : [], - rssAutoplay: true, - torrentSpeed: 5, + torrentSpeed: 5, // legacy + downloadSpeed: 5, + uploadSpeed: 1, + slowSeeding: true, torrentPersist: false, torrentDHT: false, torrentPeX: false, diff --git a/common/modules/webtorrent.js b/common/modules/webtorrent.js index 45d4d07..3065c1a 100644 --- a/common/modules/webtorrent.js +++ b/common/modules/webtorrent.js @@ -47,8 +47,8 @@ export default class TorrentClient extends WebTorrent { super({ dht: !settings.torrentDHT, maxConns: settings.maxConns, - downloadLimit: settings.torrentSpeed * 1048576 || 0, - uploadLimit: settings.torrentSpeed * 1572864 || 0, // :trolled: + downloadLimit: settings.downloadSpeed * 1048576 || 0, + uploadLimit: (settings.slowSeeding ? 1048576 : (settings.uploadSpeed * 1048576)) || 0, torrentPort: settings.torrentPort || 0, dhtPort: settings.dhtPort || 0, natUpnp: SUPPORTS.permamentNAT ? 'permanent' : true diff --git a/common/views/Settings/TorrentSettings.svelte b/common/views/Settings/TorrentSettings.svelte index 4992dc0..19a3b18 100644 --- a/common/views/Settings/TorrentSettings.svelte +++ b/common/views/Settings/TorrentSettings.svelte @@ -172,7 +172,7 @@ MB/s - + --> @@ -198,3 +198,30 @@ + + +

Limited Bandwidth Settings

+ +
+ + +
+
+ +
+ +
+ MB/s +
+
+
+{#if !settings.slowSeeding} + +
+ +
+ MB/s +
+
+
+ {/if}