Skip to content

Conversation

@Nykri
Copy link
Contributor

@Nykri Nykri commented Jan 3, 2026

Description

Generates a unique album name when several directories have the same name. It does that using the parent folders names.

This is especially useful for directory structure like:

photos/
├── 2023
  ├── Bretagne
    ├── image.png
    ├── photo.jpg
  ├── summer
    ├── beach
      ├── image.png
      ├── photo.jpg
    ├── city
      ├── image.png
      ├── photo.jpg
    ├── image.png
    ├── photo.jpg
├── 2024
  ├── Bretagne
    ├── image.png
    ├── photo.jpg
  ├── summer
    ├── beach
      ├── image.png
      ├── photo.jpg
    ├── city
      ├── image.png
      ├── photo.jpg
    ├── image.png
    ├── photo.jpg

The albums created are:

  • "2023 Bretagne"
  • "2023 summer beach"
  • "2023 summer city"
  • "2023 summer"
  • "2024 Bretagne"
  • "2024 summer beach"
  • "2024 summer city"
  • "2024 summer"

This was moved from #19855

How Has This Been Tested?

Tested on a dummy file structure

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

@immich-push-o-matic immich-push-o-matic bot added the cli Tasks related to the Immich CLI label Jan 3, 2026
@bo0tzz
Copy link
Member

bo0tzz commented Jan 3, 2026

What happened to #19855 that necessitates a new PR?

@Nykri
Copy link
Contributor Author

Nykri commented Jan 3, 2026

I was asked to move everything else than hash caching to other PRs: #19855 (review)

@bo0tzz
Copy link
Member

bo0tzz commented Jan 3, 2026

Ah my bad, I'd missed that this is not a "copy" of that PR. Carry on, thank you!

@randellhodges
Copy link

I quickly peeked at the changes and I'm not sure if you already did this. If not, something that would be nice would be to collapse prefixed words. For "reasons", I have folder paths like

San Diego\
  San Diego - Beach\
  San Diego - Meditation Gardens\

It would be nice if when it merged the names, it would check if the child name starts with the parent name, and if so, don't add it.

Not all my folders are like that, but it is an edge case that would be nice to be handled when encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:feature cli Tasks related to the Immich CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants