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
Set sorting order for newly created albums to newest or oldest file first, Immich defaults to newest file first (default: False)
84
+
-A, --find-assets-in-albums
85
+
By default, the script only finds assets that are not assigned to any album yet. Set this option to make the script discover assets that are already part of an album and handle them as usual. (default: False)
83
86
```
84
87
85
88
__Plain example without optional arguments:__
@@ -113,6 +116,7 @@ The environment variables are analoguous to the script's command line arguments.
113
116
| SHARE_ROLE | no | The role for users newly created albums are shared with. Only effective if`SHARE_WITH` is not empty and no explicit share role was specified for at least one user. (default: viewer), allowed values: `viewer`, `editor`|
114
117
| SYNC_MODE | no | Synchronization mode to use. Synchronization mode helps synchronizing changes in external libraries structures to Immich after albums have already been created. Possible Modes: <br>`0` = do nothing<br>`1` = Delete any empty albums<br>`2` = Trigger offline asset removal (REQUIRES API KEY OF AN ADMIN USER!)<br>(default: `0`)<br>Refer to [Dealing with External Library Changes](#dealing-with-external-library-changes). |
115
118
| ALBUM_ORDER | no | Set sorting order for newly created albums to newest (`desc`) or oldest (`asc`) file first, Immich defaults to newest file first, allowed values: `asc`, `desc`|
119
+
| FIND_ASSETS_IN_ALBUMS | no | By default, the script only finds assets that are not assigned to any album yet. Set this option to make the script discover assets that are already part of an album and handle them as usual. (default: `False`)<br>Refer to [Assets in Multiple Albums](#assets-in-multiple-albums). |
116
120
117
121
#### Run the container with Docker
118
122
@@ -188,13 +192,16 @@ Suppose you provide an external library to Immich under the path `/external_libs
188
192
The folder structure of `photos` might look like this:
189
193
190
194
```
191
-
/external_libs/photos/2020
192
-
/external_libs/photos/2020/02 Feb
193
-
/external_libs/photos/2020/02 Feb/Vacation
194
-
/external_libs/photos/2020/08 Aug/Vacation
195
-
/external_libs/photos/Birthdays/John
196
-
/external_libs/photos/Birthdays/Jane
197
-
/external_libs/photos/Skiing 2023
195
+
/external_libs/photos/
196
+
├── 2020/
197
+
│ ├── 02 Feb/
198
+
│ │ └── Vacation/
199
+
│ ├── 08 Aug/
200
+
│ │ └── Vacation/
201
+
├── Birthdays/
202
+
│ ├── John/
203
+
│ └── Jane/
204
+
└── Skiing 2023/
198
205
```
199
206
200
207
Albums created for `root_path = /external_libs/photos` (`--album-levels` is implicitly set to `1`):
@@ -324,6 +331,12 @@ The script will generate album names using the script's arguments and the assets
324
331
> As the name suggests, this mode blindly deletes **ALL** albums from Immich. Use with caution!
325
332
326
333
334
+
## Assets in Multiple Albums
335
+
336
+
By default, the script only fetches assets from Immich that are not assigned to any album yet. This makes querying assets in large libraries very fast. However, if assets should be part of either manually created albums as well as albums based on the folder structure, or if multiple script passes with different album level settings should create differently named albums with overlapping contents, the option `--find-assets-in-albums` (bare Python) or environment variable `FIND_ASSETS_IN_ALBUMS` (Docker) may be set.
337
+
In that case, the script will request all assets from Immich and add them to their corresponding folders, even if the also are part of other albums.
338
+
339
+
327
340
## Dealing with External Library Changes
328
341
329
342
Due to their nature, external libraries may be changed by the user without Immich having any say in it.
Copy file name to clipboardExpand all lines: immich_auto_album.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,7 @@ def is_integer(str):
52
52
parser.add_argument("-o", "--share-role", default="viewer", choices=['viewer', 'editor'], help="The default share role for users newly created albums are shared with. Only effective if --share-with is specified at least once and the share role is not specified within --share-with.")
53
53
parser.add_argument("-S", "--sync-mode", default=0, type=int, choices=[0, 1, 2], help="Synchronization mode to use. Synchronization mode helps synchronizing changes in external libraries structures to Immich after albums have already been created. Possible Modes: 0 = do nothing; 1 = Delete any empty albums; 2 = Trigger offline asset removal (REQUIRES API KEY OF AN ADMIN USER!)")
54
54
parser.add_argument("-O", "--album-order", default=False, type=str, choices=[False, 'asc', 'desc'], help="Set sorting order for newly created albums to newest or oldest file first, Immich defaults to newest file first")
55
+
parser.add_argument("-A", "--find-assets-in-albums", action="store_true", help="By default, the script only finds assets that are not assigned to any album yet. Set this option to make the script discover assets that are already part of an album and handle them as usual.")
0 commit comments