edoardob90 / jrnl

Collect your thoughts and notes without leaving the command line.
GNU General Public License v3.0
0 stars 0 forks source link

Enhance Day One Index and Link Resolution System #2

Open edoardob90 opened 2 weeks ago

edoardob90 commented 2 weeks ago

Background

The current Day One import system needs enhancements to better support incremental updates and link resolution, particularly for alternate usage between Day One and plain text journals.

Proposed Changes

1. Remove export_source from IndexedEntry

2. Add Index Last Modified Timestamp

3. Update Index Structure

4. Add Index Status Check

Implementation Notes

File Structure

{
  "last_modified": "2024-11-18T10:00:00",
  "entries": {
    "uuid123": {
      "date": "2024-11-18T10:00:00",
      "journal_name": "personal",
      "original_journal_name": "🧪 Test 2"
    },
    "uuid456": {
      "date": "2024-11-18T11:00:00",
      "journal_name": "personal",
      "original_journal_name": "🧪 Test 2"
    }
  }
}

Required Changes:

  1. Update DayOneIndex class

    • [ ] Add last_modified timestamp
    • [ ] Add methods to find latest entry date by journal
    • [ ] Add index status check methods
  2. Update DayOneJSONImporter

    • [ ] Add index status check before import
    • [ ] Add warning messages for outdated indices
    • [ ] Consider automatic index updates
  3. Add utility functions:

    • [ ] Add extract_journal_name(export_path: Path) -> str
  4. Add new messages:

    • [ ] Index outdated warning
    • [ ] Update success message
    • [ ] Status information

Testing Requirements

Future Considerations

Tasks

This enhancement improves the Day One integration by:

  1. Simplifying the index structure
  2. Adding basic timestamp tracking
  3. Supporting incremental updates
  4. Maintaining proper Unicode journal name handling