Skip to content

"Update if modified in OneNote" import option#548

Open
philou wants to merge 6 commits into
obsidianmd:masterfrom
philou:update-existing
Open

"Update if modified in OneNote" import option#548
philou wants to merge 6 commits into
obsidianmd:masterfrom
philou:update-existing

Conversation

@philou
Copy link
Copy Markdown

@philou philou commented May 5, 2026

Replaces the "Skip previously imported" toggle with a 3-option dropdown:

  • Skip previously imported: existing behavior (default)
  • Update if modified in OneNote: re-imports only notes modified in OneNote since the last import, by comparing lastModifiedDateTime (already returned by the API) against the markdown file's mtime (already set to that value on import)
  • Always reimport: reimports everything unconditionally

Internal

  • Introduced ReimportBehavior enum (Skip, Update, Reimport) to eliminate magic strings
  • Extracted oneNotePageModifiedAt, obsidianNoteModifiedAt, obsidianNotePath, and deleteExistingNote as private helpers on OneNoteImporter
  • No migration needed: the toggle was never persisted, so existing users see the dropdown defaulting to the same behavior as before.

philou added 6 commits May 5, 2026 17:24
…portBehavior Enum

To prepare code for an "update" behavior
- create an enum
- update access to handle the enum rather than the boolean
…mportBehavior Dropdown

- introduce the "update" option
- by default, 'update' does the same as 'reimport'
- compare modification times when doing the import
- write a log when skipping based on time
- create 2 helper methods to get modification times
- currently creates a duplicate note when updating
- Also refactor the "if page exist" logic in a wrapping if
- create deleteExistingNote method
- extract the obsidianNotePath method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant