fix(qbittorrent): preserve torrent metadata in incremental updates
This commit is contained in:
@@ -220,7 +220,12 @@ class QbittorrentClient:
|
||||
if fields is None:
|
||||
snap["torrents"].pop(hash_, None)
|
||||
else:
|
||||
snap["torrents"][hash_] = fields
|
||||
previous = snap["torrents"].get(hash_)
|
||||
snap["torrents"][hash_] = (
|
||||
{**previous, **fields}
|
||||
if isinstance(previous, dict) and isinstance(fields, dict)
|
||||
else fields
|
||||
)
|
||||
for hash_ in update.get("torrents_removed") or []:
|
||||
snap["torrents"].pop(hash_, None)
|
||||
categories = update.get("categories")
|
||||
|
||||
Reference in New Issue
Block a user