(value []DateNotePatternSettings)
| 369 | } |
| 370 | |
| 371 | func normalizeWeeklyNoteLegacyPatterns(value []DateNotePatternSettings) []DateNotePatternSettings { |
| 372 | out := []DateNotePatternSettings{} |
| 373 | seen := map[string]bool{} |
| 374 | for _, pattern := range value { |
| 375 | next := DateNotePatternSettings{ |
| 376 | Directory: normalizeWeeklyNotesDirectory(pattern.Directory), |
| 377 | TitlePattern: normalizeWeeklyNoteTitlePattern(pattern.TitlePattern), |
| 378 | Locale: normalizeWeeklyNoteLocale(pattern.Locale), |
| 379 | } |
| 380 | key := next.Directory + "\x00" + next.TitlePattern + "\x00" + next.Locale |
| 381 | if seen[key] { |
| 382 | continue |
| 383 | } |
| 384 | seen[key] = true |
| 385 | out = append(out, next) |
| 386 | } |
| 387 | return out |
| 388 | } |
| 389 | |
| 390 | func normalizePrimaryNotesLocation(value PrimaryNotesLocation) PrimaryNotesLocation { |
| 391 | if value == PrimaryNotesRoot { |
no test coverage detected