revert split js
This commit is contained in:
gru
2026-05-31 13:07:06 +02:00
parent b6a5003f2c
commit 6b8321e6e6
31 changed files with 253 additions and 148 deletions
+10 -1
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
import time
from .client import *
from .files import set_file_priorities
from .system import disk_usage_for_default_path
@@ -214,6 +216,7 @@ TORRENT_FIELDS = [
]
TORRENT_OPTIONAL_FIELDS = [
"d.timestamp.last_active=",
"d.timestamp.finished=",
]
@@ -252,7 +255,12 @@ def normalize_row(row: list) -> dict:
directory = str(row[14] or "")
base_path = str(row[15] or "")
is_multi_file = int(row[22] or 0) if len(row) > 22 else 0
completed_at = int(row[23] or 0) if len(row) > 23 else 0
# Note: Last activity is optional because older rTorrent builds may not expose this timestamp.
last_activity = int(row[23] or 0) if len(row) > 23 else 0
if not last_activity and (down_rate > 0 or up_rate > 0):
# Note: rTorrent builds without d.timestamp.last_active still expose live rates, so active rows get a safe current timestamp.
last_activity = int(time.time())
completed_at = int(row[24] or 0) if len(row) > 24 else 0
# Show the selected download location only. Hide the torrent root
# directory for multi-file torrents and the filename for single-file
@@ -310,6 +318,7 @@ def normalize_row(row: list) -> dict:
"priority": int(row[13] or 0),
"path": display_path,
"created": int(row[16] or 0),
"last_activity": last_activity,
"completed_at": completed_at,
"label": str(row[17] or ""),
"ratio_group": str(row[18] or ""),