Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle copy of folders containing live photos #49293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Nov 14, 2024

We need to recursively look for live photos in the folder, and then handle them as usual.

Might fix #49289

We need to recursively look for live photos in the folder,
and then handle them as usual.

Signed-off-by: Louis Chemineau <[email protected]>
Comment on lines +195 to +196
$targetNode = $targetNode->get($sourceChild->getName());
$this->handleCopyRecursive($event, $sourceChild, $targetNode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$targetNode = $targetNode->get($sourceChild->getName());
$this->handleCopyRecursive($event, $sourceChild, $targetNode);
$targetChild = $targetNode->get($sourceChild->getName());
$this->handleCopyRecursive($event, $sourceChild, $targetChild);

Otherwise, it fails for the second file.

Comment on lines 133 to 134
* @param NodeCopiedEvent $event
* @param Node $peerFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param NodeCopiedEvent $event
* @param Node $peerFile

@kesselb
Copy link
Contributor

kesselb commented Nov 15, 2024

getDirectoryListing may return a listing like

  • a.jpg
  • a.mov
  • b.jpg
  • b.mov

Loop:

  1. handleCopy for a.jpg will copy a.mov too.
  2. handleCopy for a.mov will then copy a.jpg again.

It would be nice to skip the copy process for a.mov and a.jpg for the second execution if that's possible without making the whole logic much more complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Copying a folder containing live photos causes them to lose their live photo functionality
2 participants