mirror of
https://github.com/rommapp/romm.git
synced 2026-02-19 07:50:57 +01:00
Catch and ignore json decode errors in migration
This commit is contained in:
@@ -63,9 +63,14 @@ def upgrade() -> None:
|
||||
|
||||
# Add "roms/" prefix to each path in path_screenshots
|
||||
if path_screenshots:
|
||||
path_screenshots_list = json.loads(path_screenshots)
|
||||
path_screenshots_list = [f"roms/{path}" for path in path_screenshots_list]
|
||||
path_screenshots = json.dumps(path_screenshots_list)
|
||||
try:
|
||||
path_screenshots_list = json.loads(path_screenshots)
|
||||
path_screenshots_list = [
|
||||
f"roms/{path}" for path in path_screenshots_list
|
||||
]
|
||||
path_screenshots = json.dumps(path_screenshots_list)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
|
||||
# Update the database with the new paths
|
||||
connection.execute(
|
||||
|
||||
Reference in New Issue
Block a user