jellyfin-qbittorrent-monitor: fix upload
This commit is contained in:
@@ -356,7 +356,7 @@ class JellyfinQBittorrentMonitor:
|
|||||||
elif desired_state == "throttled":
|
elif desired_state == "throttled":
|
||||||
action = (
|
action = (
|
||||||
"set alt limits "
|
"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:
|
else:
|
||||||
action = "pause torrents"
|
action = "pause torrents"
|
||||||
@@ -380,7 +380,7 @@ class JellyfinQBittorrentMonitor:
|
|||||||
if self.torrents_paused:
|
if self.torrents_paused:
|
||||||
self.resume_all_torrents()
|
self.resume_all_torrents()
|
||||||
self.torrents_paused = False
|
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)
|
self.use_alt_limits(True)
|
||||||
else:
|
else:
|
||||||
if not self.torrents_paused:
|
if not self.torrents_paused:
|
||||||
|
|||||||
@@ -287,10 +287,9 @@ pkgs.testers.runNixOSTest {
|
|||||||
assert is_throttled(), "Should be in alt speed mode during streaming"
|
assert is_throttled(), "Should be in alt speed mode during streaming"
|
||||||
dl_limit = get_alt_dl_limit()
|
dl_limit = get_alt_dl_limit()
|
||||||
ul_limit = get_alt_up_limit()
|
ul_limit = get_alt_up_limit()
|
||||||
# Upload should be minimal (1 KB/s = 1024 bytes/s)
|
# Both upload and download should get remaining bandwidth (proportional)
|
||||||
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)
|
|
||||||
assert dl_limit > 0, f"Download limit should be > 0, got {dl_limit}"
|
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
|
# Stop playback
|
||||||
playback_stop = {
|
playback_stop = {
|
||||||
|
|||||||
Reference in New Issue
Block a user