-
Notifications
You must be signed in to change notification settings - Fork 0
/
flag_previously_exported_images.sql
34 lines (30 loc) · 1.26 KB
/
flag_previously_exported_images.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- Count images that have been previously exported
SELECT COUNT(*) FROM Adobe_images AS image
JOIN Adobe_libraryImageDevelopHistoryStep AS step
WHERE image.id_local = step.image AND step.name LIKE "%Export%";
-- I think flagging corresponds to the 'pick' column in Adobe_images.
-- Evidence:
sqlite> select distinct pick from Adobe_images;
pick
0.0
-1.0
1.0
-- Flag all images that have been previously exported
UPDATE Adobe_images
SET pick = 1.0
WHERE id_local IN
(SELECT image.id_local FROM Adobe_images AS image
JOIN Adobe_libraryImageDevelopHistoryStep AS step
WHERE image.id_local = step.image AND step.name LIKE "Export%");
-- Alternate queries for working with older lightroom catalogs
-- Count images that have been previously edited
SELECT COUNT(DISTINCT image.id_local) FROM Adobe_images AS image
JOIN Adobe_libraryImageDevelopHistoryStep AS step
WHERE image.id_local = step.image AND step.name NOT LIKE "Import%" AND step.name <> "Synchronize Settings";
-- Flag all images that have been previously edited
UPDATE Adobe_images
SET pick = 1.0
WHERE id_local IN
(SELECT DISTINCT image.id_local FROM Adobe_images AS image
JOIN Adobe_libraryImageDevelopHistoryStep AS step
WHERE image.id_local = step.image AND step.name NOT LIKE "Import%" AND step.name <> "Synchronize Settings");