diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-12 12:48:31 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-12 12:48:31 +0200 |
| commit | 8545d95070890edfcf76b788ee023f9d510c302d (patch) | |
| tree | b3e1f9bf0bf30a8e748094b0a52c483befd7accf /apps/web/src/stores/timeline-store.ts | |
| parent | 0726c27221c5b3aa9a8442b0cf89bd6acd8dfb5a (diff) | |
| download | opencut-8545d95070890edfcf76b788ee023f9d510c302d.tar.gz | |
refactor: add FPS and remove turbopack (yes, fuck you turbopack)
Diffstat (limited to 'apps/web/src/stores/timeline-store.ts')
| -rw-r--r-- | apps/web/src/stores/timeline-store.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index 8c934392..33847baa 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -370,7 +370,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { } as TimelineElement; // Type assertion since we trust the caller passes valid data // If this is the first element and it's a media element, automatically set the project canvas size - // to match the media's aspect ratio + // to match the media's aspect ratio and FPS (for videos) if (isFirstElement && newElement.type === "media") { const mediaStore = useMediaStore.getState(); const mediaItem = mediaStore.mediaItems.find( @@ -386,6 +386,14 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { getMediaAspectRatio(mediaItem) ); } + + // Set project FPS from the first video element + if (mediaItem && mediaItem.type === "video" && mediaItem.fps) { + const projectStore = useProjectStore.getState(); + if (projectStore.activeProject) { + projectStore.updateProjectFps(mediaItem.fps); + } + } } updateTracksAndSave( |
