Skip to content

The open-source CapCut alternative

Merge pull request #135 from DevloperAmanSingh/feature/player-controls

izaf53f2802ebed
diff --cc apps/web/src/stores/timeline-store.ts
index 4018c301,04b2f6fb..73628497
--- a/apps/web/src/stores/timeline-store.ts
+++ b/apps/web/src/stores/timeline-store.ts
@@@ -1,6 -1,20 +1,21 @@@
import { create } from "zustand";
+import type { TrackType } from "@/types/timeline";
+ // Helper function to manage clip naming with suffixes
+ const getClipNameWithSuffix = (
+ originalName: string,
+ suffix: string
+ ): string => {
+ // Remove existing suffixes to prevent accumulation
+ const baseName = originalName
+ .replace(/ \(left\)$/, "")
+ .replace(/ \(right\)$/, "")
+ .replace(/ \(audio\)$/, "")
+ .replace(/ \(split \d+\)$/, "");
+
+ return `${baseName} (${suffix})`;
+ };
+
export interface TimelineClip {
id: string;
mediaId: string;