7 Commits

Author SHA1 Message Date
Manuel Rüger
d6b37affd3 fix: use index-based loop in ResolveLocalAttachments to persist checksums
The range loop 'for _, attachment := range attachments' copied each
element by value. Assigning attachment.Checksum inside the loop only
modified the local copy; the original slice element was never updated.
All returned attachments had empty Checksum fields, causing every
attachment to be treated as changed on every run (the checksum
comparison would never match).

Switch to an index-based loop so the checksum is written directly to
the slice element.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-16 19:18:29 +01:00
Manuel Rüger
32577c91f4 fix: return error instead of panic in ResolveAttachments; fix wrong slice index in log
Two issues in attachment handling:
1. GetAttachments failure called panic(err) instead of returning an
   error, crashing the process on any API failure.
2. The 'keeping unmodified' log loop indexed into the original
   attachments slice using the range of existing, causing wrong names
   to be logged and a potential out-of-bounds panic when existing is
   longer than attachments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-16 19:18:29 +01:00
Johan Fagerberg
9795f74f0f feat: only attempt to parse image attachments 2026-03-11 12:49:22 +01:00
Johan Fagerberg
4d887bde74 feat: add support for image dimensions 2026-03-11 12:49:22 +01:00
Manuel Rüger
3cc39ffe79 Add support for d2lang 2025-05-30 23:37:15 +02:00
Manuel Rüger
f24d8c8957 Fix lint issues detected by golangci v2 2025-04-02 16:42:32 +02:00
Manuel Rüger
dc8842106b *: Reorganize code 2024-09-29 00:13:04 +02:00