Skip to content

Commit a7b8f06

Browse files
committed
README
Added documentation for album level ranges
1 parent 2771cc3 commit a7b8f06

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ options:
3939
Additional external libarary root path in Immich; May be specified multiple times for multiple import paths or external libraries. (default: None)
4040
-u, --unattended Do not ask for user confirmation after identifying albums. Set this flag to run script as a cronjob. (default: False)
4141
-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)
4344
-s ALBUM_SEPARATOR, --album-separator ALBUM_SEPARATOR
4445
Separator string to use for compound album names created from nested folders. Only effective if -a is set to a value > 1 (default: )
4546
-c CHUNK_SIZE, --chunk-size CHUNK_SIZE
@@ -62,7 +63,7 @@ The environment variables are analoguous to the script's command line arguments.
6263
| ROOT_PATH | yes | A single or a comma separated list of import paths for external libraries in Immich |
6364
| API_URL | yes | The root API URL of immich, e.g. https://immich.mydomain.com/api/ |
6465
| 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|
6667
| 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: " ") |
6768
| CHUNK_SIZE | no | Maximum number of assets to add to an album with a single API call (default: 2000) |
6869
| 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`:
179180
- `Jane` (containing all imags from `Birthdays/Jane`)
180181
- `Skiing 2023`
181182

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).
183201

184202
Since Immich does not support real nested albums ([yet?](https://github.com/immich-app/immich/discussions/2073)), neither does this script.
185203

0 commit comments

Comments
 (0)