From 9bd6d94c6c8a8c9cc51c0c564deb82cad9eda6fe Mon Sep 17 00:00:00 2001 From: Sergio Costas Date: Sat, 8 Feb 2025 19:53:38 +0100 Subject: [PATCH] Change to menu defaults if files not found on open When opening an old devede project, if the background picture or music files aren't there, an exception would happen. This can happen even with the defaults, because in the last version, they were migrated into a different folder. Now, if the files aren't found, the new defaults will be used. --- src/devedeng/dvd_menu.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/devedeng/dvd_menu.py b/src/devedeng/dvd_menu.py index 09f2216..6b36f2d 100644 --- a/src/devedeng/dvd_menu.py +++ b/src/devedeng/dvd_menu.py @@ -673,4 +673,10 @@ class dvd_menu(devedeng.interface_manager.interface_manager): def restore_menu(self, data): + # check that the menu's background picture and music are there + if ('background_picture' in data) and (not os.path.exists(data['background_picture'])): + data['background_picture'] = self.default_background + if ('background_music' in data) and (not os.path.exists(data['background_music'])): + data['background_music'] = self.default_sound + self.unserialize(data)