You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LAVA re-export into the same folder keeps earlier media and undercounts what the report holds #243
Exporting LAVA into a folder that already holds a LAVA export keeps the earlier media/ and _HTML/media/ files. The database is recreated, the media folders are not cleared (lava.py#L196), and a file already present is not copied again (lava.py#L295). Two things follow.
A narrower re-export leaves the wider export's media in the folder. On main (8cf26e7), with a copy of a small case exported three times into one folder:
export
run log "Media files written"
files in media/
referenced by the database
in media/, not referenced
1, all files
31
31
31
0
2, same scope again
1
31
31
0
3, three files only
0
31
3
28
After the third export the folder still carries 28 files the report does not list, in both media/ and _HTML/media/. Anyone who exports only the categorized files into a folder that held a full export hands over more than they meant to.
The run log count reads as the report's size. "Media files written" (lava.py#L1615) counts only files placed during that run. On a real re-export it said 13 while the report held 86.
Possible fixes: clear or refuse a non-empty destination (or remove media the new database does not reference), and report the media the export holds, with "written this run" as a separate line if it is useful.
Activity
Clear an earlier LAVA export's media before re-exporting into its folder