Skip to content

Commit

Permalink
Refactor some types
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Jan 11, 2025
1 parent 9ba8be4 commit 2a44d6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class Attachment {
id: UUID;
fileSize: number;
sanitized: number;
meta: { animatedImage?: true } & { [key: string]: string };
meta: { animatedImage?: true } & { [key: `dc:${string}`]: string };
width: number | null;
height: number | null;
duration: number | null;
Expand Down
4 changes: 2 additions & 2 deletions app/support/media-files/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export async function processMediaFile(
origFileName: string,
): Promise<MediaProcessResult> {
const info = await detectMediaType(localFilePath, origFileName);
const fileStat = await stat(localFilePath);
const { size: fileSize } = await stat(localFilePath);

const commonResult = {
fileExtension: info.extension,
fileSize: fileStat.size,
fileSize,
fileName: origFileName,
mimeType: mimeLookup(info.extension) || 'application/octet-stream',
meta: {} as MediaProcessResult['meta'],
Expand Down
4 changes: 2 additions & 2 deletions app/support/media-files/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export type MediaProcessResult = {
};
meta?: {
animatedImage?: true;
'dc:title'?: string;
'dc:creator'?: string;
} & {
[key: `dc:${string}`]: string;
};

files?: FilesToUpload;
Expand Down

0 comments on commit 2a44d6c

Please sign in to comment.