mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 23:06:11 +00:00
fix filesize reset on partial scan
This commit is contained in:
@@ -340,6 +340,10 @@ async def _identify_rom(
|
||||
for new_rom_file in new_rom_files:
|
||||
db_rom_handler.add_rom_file(new_rom_file)
|
||||
|
||||
# Short circuit if the scan type is hashes
|
||||
if scan_type == ScanType.HASHES:
|
||||
return
|
||||
|
||||
if _added_rom.ra_metadata:
|
||||
for ach in _added_rom.ra_metadata.get("achievements", []):
|
||||
# Store both normal and locked version
|
||||
|
||||
@@ -289,21 +289,27 @@ async def scan_rom(
|
||||
newly_added: bool,
|
||||
socket_manager: socketio.AsyncRedisManager | None = None,
|
||||
) -> Rom:
|
||||
filesize = sum([file.file_size_bytes for file in fs_rom["files"]])
|
||||
rom_attrs = {
|
||||
"platform_id": platform.id,
|
||||
"name": fs_rom["fs_name"],
|
||||
"fs_name": fs_rom["fs_name"],
|
||||
"crc_hash": fs_rom["crc_hash"],
|
||||
"md5_hash": fs_rom["md5_hash"],
|
||||
"sha1_hash": fs_rom["sha1_hash"],
|
||||
"ra_hash": fs_rom["ra_hash"],
|
||||
"fs_size_bytes": filesize,
|
||||
"url_cover": "",
|
||||
"url_manual": "",
|
||||
"url_screenshots": [],
|
||||
}
|
||||
|
||||
if len(fs_rom["files"]) > 0:
|
||||
filesize = sum([file.file_size_bytes for file in fs_rom["files"]])
|
||||
rom_attrs.update(
|
||||
{
|
||||
"crc_hash": fs_rom["crc_hash"],
|
||||
"md5_hash": fs_rom["md5_hash"],
|
||||
"sha1_hash": fs_rom["sha1_hash"],
|
||||
"ra_hash": fs_rom["ra_hash"],
|
||||
"fs_size_bytes": filesize,
|
||||
}
|
||||
)
|
||||
|
||||
if rom:
|
||||
rom_attrs.update(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user