[script] Sync folders with albums #3382
daniele-athome
started this conversation in
Community Guides
Replies: 2 comments 2 replies
-
Would it also be possible with this script to upload photos from existing folders into albums in Immich? I have a bunch of photos sorted in folders/albums (by year and sometimes occasion) and would like to have everything in a huge Immich database. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Many other alternatives also available in this discussion: #4279 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there,
While waiting for nested albums and/or a file system view or whatever will come out of the Gallery Watcher, I wrote a little script that will synchronize the folders in your (imported, not uploaded) library with albums having the folders name.
This script is for people using exclusively imported libraries. I didn't test it with uploaded photos.
The script: https://gist.github.com/daniele-athome/82ce8af869ec0e20cd73b69acbc589bd
The only dependencies (other than basic shell utils) are
curl
andjq
.Invocation:
<library-path>
must be the same absolute path used as your imported library path. The path is only used to create album names; no access to the file system is needed.How it works
If you have a directory structure like:
Album names will be:
To reflect the nature of a file system, the script will also make sure that any photo belongs to only one album (and it will remove it from all albums except the one that is supposed to belong to).
Everything is done through API so for huge libraries it will take some time. It's not bulletproof, but it works.
Beta Was this translation helpful? Give feedback.
All reactions