Skip to content

Commit

Permalink
Removed dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Saxena committed May 11, 2024
1 parent bdab474 commit 9bc224c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
11 changes: 0 additions & 11 deletions apps/api/src/media/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ async function upload({
mediaId: fileName.name,
access: access === "public" ? "public" : "private",
filename: `main.${fileExtension}`,
// extension: fileExtension,
// type: "main",
}),
Body: createReadStream(mainFilePath),
ContentType: mimeType,
Expand All @@ -150,7 +148,6 @@ async function upload({
mediaId: fileName.name,
access: "public",
filename: "thumb.webp",
// type: "thumb",
}),
tags,
});
Expand Down Expand Up @@ -250,10 +247,6 @@ async function getMediaDetails({
mediaId: media.mediaId,
access: media.accessControl === "private" ? "private" : "public",
filename: `main.${path.extname(media.fileName).replace(".", "")}`,
// extension: path
// .extname(media.fileName)
// .replace(".", ""),
// type: "main",
});

return {
Expand Down Expand Up @@ -292,8 +285,6 @@ async function deleteMedia({
mediaId,
access: media.accessControl === "private" ? "private" : "public",
filename: `main.${media.fileName.split(".")[1]}`,
// extension: media.mimeType.split("/")[1],
// type: "main",
});
await deleteObject({ Key: key });

Expand All @@ -302,8 +293,6 @@ async function deleteMedia({
mediaId,
access: "public",
filename: "thumb.webp",
// extension: media.mimeType.split("/")[1],
// type: "thumb",
});
await deleteObject({ Key: thumbKey });
}
Expand Down
16 changes: 0 additions & 16 deletions apps/api/src/media/utils/generate-key.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
import { CLOUD_PREFIX } from "../../config/constants";

// interface GenerateKeyProps {
// mediaId: string;
// type: "main" | "thumb";
// extension?: string;
// }

// export default function generateKey({
// mediaId,
// type,
// extension,
// }: GenerateKeyProps): string {
// return `${CLOUD_PREFIX ? `${CLOUD_PREFIX}/` : ""}${mediaId}/${type}.${
// type === "thumb" ? "webp" : extension
// }`;
// }

export default function generateKey({
mediaId,
access,
Expand Down

0 comments on commit 9bc224c

Please sign in to comment.