Function out_of_date

Source
pub fn out_of_date(audio: &Path, picture: &Path) -> bool
Expand description

true when the picture has to be drawn: it is missing, or it is older than the music it describes.

Both dates are read from the disk, not from the catalog. The catalog remembers when it last read a file, which is a different fact and the wrong one here: the question is whether this picture was drawn from the bytes that are there now, and a library edited since the last scan would otherwise keep pictures of music nobody has any more.

The modification date rather than a checksum, because it is the same test the incremental scan uses, and because a picture is cheap to redraw and expensive to verify. A run over a library that has not changed draws nothing at all, which is what makes the command safe to repeat.