[PR #2048] [MERGED] feat(server): improve and refactor get all albums #9348

Closed
opened 2026-02-05 14:03:07 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/2048
Author: @michelheusschen
Created: 3/22/2023
Status: Merged
Merged: 3/26/2023
Merged by: @alextran1502

Base: mainHead: feat/server-list-albums


📝 Commits (2)

  • 6760e35 feat(server): improve and refactor get all albums
  • 9d4b4ef Merge branch 'main' of github.com:immich-app/immich into feat/server-list-albums

📊 Changes

23 files changed (+1143 additions, -868 deletions)

View changed files

📝 mobile/openapi/doc/AlbumApi.md (+1 -1)
📝 server/apps/immich/src/api-v1/album/album-repository.ts (+1 -74)
📝 server/apps/immich/src/api-v1/album/album.controller.ts (+0 -10)
📝 server/apps/immich/src/api-v1/album/album.service.spec.ts (+1 -90)
📝 server/apps/immich/src/api-v1/album/album.service.ts (+1 -28)
📝 server/apps/immich/src/app.module.ts (+2 -0)
server/apps/immich/src/controllers/album.controller.ts (+21 -0)
📝 server/apps/immich/src/controllers/index.ts (+1 -0)
📝 server/apps/immich/test/album.e2e-spec.ts (+87 -31)
📝 server/immich-openapi-specs.json (+631 -630)
📝 server/libs/domain/src/album/album.repository.ts (+11 -0)
server/libs/domain/src/album/album.service.spec.ts (+114 -0)
server/libs/domain/src/album/album.service.ts (+58 -0)
📝 server/libs/domain/src/album/dto/get-albums.dto.ts (+7 -2)
📝 server/libs/domain/src/album/index.ts (+1 -0)
📝 server/libs/domain/src/asset/asset.repository.ts (+1 -0)
📝 server/libs/domain/src/domain.module.ts (+2 -0)
📝 server/libs/domain/test/album.repository.mock.ts (+6 -0)
📝 server/libs/domain/test/asset.repository.mock.ts (+1 -0)
📝 server/libs/domain/test/fixtures.ts (+91 -0)

...and 3 more files

📄 Description

Continuation of #1937 to improve the performance of the /api/album endpoint. Used default TypeORM functions instead of the query builder where possible. Although I originally planned to refactor the entire album repo, I decided against it because it would make tracking changes more difficult.

  • Improved listing albums performance. Listing 20 albums with 5000 assets each (100.000 assets total) now takes less than 50ms (before >2s)
  • Fix bug where /api/album?shared=false would include albums with shared links
  • Better validation for query paramters
  • Extended album E2E tests
  • Refactored to using domain/infra
  • Refactored updating thumbnails

🔄 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/2048 **Author:** [@michelheusschen](https://github.com/michelheusschen) **Created:** 3/22/2023 **Status:** ✅ Merged **Merged:** 3/26/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `feat/server-list-albums` --- ### 📝 Commits (2) - [`6760e35`](https://github.com/immich-app/immich/commit/6760e359bc87ec72b999877f51b9b7d74f789acc) feat(server): improve and refactor get all albums - [`9d4b4ef`](https://github.com/immich-app/immich/commit/9d4b4ef5f5f3350286a3d51b2dec4a470da114bf) Merge branch 'main' of github.com:immich-app/immich into feat/server-list-albums ### 📊 Changes **23 files changed** (+1143 additions, -868 deletions) <details> <summary>View changed files</summary> 📝 `mobile/openapi/doc/AlbumApi.md` (+1 -1) 📝 `server/apps/immich/src/api-v1/album/album-repository.ts` (+1 -74) 📝 `server/apps/immich/src/api-v1/album/album.controller.ts` (+0 -10) 📝 `server/apps/immich/src/api-v1/album/album.service.spec.ts` (+1 -90) 📝 `server/apps/immich/src/api-v1/album/album.service.ts` (+1 -28) 📝 `server/apps/immich/src/app.module.ts` (+2 -0) ➕ `server/apps/immich/src/controllers/album.controller.ts` (+21 -0) 📝 `server/apps/immich/src/controllers/index.ts` (+1 -0) 📝 `server/apps/immich/test/album.e2e-spec.ts` (+87 -31) 📝 `server/immich-openapi-specs.json` (+631 -630) 📝 `server/libs/domain/src/album/album.repository.ts` (+11 -0) ➕ `server/libs/domain/src/album/album.service.spec.ts` (+114 -0) ➕ `server/libs/domain/src/album/album.service.ts` (+58 -0) 📝 `server/libs/domain/src/album/dto/get-albums.dto.ts` (+7 -2) 📝 `server/libs/domain/src/album/index.ts` (+1 -0) 📝 `server/libs/domain/src/asset/asset.repository.ts` (+1 -0) 📝 `server/libs/domain/src/domain.module.ts` (+2 -0) 📝 `server/libs/domain/test/album.repository.mock.ts` (+6 -0) 📝 `server/libs/domain/test/asset.repository.mock.ts` (+1 -0) 📝 `server/libs/domain/test/fixtures.ts` (+91 -0) _...and 3 more files_ </details> ### 📄 Description Continuation of #1937 to improve the performance of the `/api/album` endpoint. Used default TypeORM functions instead of the query builder where possible. Although I originally planned to refactor the entire album repo, I decided against it because it would make tracking changes more difficult. - Improved listing albums performance. Listing 20 albums with 5000 assets each (100.000 assets total) now takes less than 50ms (before >2s) - Fix bug where `/api/album?shared=false` would include albums with shared links - Better validation for query paramters - Extended album E2E tests - Refactored to using domain/infra - Refactored updating thumbnails --- <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 14:03:07 +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#9348