cleanup console logs from chapters editor

This commit is contained in:
Yiannis Christodoulou
2025-09-25 13:41:42 +03:00
parent f2edcbb41e
commit bd12266054
5 changed files with 31 additions and 69 deletions
@@ -204,8 +204,6 @@ const TimelineControls = ({
const response = await autoSaveVideo(finalMediaId, { chapters });
console.log('response autoSaveVideo edw', response);
if (response.success === true) {
logger.debug('Auto-save successful');
// Format the timestamp for display
@@ -256,7 +254,6 @@ const TimelineControls = ({
// Update editing title when selected segment changes
useEffect(() => {
console.log('edw selectedSegment', selectedSegment);
if (selectedSegment) {
setEditingChapterTitle(selectedSegment.chapterTitle || '');
} else {
@@ -971,38 +968,10 @@ const TimelineControls = ({
const loadSavedSegments = () => {
// Get savedSegments directly from window.MEDIA_DATA
let savedData = (typeof window !== 'undefined' && (window as any).MEDIA_DATA?.chapters) || null;
console.log('MEDIA_DATA edw1', (window as any).MEDIA_DATA);
console.log('savedData edw1', savedData);
// If no saved segments, use default segments
/* if (!savedData) {
logger.debug('No saved segments found in MEDIA_DATA, using default segments');
savedData = {
chapters: [
{
startTime: '00:00:00.000',
endTime: '00:00:10.000',
chapterTitle: 'Chapter 1 (from saved data)',
},
{
startTime: '00:00:12.000',
endTime: '00:00:17.000',
chapterTitle: 'Chapter 2 (from saved data)',
},
{
startTime: '00:00:20.000',
endTime: '00:00:30.000',
chapterTitle: 'Chapter 3 (from saved data)',
},
],
updated_at: '2025-06-24 14:59:14',
};
} */
try {
if (savedData && savedData.chapters && savedData.chapters.length > 0) {
logger.debug('Found saved segments:', savedData);
console.log('savedData edw', savedData);
// Convert the saved segments to the format expected by the component
const convertedSegments: Segment[] = savedData.chapters.map((seg: any , index: number) => ({
@@ -719,8 +719,6 @@ const useVideoChapters = () => {
chapters: backendChapters,
};
console.log('Saving chapters:', requestData);
// Make API call to save chapters
const csrfToken = getCsrfToken();
const headers: Record<string, string> = {
@@ -743,7 +741,6 @@ const useVideoChapters = () => {
}
const result = await response.json();
console.log('Chapters saved successfully:', result);
// Mark as saved - no unsaved changes
setHasUnsavedChanges(false);
@@ -35,9 +35,6 @@ export const autoSaveVideo = async (mediaId: string, data: AutoSaveRequest): Pro
body: JSON.stringify(data),
});
console.log('data edw', data);
console.log('response edw', response);
logger.debug('response', response);
if (!response.ok) {
@@ -70,7 +67,6 @@ export const autoSaveVideo = async (mediaId: string, data: AutoSaveRequest): Pro
// Successful response
const jsonResponse = await response.json();
console.log('jsonResponse edw', jsonResponse);
// Check if the response has the expected format
return {