Skip to content

Commit

Permalink
fix: live photo download detection ep
Browse files Browse the repository at this point in the history
  • Loading branch information
zlshames committed Mar 30, 2023
1 parent e3b95e3 commit c5c9421
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export class AttachmentRouter {
// Replace the extension with .mov (if there is one). Otherwise just append .mov
const ext = aPath.split(".").pop();
const livePath = ext !== aPath ? aPath.replace(`.${ext}`, ".mov") : `${aPath}.mov`;
if (!fs.existsSync(livePath)) throw new NotFound({ error: "Live photo does not exist for this attachment!" });
if (aPath.endsWith('.mov') || !fs.existsSync(livePath))
throw new NotFound({ error: "Live photo does not exist for this attachment!" });

return new FileStream(ctx, livePath, "video/quicktime").send();
}
Expand Down

0 comments on commit c5c9421

Please sign in to comment.