diff --git a/manifest.json b/manifest.json index fe8d371..bd4886e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "memochron", "name": "MemoChron", - "version": "1.6.2", + "version": "1.6.3", "minAppVersion": "1.8.9", "description": "Calendar integration and note creation with support for public iCalendar URLs", "author": "Michalis Efstratiadis", diff --git a/package.json b/package.json index 03e0b8c..a6f559e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "memochron", - "version": "1.6.0", + "version": "1.6.3", "description": "Calendar integration and note creation plugin for Obsidian", "main": "main.js", "scripts": { diff --git a/src/services/CalendarService.ts b/src/services/CalendarService.ts index bae9f2b..1137d06 100644 --- a/src/services/CalendarService.ts +++ b/src/services/CalendarService.ts @@ -321,8 +321,6 @@ export class CalendarService { private async fetchRemoteCalendar(url: string) { // Special handling for Outlook/Office365 URLs if (url.includes('outlook.office365.com') || url.includes('outlook.live.com')) { - console.log(`Fetching Outlook calendar from: ${url}`); - // First attempt: Try with simple browser-like headers let response = await requestUrl({ url, @@ -334,33 +332,31 @@ export class CalendarService { throw: false, }); - console.log(`Outlook response status: ${response.status}`); - console.log(`Response content type: ${response.headers?.['content-type'] || 'unknown'}`); - console.log(`Response text preview: ${response.text?.substring(0, 200)}`); + // Check if we got valid calendar data on first try + if (response.text && response.text.includes('BEGIN:VCALENDAR')) { + return response; + } // Check if we got an HTML error page instead of calendar data - if (response.text && response.text.includes('')) { - console.error(`Outlook calendar returned HTML error page for ${url}`); - console.error(`Full HTML response: ${response.text.substring(0, 500)}`); + // More robust check: HTML response typically has content-type text/html + const isHtmlResponse = (response.headers?.['content-type']?.includes('text/html')) || + (response.text && (response.text.includes('