From fb4c7a73263555c23513ff7620cd32e27ea87e0d Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Mon, 30 Mar 2026 15:40:35 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Kalenderwochen-Kalender=20ausblenden=20+?= =?UTF-8?q?=20=C3=9Cberlappungsdarstellung=20korrigiert=20-=20#weekNum@gro?= =?UTF-8?q?up.v.calendar.google.com=20(Kalenderwochen)=20wird=20beim=20Goo?= =?UTF-8?q?gle-=20=20=20Sync,=20in=20der=20Kalenderliste=20und=20beim=20Ev?= =?UTF-8?q?ent-Abruf=20=C3=BCbersprungen=20-=20layoutEvents:=20fehlende=20?= =?UTF-8?q?`end`-Variable=20im=20zweiten=20Pass=20erg=C3=A4nzt;=20ohne=20s?= =?UTF-8?q?ie=20=20=20war=20die=20Bedingung=20immer=20false,=20sodass=20Sp?= =?UTF-8?q?altenanzahl=20=C3=BCberlappender=20Termine=20=20=20falsch=20ber?= =?UTF-8?q?echnet=20wurde=20und=20Termine=20sich=20visuell=20=C3=BCberdeck?= =?UTF-8?q?ten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routers/google_router.py | 10 ++++++++++ frontend/js/views/week.js | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/routers/google_router.py b/backend/routers/google_router.py index a944a05..d771d61 100644 --- a/backend/routers/google_router.py +++ b/backend/routers/google_router.py @@ -26,6 +26,11 @@ AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth" TOKEN_URL = "https://oauth2.googleapis.com/token" CALENDAR_API = "https://www.googleapis.com/calendar/v3" +# System/virtual Google calendars that should never be shown +SKIP_GOOGLE_CALENDAR_IDS = { + "#weekNum@group.v.calendar.google.com", # Kalenderwochen / Week numbers +} + def _google_configured() -> bool: return bool(GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET) @@ -134,6 +139,7 @@ def _account_dict(a: models.GoogleAccount) -> dict: "sidebar_hidden": bool(c.sidebar_hidden), } for c in a.calendars + if c.cal_id not in SKIP_GOOGLE_CALENDAR_IDS ], } @@ -148,6 +154,8 @@ def _sync_google_calendars(account: models.GoogleAccount, db: Session): if cal.get("deleted"): continue cal_id = cal["id"] + if cal_id in SKIP_GOOGLE_CALENDAR_IDS: + continue if cal_id not in existing: db.add(models.GoogleCalendar( account_id=account.id, @@ -373,6 +381,8 @@ def get_google_events(account: models.GoogleAccount, start_dt: datetime, end_dt: for gcal in account.calendars: if not gcal.enabled: continue + if gcal.cal_id in SKIP_GOOGLE_CALENDAR_IDS: + continue events_resp = _google_api(token, f"/calendars/{gcal.cal_id}/events", params={ "timeMin": start_dt.isoformat(), "timeMax": end_dt.isoformat(), diff --git a/frontend/js/views/week.js b/frontend/js/views/week.js index 943f32d..d0d7203 100644 --- a/frontend/js/views/week.js +++ b/frontend/js/views/week.js @@ -183,8 +183,6 @@ function layoutEvents(events) { const result = sorted.map(ev => { const start = new Date(ev.start); - const end = new Date(ev.end); - let placed = false; for (let c = 0; c < columns.length; c++) { const lastInCol = columns[c][columns[c].length - 1]; @@ -204,6 +202,7 @@ function layoutEvents(events) { return result.map(ev => { const start = new Date(ev.start); + const end = new Date(ev.end); let maxCol = ev._col; sorted.forEach(other => { if (other === ev) return;