Fix double insert detection

parent 51134106
......@@ -43,10 +43,16 @@ def add_to_handymenu(user, cmd, category):
lastId = max(app['id'], lastId)
if(app['name'] == category):
for launcher in app['apps']:
if(launcher['Exec'] == cmd['Exec']):
if(launcher['cmd'] == cmd['cmd']):
alreadyIn = True
if(not alreadyIn):
app['apps'] += [cmd]
else:
print("The command '{cmd}' is already in {category} under the name : '{name}'".format(
cmd=cmd['cmd'],
category=category,
name=cmd['name']
))
found = True
if(not found):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment