[PR #16128] [CLOSED] Update map.repository.sql - fix for assets in multiple albums #14756

Closed
opened 2026-02-05 15:37:16 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/16128
Author: @jbcodemonkey
Created: 2/16/2025
Status: Closed

Base: mainHead: patch-1


📝 Commits (1)

  • 49d70a2 Update map.repository.sql

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 server/src/queries/map.repository.sql (+2 -2)

📄 Description

Fix for assets in multiple albums, return distinct assets only.
Otherwise counters and viewing show assets as many times as they are present in albums, which affects counters and viewing.

Description

Current query returns duplicate assets if they are in multiple albums. This would cause the map counter to read 2 instead of 1 if the asset is present in two albums. When viewing, extra clicks are required to advance then assets are in multiple albums.
Updated query returns unique assets only.

Fixes # (issue)
Could not find reported issue, experienced it myself.

How Has This Been Tested?

Tested using pgadmin on my current database ~18000 assets.
Happy to test a beta build. :)

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/16128 **Author:** [@jbcodemonkey](https://github.com/jbcodemonkey) **Created:** 2/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`49d70a2`](https://github.com/immich-app/immich/commit/49d70a2d4ea864b060d067c87ad3da90c77ad58e) Update map.repository.sql ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/src/queries/map.repository.sql` (+2 -2) </details> ### 📄 Description Fix for assets in multiple albums, return distinct assets only. Otherwise counters and viewing show assets as many times as they are present in albums, which affects counters and viewing. ## Description Current query returns duplicate assets if they are in multiple albums. This would cause the map counter to read 2 instead of 1 if the asset is present in two albums. When viewing, extra clicks are required to advance then assets are in multiple albums. Updated query returns unique assets only. Fixes # (issue) Could not find reported issue, experienced it myself. ## How Has This Been Tested? Tested using pgadmin on my current database ~18000 assets. Happy to test a beta build. :) ## 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 15:37:16 +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#14756