You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,8 @@ options:
39
39
Additional external libarary root path in Immich; May be specified multiple times for multiple import paths or external libraries. (default: None)
40
40
-u, --unattended Do not ask for user confirmation after identifying albums. Set this flag to run script as a cronjob. (default: False)
41
41
-a ALBUM_LEVELS, --album-levels ALBUM_LEVELS
42
-
Number of sub-folders below the root path used for album name creation. Positive numbers start from top of the folder structure, negative numbers from the bottom. Cannot be 0. (default: 1)
42
+
Number of sub-folders or range of sub-folder levels below the root path used for album name creation. Positive numbers start from top of the folder structure, negative numbers from the bottom. Cannot be 0. If a range should be set, the start level and end level must be separated by a comma
43
+
like '<startLevel>,<endLevel>'. If negative levels are used in a range, <startLevel> must be less than or equal to <endLevel>. (default: 1)
Separator string to use for compound album names created from nested folders. Only effective if -a is set to a value > 1 (default: )
45
46
-c CHUNK_SIZE, --chunk-size CHUNK_SIZE
@@ -62,7 +63,7 @@ The environment variables are analoguous to the script's command line arguments.
62
63
| ROOT_PATH | yes | A single or a comma separated list of import paths for external libraries in Immich |
63
64
| API_URL | yes | The root API URL of immich, e.g. https://immich.mydomain.com/api/|
64
65
| API_KEY | yes | The Immich API Key to use |
65
-
| ALBUM_LEVELS | no | Number of sub-folders below the root path used for album name creation. Positive numbers start from top of the folder structure, negative numbers from the bottom. Cannot be 0. Refer to [How it works](#how-it-works) for a detailed explanation|
66
+
| ALBUM_LEVELS | no | Number of sub-folders or range of sub-folder levels below the root path used for album name creation. Positive numbers start from top of the folder structure, negative numbers from the bottom. Cannot be 0. If a range should be set, the start level and end level must be separated by a comma. Refer to [How it works](#how-it-works) for a detailed explanation|
66
67
| ALBUM_SEPARATOR | no | Separator string to use for compound album names created from nested folders. Only effective if -a is set to a value > 1 (default: " ") |
67
68
| CHUNK_SIZE | no | Maximum number of assets to add to an album with a single API call (default: 2000) |
68
69
| FETCH_CHUNK_SIZE | no | Maximum number of assets to fetch with a single API call (default: 5000) |
@@ -179,7 +180,24 @@ Albums created for `root_path = /external_libs/photos/Birthdays`:
179
180
-`Jane` (containing all imags from `Birthdays/Jane`)
180
181
-`Skiing 2023`
181
182
182
-
Note that with negative `album-levels` images from different parent folders will be mixed in the same album if they reside in folders with the same name (see `Vacation` in example above).
183
+
### Album Level Ranges
184
+
185
+
It is possible to specify not just a nunmber for `album-levels`, but a range from level x to level y in the folder structure that should make up an album's name:
186
+
`--album-levels="2,3"`
187
+
The range is applied to the folder structure beneath `root_path` from the top for positive levels and from the bottom for negative levels.
188
+
Suppose the following folder structure for an external library with the script's `root_path` set to `/external_libs/photos`:
189
+
```
190
+
/external_libs/photos/2020/2020 02 Feb/Vacation
191
+
/external_libs/photos/2020/2020 08 Aug/Vacation
192
+
```
193
+
-`--album-levels="2,3"` will create albums (for this folder structure, this is equal to `--album-levels="-2"`)
194
+
-`2020 02 Feb Facation`
195
+
-`2020 08 Aug Vacation`
196
+
-`--album-levels="2,2"` will create albums (for this folder structure, this is equal to `--album-levels="-2,-2"`)
197
+
-`2020 02 Feb`
198
+
-`2020 08 Aug`
199
+
200
+
⚠️ Note that with negative `album-levels` or album level ranges, images from different parent folders will be mixed in the same album if they reside in sub-folders with the same name (see `Vacation` in example above).
183
201
184
202
Since Immich does not support real nested albums ([yet?](https://github.com/immich-app/immich/discussions/2073)), neither does this script.
0 commit comments