diff --git a/README.md b/README.md index 3485faa..89600c7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ From either the calendar grid or the timeline view, the user can click on a spec - The photo root folder is configured in the config file. - Inside the root folder, there are subfolders for each year (e.g., "2023", "2024"). - Inside each year folder the photos are stored directly. - - Photos are named using the following format: "YYYY-MM-DD_description.ext" (e.g., "2024-06-15_BirthdayParty.jpg"). + - Photos are named using the following format: "YYYY-MM-DD description.ext" (e.g., "2024-06-15 BirthdayParty.jpg or 2024-10-22 12233500.jpg"). - The diary entries are stored in an .ics file with each entry representing a journal entry for a specific day. - Only one diary entry per day is supported. - That entry is always an all-day event called "Chronolog" in the .ics file. diff --git a/internal/storage/photos.go b/internal/storage/photos.go index a801715..e252633 100644 --- a/internal/storage/photos.go +++ b/internal/storage/photos.go @@ -33,7 +33,7 @@ var supportedExtensions = map[string]bool{ } // Filename pattern: YYYY-MM-DD_description.ext -var filenamePattern = regexp.MustCompile(`^(\d{4})-(\d{2})-(\d{2})_(.+)\.(\w+)$`) +var filenamePattern = regexp.MustCompile(`^(\d{4})-(\d{2})-(\d{2}) (.+)\.(\w+)$`) // LoadAllPhotos scans and loads all photos from the configured directory. func (s *PhotoStore) LoadAllPhotos() ([]*models.Photo, error) {