[Feature] Extra Conditional Logic with Albums and Tags in Storage Templates #19497
Replies: 2 comments 2 replies
-
Conditionals are already supported; is this request asking for anything more than exposing tags to the storage template? Closely related: #6810 That aside, the storage template is already quite complex (more than I'd like), I'm hesitant to add even more to it. Any template that meaningfully uses tags seems like it would have quite a few layers, and tags (many per asset) are conceptually kind of incompatible with filesystem organization (one path per asset). |
Beta Was this translation helpful? Give feedback.
-
Thanks for your message and for taking the time to propose a direction. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
The feature
Right now, Immich doesn’t support nested albums due to sharing complexity (discussion 2073), but it would be awesome if we could use tags and albums in the storage template with basic conditional logic. That way, we could organize files into nested folders based on their tags and albums, without needing actual nested albums.
Example Use Case:
If a file’s album is Driving and it has the tag Accidents, let us store it at
/Driving/Accidents/File
.If the tag is Close Call, put it at
/Driving/Close Call/File
.So the storage template could use something like:
{{album}}/{{#if contains(tags, 'Accidents')}}Accidents{{/if}}{{#if contains(tags, 'Close Call')}}Close Call{{/if}}/{{file}}
Or, conditional logic that matches the album and tag 100% such as:
{{#if contains(albums, 'Driving')}}Driving/{{#if contains(tags, 'Accidents')}}Accidents{{/if}}{{#if contains(tags, 'Close Call')}}Close Call{{/if}}/{{file}}
Why?
This would let us build folder hierarchies using tags and albums, getting around the nested album limitation
It would be nice if we can achieve something like this using storage templates, albums, and tags:
(PR 2168)
Since files can have multiple tags (PR 11980), it gives us way more control over how folders are created and which tag or album gets used.
It also helps avoid the album sharing and permissions issue we have for nested albums, since tags don’t have the same restrictions.
Possible Challenges:
Need a way to pick which tags (and in what order) get used when there are several. Could default to latest tag when using
{{tag}}
, similar how albums are handled currently.Then have
{{#if contains(tags/albums, 'name')}}
for specific album/tags.Where conditional logic that specifies an album/tag would have priority over the blanket
{{tag}}
and{{album}}
logic.Should be clear how conflicts or duplicate folder paths are handled.
Template syntax needs to be user friendly, allowing for multiple lines of conditional logic.
If this was added, it’d make organizing and backing up photos so much easier for a lot of us, especially since everyone has their own way of organizing their files and this would open up massive opportunity for everyone to organize it exactly how they see fit.
Thanks for considering!
Platform
Beta Was this translation helpful? Give feedback.
All reactions