mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 00:48:41 +00:00
Save the execute config after adding/removing/saving commands
This commit is contained in:
parent
0314d0440f
commit
b7e1fe1696
1 changed files with 3 additions and 0 deletions
|
@ -123,6 +123,7 @@ class Core(CorePluginBase):
|
||||||
def add_command(self, event, command):
|
def add_command(self, event, command):
|
||||||
command_id = hashlib.sha1(str(time.time())).hexdigest()
|
command_id = hashlib.sha1(str(time.time())).hexdigest()
|
||||||
self.config["commands"].append((command_id, event, command))
|
self.config["commands"].append((command_id, event, command))
|
||||||
|
self.config.save()
|
||||||
component.get("EventManager").emit(ExecuteCommandAddedEvent(command_id, event, command))
|
component.get("EventManager").emit(ExecuteCommandAddedEvent(command_id, event, command))
|
||||||
|
|
||||||
@export
|
@export
|
||||||
|
@ -136,6 +137,7 @@ class Core(CorePluginBase):
|
||||||
self.config["commands"].remove(command)
|
self.config["commands"].remove(command)
|
||||||
component.get("EventManager").emit(ExecuteCommandRemovedEvent(command_id))
|
component.get("EventManager").emit(ExecuteCommandRemovedEvent(command_id))
|
||||||
break
|
break
|
||||||
|
self.config.save()
|
||||||
|
|
||||||
@export
|
@export
|
||||||
def save_command(self, command_id, event, cmd):
|
def save_command(self, command_id, event, cmd):
|
||||||
|
@ -143,3 +145,4 @@ class Core(CorePluginBase):
|
||||||
if command[EXECUTE_ID] == command_id:
|
if command[EXECUTE_ID] == command_id:
|
||||||
self.config["commands"][i] = (command_id, event, cmd)
|
self.config["commands"][i] = (command_id, event, cmd)
|
||||||
break
|
break
|
||||||
|
self.config.save()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue