logseq-calendars-plugin icon indicating copy to clipboard operation
logseq-calendars-plugin copied to clipboard

Toolbar icon only importing "Calendar 2".

Open jasonandersen opened this issue 2 years ago • 7 comments
trafficstars

I have Calendar 1, Calendar 2 and Calendar 3 defined in the settings. All calendar URLs resolve correctly to .ics files in an Incognito browser. But only Calendar 2 will import when I click the toolbar.

I first setup only Calendar 1 and it wouldn't import because the toolbar button would only import Calendar 2 and it wasn't setup. Once I setup Calendar 2, it imports correctly but Calendar 1 and Calendar 3 do not.

image

I don't see any setting to control which calendar gets imported from the toolbar icon?

jasonandersen avatar Oct 11 '23 21:10 jasonandersen

App Version: 0.9.19 Git Revision: bd36efe Platform: Mozilla/5.0 (Macintosh Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML like Gecko) Logseq/0.9.19 Chrome/112.0.5615.204 Electron/24.6.3 Safari/537.36 Language: en-US Plugins: logseq-awesome-styler (v3.7.1), logseq-awesome-ui (v2.3.1), logseq-calendars-plugin (2.2.2), logseq-tabs (v1.19.3)

jasonandersen avatar Oct 11 '23 21:10 jasonandersen

Got similar problem but none of the calendars import. Plugin just says: "Calendar not found: Check your URL"

taapsa-visma avatar Oct 12 '23 08:10 taapsa-visma

Got similar problem but none of the calendars import. Plugin just says: "Calendar not found: Check your URL"

For what it's worth @taapsa-visma - I got that same error until I populated Calendar 2 settings.

jasonandersen avatar Oct 12 '23 17:10 jasonandersen

Same issue here, even if all calendar settings are populated. The .ics download using the direct URL works fine.

monsterfurby avatar Nov 24 '23 20:11 monsterfurby

Hi guys. Using the following config:

  • Logseq 0.9.2 (MacOS Apple Silicon)
  • Plugin 2.2.2 (installed from Marketplace)

Investigation

What happened for me was that after inserting links to my calendars using settings GUI, I got the same error "Calendar not found: Check your URL". After checking the console I've seen plugin sends a single request (recall that I have 2 calendars configured). The request URL was https://calendar.google.com/calendar/ical/.... I first thought that replacing proper address with ... is some privacy measure done by the console, but it's not the case.

I went to check plugin's settings (for me on MacOS - should be the same on Linux - it was ~/.logseq/settings/logseq-calendars-plugin.json). From there the cause of the issue was clear: accountsDetails had the single block for Calendar1, and link was the same default https://calendar.google.com/calendar/ical/...:

{
  "template": "{Start} - {End}: {Title}",
  "useJSON": false,
  "IndentCommonBlock": true,
  "templateLine2": "{Description}",
  "timeFormat": [
    "12 hour time",
    "24 hour time"
  ],
  "calendar1Name": "Google",
  "calendar1URL": "https://calendar.google.com/calendar/ical/path/to/correct.ics",
  "calendar2Name": "Outlook",
  "calendar2URL": "https://outlook.office365.com/owa/calendar/path/to/correct.ics",
  "calendar3Name": "",
  "calendar3URL": "",
  "calendar4Name": "",
  "calendar4URL": "",
  "calendar5Name": "",
  "calendar5URL": "",
  "disabled": false,
  "accountsDetails": {
    "Calendar 1": "https://calendar.google.com/calendar/ical/..."
  }

Possible workaround

The workaround is simple: fix accountsDetails section. For example, in my case I have two calendars:

  • calendar1 is my Google calendar, link is in calendar1URL.
  • calendar2 is my Outlook calendar, link is in calendar2URL.

Steps to workaround:

  1. Open logseq-calendars-plugin.json with a text editor.
  2. Replace "Calendar 1" in "accountsDetails" with calendar name e.g., "Google".
  3. Replace link in "accountsDetails" with the link from "calendar1URL" e.g., "https://calendar.google.com/calendar/ical/path/to/correct.ics"
  • Make sure the link is in the double quotes (""), and there is a comma at the end of the line describing Calendar 1.
  1. Add new line for other calendar following the same pattern e.g.,"Outlook": "https://outlook.office365.com/owa/calendar/path/to/correct.ics" The result looked like this in my case:
  "template": "{Start} - {End}: {Title}",
  "useJSON": false,
  "IndentCommonBlock": true,
  "templateLine2": "{Description}",
  "timeFormat": [
    "12 hour time",
    "24 hour time"
  ],
  "calendar1Name": "Google",
  "calendar1URL": "https://calendar.google.com/calendar/ical/path/to/correct.ics",
  "calendar2Name": "Outlook",
  "calendar2URL": "https://outlook.office365.com/owa/calendar/path/to/correct.ics",
  "calendar3Name": "",
  "calendar3URL": "",
  "calendar4Name": "",
  "calendar4URL": "",
  "calendar5Name": "",
  "calendar5URL": "",
  "disabled": false,
  "accountsDetails": {
    "Google": "https://calendar.google.com/calendar/ical/path/to/correct.ics",
    "Outlook": "https://outlook.office365.com/owa/calendar/path/to/correct.ics"
  }
  1. Turn the plugin off, turn the plugin on.

If you have more calendars, repeat step 4 for other calendars, adding comma after each new calendar.


I can't read typescript well, but for my money the code in index.ts that creates accountsDetails looks correct. I couldn't find the reason why accountDetails did not update after I changed the settings.

Torainodor avatar Nov 29 '23 09:11 Torainodor

Thanks @Torainodor , Your workaround solved half of the problem for me.

I also set mine up via GUI, and got the same problem with the account details. but after fixing it manually, still the toolbar icon say "Open-calendar-2", not that big of a deal for me. just as long as it works.

SM-26 avatar Dec 11 '23 17:12 SM-26

This workaround also worked for me. Thanks very much for documenting this. I had the same results where it still says "Open-calendar-2", and while that is a bit funny, I am just glad it works. Before looking through the issues, I feared that this was somehow a problem with getting my ics from Nextcloud, which maybe does not make sense, but that was what I was thinking. Glad I checked the issue queue.

MegaKeegMan avatar Dec 16 '23 22:12 MegaKeegMan