immich
immich copied to clipboard
feat(server): "{album}" in storage template
See #2933
This allows for using {album} as a storage-template token
If an asset belongs to one or more albums, the name of the first album will be taken. If an asset doesn't belong to an album, the token will be skipped, so it will be placed in the root of the path where the folder would be created ({album} will be evaluated to ".")
If Assets are added to Albums, a storage migration job must be run. Otherwise if one uploads an asset directly into an album, it will be saved at the correct location without having to run it afterwards.
The only issue I see here, is the perfomance impact due to the changes in album.repository.ts. Right now, the albums of every asset will be queried when getById() or getAll() are called, even if they are currently not needed except for this case.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| immich | ⬜️ Ignored (Inspect) | Visit Preview | Oct 23, 2023 5:44pm |
This feature would be great for organiazing and syncing with other apps like onedrive (one copy is no copy). Lets bump it up, seems like not that big of a change.
I can't wait for this feature to be added, it will be much easier to organize albums and photos.
Hi to all,
Is there anything new concerning the implementation of this feature ? I think this is the only thing refraining me from using immich.
Many thanks
Hi to all,
Is there anything new concerning the implementation of this feature ? I think this is the only thing refraining me from using immich.
Many thanks
Yes, this is also the only reason that prevents me from using it. I have hundreds of thousands of photos stored on my NAS, distributed in different folders, and I cannot upload all of them to Immic's library
@lgrawet
Hi to all, Is there anything new concerning the implementation of this feature ? I think this is the only thing refraining me from using immich. Many thanks
Yes, this is also the only reason that prevents me from using it. I have hundreds of thousands of photos stored on my NAS, distributed in different folders, and I cannot upload all of them to Immic's library
@lgrawet
For that use case the external library feature might be the better fit. With that you do not have to import the files into immich file structure. I'm also wishing for nested albums for external libraries to have a de-facto filesystem view.
Hi to all, Is there anything new concerning the implementation of this feature ? I think this is the only thing refraining me from using immich. Many thanks
Yes, this is also the only reason that prevents me from using it. I have hundreds of thousands of photos stored on my NAS, distributed in different folders, and I cannot upload all of them to Immic's library @lgrawet
For that use case the external library feature might be the better fit. With that you do not have to import the files into immich file structure. I'm also wishing for nested albums for external libraries to have a de-facto filesystem view.
@klaus1k
Could you please guide me on how to mount an external library?
Hi to all, Is there anything new concerning the implementation of this feature ? I think this is the only thing refraining me from using immich. Many thanks
Yes, this is also the only reason that prevents me from using it. I have hundreds of thousands of photos stored on my NAS, distributed in different folders, and I cannot upload all of them to Immic's library @lgrawet
For that use case the external library feature might be the better fit. With that you do not have to import the files into immich file structure. I'm also wishing for nested albums for external libraries to have a de-facto filesystem view.
@klaus1k Could you please guide me on how to mount an external library?
Sure, this feature just released a month or two ago so it is relatively new! The corresponding documentation can be found here: https://immich.app/docs/features/libraries
This {album} template feature here is one I am looking forward the most. It would enable the possibility to backup "WhatsApp Images" "Screenshots",... in separate folders on the server, without having them mixed together with my "real" photos on the file/folder level.
Hi to all, Is there anything new concerning the implementation of this feature ? I think this is the only thing refraining me from using immich. Many thanks
Yes, this is also the only reason that prevents me from using it. I have hundreds of thousands of photos stored on my NAS, distributed in different folders, and I cannot upload all of them to Immic's library @lgrawet
For that use case the external library feature might be the better fit. With that you do not have to import the files into immich file structure. I'm also wishing for nested albums for external libraries to have a de-facto filesystem view.
@klaus1k Could you please guide me on how to mount an external library?
Sure, this feature just released a month or two ago so it is relatively new! The corresponding documentation can be found here: https://immich.app/docs/features/libraries
This {album} template feature here is one I am looking forward the most. It would enable the possibility to backup "WhatsApp Images" "Screenshots",... in separate folders on the server, without having them mixed together with my "real" photos on the file/folder level.
While the External Album feature solves the problem for old media, the {album} feature is needed, if you plan to organize your new media laboriously inside immich. Imagine sorting everything in albums, but they are only present in this app, that for example doesn't work on Google TV, so you have to access them via DLNA. Or imagine having a problem with the immich database or immich itself and everything you have is your folder structure.
The {album}-Feature is more manditory than any of the other storage templates IMO and I don't understand, why my PR is ignored for months now, even if I communicated everything in discord while implementing it.
While the External Album feature solves the problem for old media, the {album} feature is needed, if you plan to organize your new media laboriously inside immich. Imagine sorting everything in albums, but they are only present in this app, that for example doesn't work on Google TV, so you have to access them via DLNA. Or imagine having a problem with the immich database or immich itself and everything you have is your folder structure.
The {album}-Feature is more manditory than any of the other storage templates IMO and I don't understand, why my PR is ignored for months now, even if I communicated everything in discord while implementing it.
I'm absolutely with you, the {album} feature is very important! I am still using Photosync as my main backup solution from mobile just because I can replicate the folder/album structure from my phone to my server. I wish I could ditch Photosync, and only use immich in the future!
Recently, I got acquainted with Immich, and I was very eager to use it. But since I have been keeping my photos in a certain directory structure for years and I don't want to change it, I did not find Immich as a solution for myself. But I think having album in storage template would allow me to keep my old structure and use Immich as well.
@yottanami you can also use the library feature for this purpose.
I didn't have a chance to got back to this one yet
I made the following changes:
- Rebased on main and resolve the merge conflicts
- Don't load albums automatically for any of the repository methods
- Lazily load albums if/when they are needed in a template
- Add/document the
{{album}}option in the web, under admin settings > storage template > variables > other options
Tested scenarios:
- Two albums with the same name
- An album named:
.,..,../parent,Album 1.2
Seems to work OK. There may be a lot of files in a single directory during an initial upload with this template.
@yottanami you can also use the library feature for this purpose.
@alextran1502 Thanks for the answer. Correct me if I am wrong, but as far as I got for using libraries, I need to add external libraries which are read-only. But I need to be able to delete some of the photos or mark them somehow to be deleted later
@jrasm91 - I can see that this functionality has made it into v. 1.83.0 - but I can't get it to work for External Storage. Just want to verify if the {{album}} tag is only for import, or should it work when adding images via Import Path libraries?
This does not apply to external libraries
Tried to add a feature request to include it for external storage import, but no luck being allowed to add (no idea why).
@nikolajhendel this is only applied to the default upload library.
Thank you very much for merging my PR. We established Immich in our everyday life since then, and it's a true bessling.
I just found out a little bug, where ' in an Album name becomes ' in the folder name. Seems like Path.normalize is not normalizing enough 😅.
I will try to fix it soon and test other special characters.
I "solved" it: #4917
I would like to use the Album Keyword in my filenames and use it in combination with other Keywords.
in a template like that it would be best to evaluate an empty album as an empty string.
It would be even Better if it were possible to define characters that should only appear if there is an album name set.
e.g. {_{album}} would be evaluated to "_ALBUM NAME" or ""
/{{album}}/ should obviously still be interpreted as "/./" and not as "//"
Well I would like to store my assets into album folder structure but keep the original structure for assets not belonging to any album. Otherwise all unassigned assets end up in the root directory of the library. It there any possibility to do this ?
Thanks!
I would like to use the Album Keyword in my filenames and use it in combination with other Keywords. in a template like that it would be best to evaluate an empty album as an empty string. It would be even Better if it were possible to define characters that should only appear if there is an album name set. e.g.
{_{album}}would be evaluated to "_ALBUM NAME" or ""
/{{album}}/should obviously still be interpreted as "/./" and not as "//"
I tried this using the built in helpers from https://handlebarsjs.com/guide/builtin-helpers.html#if but it doesn't seem to work either.
{{y}}/{{#if album}}{{MM}}_{{{album}}}{{else}}_{{MM}}{{/if}}/{{filename}}