Skip to main content

Module repair

Module repair 

Source
Expand description

Clear Invalid Content: finding item folders that are empty or broken, after Eagle’s repair tool of that name.

Eagle walks images/ and counts as invalid:

  • an <id>.info folder that isn’t a loaded item and has no metadata.json: the folder is removed;
  • a loaded item whose original file is gone (whether or not its folder holds anything else): the item is moved to the Trash (if it isn’t there already). An item whose original exists is never invalid, however few files its folder holds;
  • a loaded item whose folder has gone altogether: it drops out when the library is reloaded.

It asks first, warning that a sync tool may not have finished, then cleans up and reloads the library. falcon follows this, with one difference: an orphaned folder is handed to the caller’s discard (the app moves it to the Trash) instead of being deleted. A folder with a metadata.json that can’t be read is left alone, as Eagle leaves it (falcon reports such items when the library opens).

scan needs only a copy of the items, so it runs without the library lock; Library::clear_invalid applies a scan.

Structs§

Cleared
What Library::clear_invalid did.
InvalidScan
What a scan found.

Functions§

scan
Scans the library at root, whose loaded items are items.