Skip to content

Commit

Permalink
fix: live photo detection when no extension
Browse files Browse the repository at this point in the history
  • Loading branch information
zlshames committed Mar 30, 2023
1 parent ddcb368 commit e3b95e3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ 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.replace(`.${ext}`, ".mov") : `${aPath}.mov`;
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!" });

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

0 comments on commit e3b95e3

Please sign in to comment.