From 9bc224c1f5078284dc9891046f026f951e24faea Mon Sep 17 00:00:00 2001 From: Rajat Saxena Date: Sat, 11 May 2024 14:50:29 +0530 Subject: [PATCH] Removed dead code --- apps/api/src/media/service.ts | 11 ----------- apps/api/src/media/utils/generate-key.ts | 16 ---------------- 2 files changed, 27 deletions(-) diff --git a/apps/api/src/media/service.ts b/apps/api/src/media/service.ts index 6eaa2d41..9fa81ceb 100644 --- a/apps/api/src/media/service.ts +++ b/apps/api/src/media/service.ts @@ -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, @@ -150,7 +148,6 @@ async function upload({ mediaId: fileName.name, access: "public", filename: "thumb.webp", - // type: "thumb", }), tags, }); @@ -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 { @@ -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 }); @@ -302,8 +293,6 @@ async function deleteMedia({ mediaId, access: "public", filename: "thumb.webp", - // extension: media.mimeType.split("/")[1], - // type: "thumb", }); await deleteObject({ Key: thumbKey }); } diff --git a/apps/api/src/media/utils/generate-key.ts b/apps/api/src/media/utils/generate-key.ts index 92b4de63..1edbc0e1 100644 --- a/apps/api/src/media/utils/generate-key.ts +++ b/apps/api/src/media/utils/generate-key.ts @@ -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,