Only update specific values on models during scan

This commit is contained in:
Georges-Antoine Assi
2025-08-17 16:42:27 -04:00
parent 6bcb7da485
commit 5faa010e96
2 changed files with 7 additions and 4 deletions

View File

@@ -85,8 +85,8 @@ async def add_collection(
created_collection = db_collection_handler.update_collection(
_added_collection.id,
{
c: getattr(_added_collection, c)
for c in inspect(_added_collection).mapper.column_attrs.keys()
"path_cover_s": path_cover_s,
"path_cover_l": path_cover_l,
},
)

View File

@@ -288,12 +288,15 @@ async def _identify_rom(
_added_rom.path_cover_l = path_cover_l
_added_rom.path_screenshots = path_screenshots
_added_rom.path_manual = path_manual
# Update the scanned rom with the cover and screenshots paths and update database
db_rom_handler.update_rom(
_added_rom.id,
{
c: getattr(_added_rom, c)
for c in inspect(_added_rom).mapper.column_attrs.keys()
"path_cover_s": path_cover_s,
"path_cover_l": path_cover_l,
"path_screenshots": path_screenshots,
"path_manual": path_manual,
},
)