mirror of
https://github.com/yusufipk/YTChatHub.git
synced 2026-09-11 19:06:14 +00:00
chore: remove debug logging and refine UI polish for overlay components
This commit is contained in:
@@ -38,12 +38,6 @@ export async function startBackend() {
|
||||
ingestion = await bootstrapInnertube(parsedLiveId);
|
||||
console.log(`[Backend] ✓ YouTube chat connected successfully`);
|
||||
ingestion.emitter.on('message', (message) => {
|
||||
// Debug: Log all message attributes
|
||||
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
console.log('[Message Debug] Full message object:');
|
||||
console.log(JSON.stringify(message, null, 2));
|
||||
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
store.push(message);
|
||||
if (store.length > MAX_MESSAGES) {
|
||||
store.splice(0, store.length - MAX_MESSAGES);
|
||||
@@ -111,12 +105,6 @@ export async function startBackend() {
|
||||
console.log(`[Backend] ✓ YouTube chat connected successfully`);
|
||||
|
||||
ingestion.emitter.on('message', (message) => {
|
||||
// Debug: Log all message attributes
|
||||
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
console.log('[Message Debug] Full message object:');
|
||||
console.log(JSON.stringify(message, null, 2));
|
||||
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
store.push(message);
|
||||
if (store.length > MAX_MESSAGES) {
|
||||
store.splice(0, store.length - MAX_MESSAGES);
|
||||
|
||||
@@ -270,13 +270,6 @@ function normalizeAction(action: any): ChatMessage | null {
|
||||
const item = action.item;
|
||||
if (!item) return null;
|
||||
|
||||
// Debug: Log raw item from YouTube API
|
||||
console.log('╔════════════════════════════════════════════════════════════════╗');
|
||||
console.log('║ RAW INNERTUBE API ITEM ║');
|
||||
console.log('╚════════════════════════════════════════════════════════════════╝');
|
||||
console.log(JSON.stringify(item, null, 2));
|
||||
console.log('╚════════════════════════════════════════════════════════════════╝');
|
||||
|
||||
// Normalize various live chat events
|
||||
const itemType = String(item.type || '').trim();
|
||||
const messageText = resolveMessageText(item).toLowerCase();
|
||||
@@ -294,21 +287,10 @@ function normalizeAction(action: any): ChatMessage | null {
|
||||
messageText.includes('received a gift') ||
|
||||
/received\s+a\s+.*membership.*by/i.test(messageText);
|
||||
|
||||
// Log all gift-related messages for debugging
|
||||
if (isGiftPurchase || isGiftReceived || isGiftRecipientMessage) {
|
||||
console.log(`[Gift Debug] Type: ${itemType}, Author: ${item.author?.name}, Text: "${messageText}", Purchase: ${isGiftPurchase}, Received: ${isGiftReceived}, TextPattern: ${isGiftRecipientMessage}`);
|
||||
}
|
||||
|
||||
// Ignore gift received messages - we only care about the purchaser
|
||||
if (isGiftReceived || isGiftRecipientMessage) {
|
||||
console.log(`[Gift] Filtering out recipient message from: ${item.author?.name}`);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Log gift purchase messages for debugging
|
||||
if (isGiftPurchase) {
|
||||
console.log(`[Chat] Gift purchase detected - Author: ${item.author?.name}, Type: ${itemType}, Text: ${messageText}`);
|
||||
}
|
||||
|
||||
if (isText || isPaid || isMembership || isGiftPurchase) {
|
||||
// For gift purchases, author info is in header
|
||||
|
||||
Reference in New Issue
Block a user