refactor: update media processing to use width and height instead of aspect ratio

This commit is contained in:
Maze Winther
2025-07-01 01:13:14 +02:00
parent 9b37ce6610
commit 1a01871cfc
6 changed files with 335 additions and 310 deletions
+4 -2
View File
@@ -94,7 +94,8 @@ class StorageService {
type: mediaItem.type,
size: mediaItem.file.size,
lastModified: mediaItem.file.lastModified,
aspectRatio: mediaItem.aspectRatio,
width: mediaItem.width,
height: mediaItem.height,
duration: mediaItem.duration,
};
@@ -118,7 +119,8 @@ class StorageService {
type: metadata.type,
file,
url,
aspectRatio: metadata.aspectRatio,
width: metadata.width,
height: metadata.height,
duration: metadata.duration,
// thumbnailUrl would need to be regenerated or cached separately
};
+3 -2
View File
@@ -14,7 +14,8 @@ export interface MediaFileData {
type: "image" | "video" | "audio";
size: number;
lastModified: number;
aspectRatio: number;
width?: number;
height?: number;
duration?: number;
// File will be stored separately in OPFS
}
@@ -38,4 +39,4 @@ declare global {
values(): AsyncIterableIterator<FileSystemHandle>;
entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
}
}
}