From d1195240e2708224f7b1e35b934a7bbba48c4990 Mon Sep 17 00:00:00 2001 From: Sammy Spets <1011469+sammys@users.noreply.github.com> Date: Sat, 5 Jun 2021 13:47:29 +0700 Subject: [PATCH] Magnets added with a label have the label removed when magnet metadata is received --- labelplus/core/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/labelplus/core/core.py b/labelplus/core/core.py index 86f6947..3a1fabf 100644 --- a/labelplus/core/core.py +++ b/labelplus/core/core.py @@ -730,7 +730,9 @@ def on_torrent_added(self, torrent_id, from_state): label_id = self.__pending_labels.pop(torrent_id) self._set_torrent_label(torrent_id, label_id) else: - label_id = self._do_autolabel_torrent(torrent_id) + target_label_id = self._find_autolabel_match(torrent_id) + if target_label_id != labelplus.common.label.ID_NONE: + self._do_autolabel_torrent(torrent_id) if label_id != labelplus.common.label.ID_NONE: self._move_torrents([torrent_id]) @@ -752,6 +754,7 @@ def on_torrent_metadata_received(self, alert): self.on_torrent_added(torrent_id, False) self.__pending_magnet_ids.remove(torrent_id) + @check_init def on_torrent_removed(self, torrent_id):