@@ -3391,7 +3391,7 @@ class PhotosDB:
|
|||||||
if n in p.filename or n in p.original_filename
|
if n in p.filename or n in p.original_filename
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
photos = photo_list
|
photos = list(set(photo_list))
|
||||||
|
|
||||||
if options.min_size:
|
if options.min_size:
|
||||||
photos = [
|
photos = [
|
||||||
@@ -3498,7 +3498,7 @@ class PhotosDB:
|
|||||||
exifdata_value = str(exifdata_value)
|
exifdata_value = str(exifdata_value)
|
||||||
if exifvalue in exifdata_value:
|
if exifvalue in exifdata_value:
|
||||||
matching_photos.append(p)
|
matching_photos.append(p)
|
||||||
photos = matching_photos
|
photos = list(set(matching_photos))
|
||||||
|
|
||||||
if options.added_after:
|
if options.added_after:
|
||||||
added_after = options.added_after
|
added_after = options.added_after
|
||||||
|
|||||||
@@ -993,6 +993,9 @@ FILE_FAVORITE = "wedding.jpg"
|
|||||||
UUID_NOT_FAVORITE = "1EB2B765-0765-43BA-A90C-0D0580E6172C"
|
UUID_NOT_FAVORITE = "1EB2B765-0765-43BA-A90C-0D0580E6172C"
|
||||||
FILE_NOT_FAVORITE = "Pumpkins3.jpg"
|
FILE_NOT_FAVORITE = "Pumpkins3.jpg"
|
||||||
|
|
||||||
|
# number of photos in test library with Make=Canon
|
||||||
|
EXIF_MAKE_CANON = 7
|
||||||
|
|
||||||
|
|
||||||
def modify_file(filename):
|
def modify_file(filename):
|
||||||
"""appends data to a file to modify it"""
|
"""appends data to a file to modify it"""
|
||||||
@@ -1385,6 +1388,33 @@ def test_query_exif_case_insensitive(exiftag, exifvalue, uuid_expected):
|
|||||||
assert sorted(uuid_got) == sorted(uuid_expected)
|
assert sorted(uuid_got) == sorted(uuid_expected)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(exiftool is None, reason="exiftool not installed")
|
||||||
|
def test_query_exif_multiple():
|
||||||
|
"""Test query with multiple --exif options, #873"""
|
||||||
|
|
||||||
|
runner = CliRunner()
|
||||||
|
cwd = os.getcwd()
|
||||||
|
result = runner.invoke(
|
||||||
|
query,
|
||||||
|
[
|
||||||
|
"--json",
|
||||||
|
"--db",
|
||||||
|
os.path.join(cwd, CLI_PHOTOS_DB),
|
||||||
|
"--exif",
|
||||||
|
"Make",
|
||||||
|
"Canon",
|
||||||
|
"--exif",
|
||||||
|
"Model",
|
||||||
|
"Canon PowerShot G10",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
assert result.exit_code == 0
|
||||||
|
|
||||||
|
# build list of uuids we got from the output JSON
|
||||||
|
json_got = json.loads(result.output)
|
||||||
|
assert len(json_got) == EXIF_MAKE_CANON
|
||||||
|
|
||||||
|
|
||||||
def test_export():
|
def test_export():
|
||||||
"""test basic export"""
|
"""test basic export"""
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
|
|||||||
Reference in New Issue
Block a user