Skip to content

🎥 Make videos programmatically with React

Remove the Clear timeline cache menu item

JonnyBurger3704f89b88cd
diff --git a/packages/studio/src/helpers/use-menu-structure.tsx b/packages/studio/src/helpers/use-menu-structure.tsx
index e2ff6a99f9..192e3e896f 100644
--- a/packages/studio/src/helpers/use-menu-structure.tsx
+++ b/packages/studio/src/helpers/use-menu-structure.tsx
@@ -1,5 +1,4 @@
import type {EditorPickerId} from '@remotion/studio-shared';
-import {clearPersistentTimelineCache} from '@remotion/timeline-utils';
import {useContext, useEffect, useMemo} from 'react';
import type {ResolvedStackLocation, _InternalTypes} from 'remotion';
import {Internals} from 'remotion';
@@ -938,32 +937,6 @@ const useMenuStructureBase = ({
subMenu: null,
quickSwitcherLabel: `Install package...`,
},
- {
- id: 'clear-timeline-cache',
- value: 'clear-timeline-cache',
- label: 'Clear timeline cache',
- onClick: () => {
- closeMenu();
- clearPersistentTimelineCache()
- .then(() => {
- showNotification(
- 'Cleared cached waveforms and thumbnails',
- 2000,
- );
- })
- .catch((err) => {
- showNotification(
- `Could not clear timeline cache: ${(err as Error).message}`,
- 2000,
- );
- });
- },
- type: 'item' as const,
- keyHint: null,
- leftItem: null,
- subMenu: null,
- quickSwitcherLabel: 'Clear timeline cache',
- },
].filter(Internals.truthy),
quickSwitcherLabel: null,
},
diff --git a/packages/timeline-utils/src/index.ts b/packages/timeline-utils/src/index.ts
index 8bf1054a17..f04d709f3e 100644
--- a/packages/timeline-utils/src/index.ts
+++ b/packages/timeline-utils/src/index.ts
@@ -45,7 +45,6 @@ export {
} from './loop-display';
export type {LoopDisplaySegment, TimelineLoopDisplay} from './loop-display';
export {
- clearPersistentTimelineCache,
hydrateThumbnailsFromPersistentCache,
readMediaMetadataFromPersistentCache,
writeMediaMetadataToPersistentCache,
diff --git a/packages/timeline-utils/src/persistent-cache/persistent-cache.ts b/packages/timeline-utils/src/persistent-cache/persistent-cache.ts
index a7f102bed2..7b8e0e81cf 100644
--- a/packages/timeline-utils/src/persistent-cache/persistent-cache.ts
+++ b/packages/timeline-utils/src/persistent-cache/persistent-cache.ts
@@ -785,19 +785,3 @@ export const writeThumbnailToPersistentCache = ({
}, THUMBNAIL_FLUSH_DELAY_MS);
}
};
-
-export const clearPersistentTimelineCache = async () => {
- const database = await openDatabase();
- if (!database) {
- return;
- }
-
- const transaction = database.transaction(ALL_STORES, 'readwrite');
- for (const name of ALL_STORES) {
- transaction.objectStore(name).clear();
- }
-
- await transactionDone(transaction);
- readableSources.clear();
- writableSources.clear();
-};