-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(server): link motion photo with existing video asset #8724
fix(server): link motion photo with existing video asset #8724
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PRs are really good, thank you! :)
@@ -439,7 +439,7 @@ describe(MetadataService.name, () => { | |||
}); | |||
cryptoRepository.hashSha1.mockReturnValue(randomBytes(512)); | |||
assetMock.getByChecksum.mockResolvedValue(null); | |||
assetMock.create.mockResolvedValue(assetStub.livePhotoMotionAsset); | |||
assetMock.create.mockImplementation((asset) => Promise.resolve({ ...assetStub.livePhotoMotionAsset, ...asset })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT the create function is only called once, correct? Why can't we use mockResolvedValue
then, given that we already know which asset we pass in.
|
||
if (asset.livePhotoVideoId !== motionAsset.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this whole method run even when an asset is already linked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nevermind. This is for the case we had awhile ago with corrupt extraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #8508, closes #8503.
Originally part of #8512.
Links existing video asset with motion photo if their checksum matches.
Should NOT be merged until #8719 is merged to prevent cross library linking.