Open fxstein opened 2 years ago
Shell version of SQLite query:
sqlite3 -readonly ~/Pictures/Photos\ Library.photoslibrary/database/Photos.sqlite "SELECT zAddAssetAttr.ZORIGINALFILENAME AS 'zAddAssetAttr-Original Filename' FROM ZASSET zAsset JOIN ZADDITIONALASSETATTRIBUTES zAddAssetAttr ON zAddAssetAttr.Z_PK = zAsset.ZADDITIONALATTRIBUTES WHERE zAsset.ZTRASHEDSTATE = 1 ORDER BY zAddAssetAttr.ZORIGINALFILENAME;"
Imported and processed files of
goprox
are mainly imported into other image and video processing platforms. For images, a common path is to import all processed files into Apple Photos. This allows for easy browsing, filtering, and sorting (based on goprox metadata and tags). Once imported it is very common to review the images for favorites, decent shots as well as outright junk. Often bad images get deleted quickly from Photos to reduce the amount of overhead to photo libraries.Once deleted - sometimes as much as 80-90% of imported images, the problem becomes that the goprox library continues to hold the deleted images and future imports create the problem of re-importing previously deleted images, especially after 30-40 days when the deleted items list in Photos gets purged.
However it is this list of deleted items, that is programmatically available via Photos internal SQLite database for said 30-40 days. As such it would be easy to extract the list of deleted images and media files from photos, apply some filters and in return remove them from the processed or even imported library paths. The originals would still be available in the original SDcard images if there is ever a need to recover a deleted file.
In order to make this permanent,
goprox
will need to keep an ever-growing list of deleted media files and eliminate them from future processing as well as from the current library storage.The Photos SQLite store is commonly found here:
~/Pictures/Photos\ Library.photoslibrary/database/Photos.sqlite
The query to extract recently deleted media files from Photos would be like this:
and results in something like this:
It contains any recently deleted media files and would need to be filtered for goprox specific files.
To store the list of deleted files a new
deleted
substructure would need to be introduced as part of the library. Deleted images could be grouped into list files by year for ease of processing.