diff --git a/services/jellyfin-qbittorrent-monitor.py b/services/jellyfin-qbittorrent-monitor.py index 99f3205..f1548bb 100644 --- a/services/jellyfin-qbittorrent-monitor.py +++ b/services/jellyfin-qbittorrent-monitor.py @@ -356,7 +356,7 @@ class JellyfinQBittorrentMonitor: elif desired_state == "throttled": action = ( "set alt limits " - f"dl={int(remaining_kbs)}KB/s ul=1KB/s, enable alt speed" + f"dl={int(remaining_kbs)}KB/s ul={int(remaining_kbs)}KB/s, enable alt speed" ) else: action = "pause torrents" @@ -380,7 +380,7 @@ class JellyfinQBittorrentMonitor: if self.torrents_paused: self.resume_all_torrents() self.torrents_paused = False - self.set_alt_speed_limits(remaining_kbs, 1) + self.set_alt_speed_limits(remaining_kbs, remaining_kbs) self.use_alt_limits(True) else: if not self.torrents_paused: diff --git a/tests/jellyfin-qbittorrent-monitor.nix b/tests/jellyfin-qbittorrent-monitor.nix index eb5a474..3cb8b64 100644 --- a/tests/jellyfin-qbittorrent-monitor.nix +++ b/tests/jellyfin-qbittorrent-monitor.nix @@ -287,10 +287,9 @@ pkgs.testers.runNixOSTest { assert is_throttled(), "Should be in alt speed mode during streaming" dl_limit = get_alt_dl_limit() ul_limit = get_alt_up_limit() - # Upload should be minimal (1 KB/s = 1024 bytes/s) - assert ul_limit == 1024, f"Upload limit should be 1024 bytes/s, got {ul_limit}" - # Download limit should be > 0 (budget not exhausted for a single stream) + # Both upload and download should get remaining bandwidth (proportional) assert dl_limit > 0, f"Download limit should be > 0, got {dl_limit}" + assert ul_limit == dl_limit, f"Upload limit ({ul_limit}) should equal download limit ({dl_limit})" # Stop playback playback_stop = {