From: Marcel van der Veldt Date: Sat, 7 May 2022 19:38:32 +0000 (+0200) Subject: Update database.py X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=4850a7c59e6dad1388576f22689ada1b772d9a8f;p=music-assistant-server.git Update database.py --- diff --git a/music_assistant/helpers/database.py b/music_assistant/helpers/database.py index b0fbac7e..cbed055b 100755 --- a/music_assistant/helpers/database.py +++ b/music_assistant/helpers/database.py @@ -153,7 +153,11 @@ class Database: async def _migrate(self): """Perform database migration actions if needed.""" async with self.get_db() as db: - prev_version = await self.get_setting("version", db) + try: + prev_version = await self.get_setting("version", db) + except Exception: # pylint: disable=broad-except + # TODO: what exception to expect when table does not (yet) exist ? + prev_version = None if prev_version is None: prev_version = 0