Skip to content

Commit

Permalink
Fix for --auto-live with .mp4, #1670
Browse files Browse the repository at this point in the history
  • Loading branch information
RhetTbull committed Aug 30, 2024
1 parent fb14ff8 commit f5714cc
Show file tree
Hide file tree
Showing 2 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 @@ -2823,7 +2823,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
7 changes: 4 additions & 3 deletions osxphotos/image_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ def is_live_pair(filepath1: str | os.PathLike, filepath2: str | os.PathLike) ->
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"""
print(f"{filepath1=}, {filepath2=}")
if is_image_file(filepath1) and is_video_file(filepath2):
"""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)) or (
is_video_file(filepath1) and is_image_file(filepath2)
):
return True
return False

Expand Down

0 comments on commit f5714cc

Please sign in to comment.