[core] Avoid unnecessary disk writes when assets didn't change

This commit is contained in:
derrod 2021-12-29 20:29:07 +01:00
parent 6fb6bb14a4
commit 2adc0b1a3e

View file

@ -335,7 +335,7 @@ class LegendaryCore:
return []
if self.lgd.assets:
assets = self.lgd.assets
assets = self.lgd.assets.copy()
else:
assets = dict()
@ -346,6 +346,8 @@ class LegendaryCore:
]
})
# only save (and write to disk) if there were changes
if self.lgd.assets != assets:
self.lgd.assets = assets
return self.lgd.assets[platform]