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 GitHub
parent 395a36e10f
commit 0f1ede2581

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