Published 2025-09-05
Collect artwork from archived data.


This is a port of CustomerSpecific/InspiredThinking/collectArtwork.js.
js reads pdf directory in this order: first *.pdf then *.PDF and does not sort the resulting list.
dart reads pdf directory (*.pdf, case-insensitive), then sorts the list on full path (case-insensitive).
js gets the first matching file (regardless of any path sorting). Gives random results because it depends on the order the files were read from disk.
dart gets the last matching file (takes any logical sorting into account like 'highest ordernumber' when it is part of the path), so will most likely find the newest file or at least does not generate random results.
js does not output anything if a file was found in the given existing pdf folder.
dart mentions the folder name where a file was found (both from 'archive' or 'existing' folder).
js repeats the same file over-and-over in the Location Artwork.txt log file.
dart states each found file only once in the Location Artwork.txt log file.
js repeats the same missing file over-and-over in the Missing Artwork.txt log file.
dart states each missing file only once in the Missing Artwork.txt log file.
js does not check if multiple files for the same match have equal file content.
dart does check if multiple files for the same match have equal file content (sha256 hash).
sal number, any other text in a filename is redundant and could/should be removed, so we can store all files in a single folder (or database), thus preventing any confusion about what file (version) is used.file_picker dependency.