Skip to content

Commit 2a440ad

Browse files
committed
chores: add delta to default
1 parent acaf84c commit 2a440ad

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

docs/api-reference/environment-variables.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Note:
3333

3434
## Parent Selection
3535

36-
| Variable | Description | Default | Example |
37-
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------- |
38-
| `PARENT_FILENAME_PROMOTE` | Substrings to promote as parent filenames. Supports empty string for negative matching, the `sequence` keyword and automatic sequence detection for burst photos. | - | `,_edited` or `edit,raw` or `COVER,sequence` or `0000,0001,0002,0003` |
39-
| `PARENT_EXT_PROMOTE` | Extensions to promote as parent files | - | `.jpg,.dng` |
36+
| Variable | Description | Default | Example |
37+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------- |
38+
| `PARENT_FILENAME_PROMOTE` | Substrings to promote as parent filenames. Supports empty string for negative matching, the `sequence` keyword and automatic sequence detection for burst photos. | `cover,edit,crop,hdr,biggestNumber` | `,_edited` or `edit,raw` or `COVER,sequence` or `0000,0001,0002,0003` |
39+
| `PARENT_EXT_PROMOTE` | Extensions to promote as parent files | `.jpg,.png,.jpeg,.dng` | `.jpg,.dng` |
4040

4141
### Empty String for Negative Matching
4242

@@ -100,9 +100,33 @@ When `PARENT_FILENAME_PROMOTE` contains a numeric sequence pattern (e.g., `0000,
100100

101101
## Custom Criteria
102102

103-
| Variable | Description | Default | Example |
104-
| ---------- | ----------------------------- | ------- | ----------------------------------------------------- |
105-
| `CRITERIA` | Custom grouping criteria JSON | - | See [Custom Criteria](../features/custom-criteria.md) |
103+
| Variable | Description | Default | Example |
104+
| ---------- | ----------------------------- | --------- | ----------------------------------------------------- |
105+
| `CRITERIA` | Custom grouping criteria JSON | See below | See [Custom Criteria](../features/custom-criteria.md) |
106+
107+
### Default Criteria
108+
109+
When `CRITERIA` is not set, the following default is used:
110+
111+
```json
112+
[
113+
{
114+
"key": "originalFileName",
115+
"split": { "delimiters": ["~", "."], "index": 0 }
116+
},
117+
{
118+
"key": "localDateTime",
119+
"delta": { "milliseconds": 1000 }
120+
}
121+
]
122+
```
123+
124+
This groups photos by:
125+
126+
- Base filename (before `~` or `.`)
127+
- Time captured (within 1 second tolerance)
128+
129+
### Custom Criteria Formats
106130

107131
The `CRITERIA` environment variable supports three formats for flexible asset stacking:
108132

docs/features/edited-photo-promotion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The default configuration already includes `biggestNumber`:
2323

2424
```bash
2525
# Default value (no need to set if using defaults)
26-
PARENT_FILENAME_PROMOTE=edit,crop,hdr,biggestNumber
26+
PARENT_FILENAME_PROMOTE=cover,edit,crop,hdr,biggestNumber
2727
```
2828

2929
If you're not setting `PARENT_FILENAME_PROMOTE` explicitly, the defaults will handle edited photos correctly.
@@ -77,7 +77,7 @@ Sorted order (parent first):
7777

7878
```bash
7979
# Prioritizes edits, crops, HDR, and then numbered versions
80-
PARENT_FILENAME_PROMOTE=edit,crop,hdr,biggestNumber
80+
PARENT_FILENAME_PROMOTE=cover,edit,crop,hdr,biggestNumber
8181
```
8282

8383
### For RAW+JPEG with Edits

pkg/utils/constants.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const TimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
1111
/**************************************************************************************************
1212
** DefaultCriteria is the default criteria for grouping photos. It groups photos by:
1313
** 1. Original filename (before extension)
14-
** 2. Local capture time (with no delta as default)
14+
** 2. Local capture time (with 1 second delta to handle minor timestamp variations)
1515
**************************************************************************************************/
1616
var DefaultCriteria = []TCriteria{
1717
{
@@ -24,7 +24,7 @@ var DefaultCriteria = []TCriteria{
2424
{
2525
Key: "localDateTime",
2626
Delta: &TDelta{
27-
Milliseconds: 0, // No delta by default
27+
Milliseconds: 1000, // 1 second delta to handle minor timestamp variations
2828
},
2929
},
3030
}
@@ -33,7 +33,7 @@ var DefaultCriteria = []TCriteria{
3333
** DefaultParentFilenamePromote is the default parent filename promote for grouping photos.
3434
** It promotes the filename of the original filename.
3535
**************************************************************************************************/
36-
var DefaultParentFilenamePromote = []string{"edit", "crop", "hdr", "biggestNumber"}
36+
var DefaultParentFilenamePromote = []string{"cover", "edit", "crop", "hdr", "biggestNumber"}
3737
var DefaultParentFilenamePromoteString = strings.Join(DefaultParentFilenamePromote, ",")
3838

3939
/**************************************************************************************************

0 commit comments

Comments
 (0)