diff --git a/backend/services/x-bot.js b/backend/services/x-bot.js index af6ed33..5b9edba 100644 --- a/backend/services/x-bot.js +++ b/backend/services/x-bot.js @@ -394,11 +394,18 @@ async function createScheduleFromYoutube(video) { const date = formatDate(kstDate); const time = formatTime(kstDate); - // 일정 생성 + // 일정 생성 (source_name에 채널명 저장) const [result] = await pool.query( `INSERT INTO schedules (title, date, time, category_id, source_url, source_name) - VALUES (?, ?, ?, ?, ?, NULL)`, - [video.title, date, time, YOUTUBE_CATEGORY_ID, video.videoUrl] + VALUES (?, ?, ?, ?, ?, ?)`, + [ + video.title, + date, + time, + YOUTUBE_CATEGORY_ID, + video.videoUrl, + video.channelTitle || null, + ] ); const scheduleId = result.insertId; @@ -418,7 +425,7 @@ async function createScheduleFromYoutube(video) { category_id: YOUTUBE_CATEGORY_ID, category_name: categoryInfo[0]?.name || "", category_color: categoryInfo[0]?.color || "", - source_name: null, + source_name: video.channelTitle || null, source_url: video.videoUrl, members: [], });