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.
This commit is contained in:
Kendall Garner 2025-11-16 17:54:28 +00:00 committed by Joe Stump
parent 923e099110
commit b4fb193cfb
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -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},
}
}