Skip to content

Commit

Permalink
Fix for #1670
Browse files Browse the repository at this point in the history
  • Loading branch information
RhetTbull committed Sep 19, 2024
1 parent 215ce05 commit af63fc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osxphotos/cli/import_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,7 @@ def sort_paths(paths: Iterable[pathlib.Path]) -> tuple[pathlib.Path, ...]:
def path_key(path: pathlib.Path) -> tuple[str, int, int, int, int]:
extension = path.suffix.lower()
is_aae = extension == ".aae"
is_mov = extension == ".mov"
is_mov = extension in (".mov", ".mp4")
base_name = path.stem.split("_")[0] # Extract the base name without suffixes
return (base_name, len(path.stem), is_aae, is_mov)

Expand Down
4 changes: 3 additions & 1 deletion osxphotos/image_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def is_possible_live_pair(
filepath1: str | os.PathLike, filepath2: str | os.PathLike
) -> bool:
"""Return True if photos could be a live photo pair (even if files lack the Content ID metadata"""
if is_image_file(filepath1) and is_video_file(filepath2):
if (is_image_file(filepath1) and is_video_file(filepath2)) or (
is_video_file(filepath1) and is_image_file(filepath2)
):
return True
return False

Expand Down
3 changes: 1 addition & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ A couple of tests require interaction with Photos and configuring a specific tes
- --timewarp: test `osxphotos timewarp` (pytest -vv --timewarp tests/test_cli_timewarp.py)
- --test-import: test `osxphotos import` (pytest -vv --test-import tests/test_cli_import.py)
- --test-sync: test `osxphotos sync` (pytest -vv --test-sync tests/test_cli_sync.py)
- --test-add-locations: test `osxphotos add-locations` (pytest -vv
--test-add-locations tests/test_cli_add_locations.py)
- --test-add-locations: test `osxphotos add-locations` (pytest -vv --test-add-locations tests/test_cli_add_locations.py)
- --test-batch-edit: test `osxphotos batch-edit` (pytest -vv --test-batch-edit -k batch)

## Test Photo Libraries
Expand Down

0 comments on commit af63fc0

Please sign in to comment.