Added --not-edited option to query | Added corresponding tests for query and export (#956)

* Added --not-edited option to query

Added --not-edited option to query (exclusive with --edited) to search for photos that have not been edited.

Added test scenarios for --edited and -.-not-edited

* Added --not-edited option to query

Added --not-edited option to query (exclusive with --edited) to search for photos that have not been edited.

Added query test scenarios for --edited and --not-edited

Added export test scenarios for --edited and --not-edited

* Added --not-edited option to query

Added --not-edited option to query (exclusive with --edited) to search for photos that have not been edited.

Added query test scenarios for --edited and --not-edited

Added export test scenarios for --edited and --not-edited

* Made edited/non-edited mutually exclusive in query() to match other filters

Co-authored-by: Rhet Turnbull <rturnbull@gmail.com>
This commit is contained in:
oPromessa
2023-01-25 04:11:47 +00:00
committed by GitHub
parent 7f7e58a1bd
commit 80ee142c7f
6 changed files with 116 additions and 1 deletions

View File

@@ -289,6 +289,7 @@ def QUERY_OPTIONS(f):
help="Case insensitive search for title, description, place, keyword, person, or album.",
),
o("--edited", is_flag=True, help="Search for photos that have been edited."),
o("--not-edited", is_flag=True, help="Search for photos that have not been edited."),
o(
"--external-edit",
is_flag=True,

View File

@@ -805,6 +805,7 @@ def export(
no_title,
not_burst,
not_cloudasset,
not_edited,
not_favorite,
not_hdr,
not_hidden,
@@ -1024,6 +1025,7 @@ def export(
no_title = cfg.no_title
not_burst = cfg.not_burst
not_cloudasset = cfg.not_cloudasset
not_edited = cfg.not_edited
not_favorite = cfg.not_favorite
not_hdr = cfg.not_hdr
not_hidden = cfg.not_hidden
@@ -1117,6 +1119,7 @@ def export(
("cloudasset", "not_cloudasset"),
("deleted", "deleted_only"),
("description", "no_description"),
("edited", "not_edited"),
("export_as_hardlink", "convert_to_jpeg"),
("export_as_hardlink", "download_missing"),
("export_as_hardlink", "exiftool"),
@@ -1398,6 +1401,7 @@ def export(
no_title=no_title,
not_burst=not_burst,
not_cloudasset=not_cloudasset,
not_edited = not_edited,
not_favorite=not_favorite,
not_hdr=not_hdr,
not_hidden=not_hidden,

View File

@@ -121,6 +121,7 @@ def query(
no_title,
not_burst,
not_cloudasset,
not_edited,
not_favorite,
not_hdr,
not_hidden,
@@ -183,7 +184,6 @@ def query(
added_in_last,
album,
duplicate,
edited,
exif,
external_edit,
folder,
@@ -215,6 +215,7 @@ def query(
(burst, not_burst),
(cloudasset, not_cloudasset),
(deleted, deleted_only),
(edited, not_edited),
(favorite, not_favorite),
(has_comment, no_comment),
(has_likes, no_likes),
@@ -318,6 +319,7 @@ def query(
no_title=no_title,
not_burst=not_burst,
not_cloudasset=not_cloudasset,
not_edited=not_edited,
not_favorite=not_favorite,
not_hdr=not_hdr,
not_hidden=not_hidden,

View File

@@ -3264,6 +3264,8 @@ class PhotosDB:
if options.edited:
photos = [p for p in photos if p.hasadjustments]
elif options.not_edited:
photos = [p for p in photos if not p.hasadjustments]
if options.external_edit:
photos = [p for p in photos if p.external_edit]

View File

@@ -61,6 +61,7 @@ class QueryOptions:
no_title: search for photos with no title
not_burst: search for non-burst photos
not_cloudasset: search for photos that are not managed by iCloud
not_edited: search for photos that have not been edited
not_favorite: search for non-favorite photos
not_hdr: search for non-HDR photos
not_hidden: search for non-hidden photos
@@ -143,6 +144,7 @@ class QueryOptions:
no_title: Optional[bool] = None
not_burst: Optional[bool] = None
not_cloudasset: Optional[bool] = None
not_edited: Optional[bool] = None
not_favorite: Optional[bool] = None
not_hdr: Optional[bool] = None
not_hidden: Optional[bool] = None