Skip to content

LAVA re-export into the same folder keeps earlier media and undercounts what the report holds #243

Closed

Description

@abrignoni

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

  1. added a commit that references this issue on Oct 1, 2026
    1809a55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions