[Label] fix torrent deletion not removes from config

when deleting a torrent, the on deletion hook deletes the torrent from
the local config but does not save the new config to disk.
note that when setting a new label to a torrent, the config does save.

Closes: https://dev.deluge-torrent.org/ticket/3545
Closes: https://github.com/deluge-torrent/deluge/pull/397
This commit is contained in:
DjLegolas 2022-08-26 02:50:13 +03:00 committed by Calum Lind
parent 6f7445be18
commit 8332d1aa39
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
1 changed files with 2 additions and 2 deletions

View File

@ -137,6 +137,7 @@ class Core(CorePluginBase):
log.debug('post_torrent_remove') log.debug('post_torrent_remove')
if torrent_id in self.torrent_labels: if torrent_id in self.torrent_labels:
del self.torrent_labels[torrent_id] del self.torrent_labels[torrent_id]
self.config.save()
# Utils # # Utils #
def clean_config(self): def clean_config(self):
@ -191,8 +192,7 @@ class Core(CorePluginBase):
"""remove a label""" """remove a label"""
check_input(label_id in self.labels, _('Unknown Label')) check_input(label_id in self.labels, _('Unknown Label'))
del self.labels[label_id] del self.labels[label_id]
self.clean_config() self.save_config()
self.config.save()
def _set_torrent_options(self, torrent_id, label_id): def _set_torrent_options(self, torrent_id, label_id):
options = self.labels[label_id] options = self.labels[label_id]