Skip to content

Commit e98e400

Browse files
committed
typescript: fix any types
1 parent 454a308 commit e98e400

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

apps/web/src/lib/export.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { useMediaStore } from "@/stores/media-store";
1616
import { useProjectStore } from "@/stores/project-store";
1717
import { DEFAULT_FPS } from "@/stores/project-store";
1818
import { ExportOptions, ExportResult } from "@/types/export";
19+
import { TimelineTrack } from "@/types/timeline";
20+
import { MediaFile } from "@/types/media";
1921

2022
export const DEFAULT_EXPORT_OPTIONS: ExportOptions = {
2123
format: "mp4",
@@ -40,8 +42,8 @@ interface AudioElement {
4042
}
4143

4244
async function createTimelineAudioBuffer(
43-
tracks: any[],
44-
mediaFiles: any[],
45+
tracks: TimelineTrack[],
46+
mediaFiles: MediaFile[],
4547
duration: number,
4648
sampleRate: number = 44100
4749
): Promise<AudioBuffer | null> {
@@ -51,15 +53,15 @@ async function createTimelineAudioBuffer(
5153

5254
// Collect all audio elements from timeline
5355
const audioElements: AudioElement[] = [];
54-
const mediaMap = new Map(mediaFiles.map((m) => [m.id, m]));
56+
const mediaMap = new Map<string, MediaFile>(mediaFiles.map((m) => [m.id, m]));
5557

5658
for (const track of tracks) {
5759
if (track.muted) continue;
5860

5961
for (const element of track.elements) {
6062
if (element.type !== "media") continue;
6163

62-
const mediaItem = mediaMap.get(element.mediaId);
64+
const mediaItem = element.type === "media" ? mediaMap.get(element.mediaId) : null;
6365
if (!mediaItem || mediaItem.type !== "audio") continue;
6466

6567
const visibleDuration =

export-email.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
subject: export is out - maze from opencut
2+
3+
wassup, the thing you've been waiting for is finally out - the export button
4+
5+
opencut.app
6+
7+
give it a try, or don't, up to you ❤️
8+
9+
have an amazing day :)
10+
11+
[unsubscribe]({{unsubscribe_url}})

0 commit comments

Comments
 (0)