[PR #24997] feat(cli): Generate unique album names for nested directories #18034

Open
opened 2026-02-05 16:31:32 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/24997
Author: @Nykri
Created: 1/3/2026
Status: 🔄 Open

Base: mainHead: feat/nested-albums


📝 Commits (1)

  • 48420de Generate unique album names for nested dirs

📊 Changes

1 file changed (+130 additions, -5 deletions)

View changed files

📝 cli/src/commands/asset.ts (+130 -5)

📄 Description

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/)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/24997 **Author:** [@Nykri](https://github.com/Nykri) **Created:** 1/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/nested-albums` --- ### 📝 Commits (1) - [`48420de`](https://github.com/immich-app/immich/commit/48420de526fdf5573be215d4bf927fed368a7ff4) Generate unique album names for nested dirs ### 📊 Changes **1 file changed** (+130 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `cli/src/commands/asset.ts` (+130 -5) </details> ### 📄 Description ## 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: - [x] I have performed a self-review of my own code - [x] I have made corresponding changes to the documentation if applicable - [x] I have no unrelated changes in the PR. - [x] I have confirmed that any new dependencies are strictly necessary. - [x] I have written tests for new code (if applicable) - [x] I have followed naming conventions/patterns in the surrounding code - [x] All code in `src/services/` uses repositories implementations for database calls, filesystem operations, etc. - [x] All code in `src/repositories/` is pretty basic/simple and does not have any immich specific logic (that belongs in `src/services/`) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 16:31:32 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#18034