mirror of
https://github.com/lutris/lutris
synced 2024-09-15 22:09:55 +00:00
No need to write to shortcut file when no shortcut is removed
This commit is contained in:
parent
3a27de7a94
commit
5158fc37eb
|
@ -108,6 +108,9 @@ def remove_shortcut(game):
|
||||||
with open(shortcut_path, "rb") as shortcut_file:
|
with open(shortcut_path, "rb") as shortcut_file:
|
||||||
shortcuts = vdf.binary_loads(shortcut_file.read())['shortcuts'].values()
|
shortcuts = vdf.binary_loads(shortcut_file.read())['shortcuts'].values()
|
||||||
other_shortcuts = [s for s in shortcuts if not matches_id(s, game)]
|
other_shortcuts = [s for s in shortcuts if not matches_id(s, game)]
|
||||||
|
# Quit early if no shortcut is removed
|
||||||
|
if len(shortcuts) == len(other_shortcuts):
|
||||||
|
return
|
||||||
updated_shortcuts = {
|
updated_shortcuts = {
|
||||||
'shortcuts': {
|
'shortcuts': {
|
||||||
str(index): elem for index, elem in enumerate(other_shortcuts)
|
str(index): elem for index, elem in enumerate(other_shortcuts)
|
||||||
|
|
Loading…
Reference in a new issue