From b4fb193cfb7fba0c65fcb97f1bcbb0b4d3a0dfd1 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Sun, 16 Nov 2025 17:54:28 +0000 Subject: [PATCH] fix(scanner): specify exact table to use for missing mediafile filter (#4689) In `getAffectedAlbumIDs`, when one or more IDs is added, it adds a filter `"id": ids`. This filter is ambiguous though, because the `getAll` query joins with library table, which _also_ has an `id` field. Clarify this by adding the table name to the filter. Note that this was not caught in testing, as it only uses mock db. --- core/maintenance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/maintenance.go b/core/maintenance.go index c2f65d74f..750fd3a9e 100644 --- a/core/maintenance.go +++ b/core/maintenance.go @@ -166,7 +166,7 @@ func (s *maintenanceService) getAffectedAlbumIDs(ctx context.Context, ids []stri if len(ids) > 0 { filters = squirrel.And{ squirrel.Eq{"missing": true}, - squirrel.Eq{"id": ids}, + squirrel.Eq{"media_file.id": ids}, } }