Fix migration UNIQUE constraint on BaseItemProviders

Deduplicate ProviderIds by ProviderId during MigrateLibraryDb migration
to prevent UNIQUE constraint violations when legacy data contains
duplicate provider entries for the same item.

Fixes #16134
This commit is contained in:
David Federman
2026-02-11 23:35:59 -08:00
parent caa05c1bf2
commit 290463fe7b

View File

@@ -1163,7 +1163,9 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
Item = null!,
ProviderId = e[0],
ProviderValue = string.Join('|', e.Skip(1))
}).ToArray();
})
.DistinctBy(e => e.ProviderId)
.ToArray();
}
if (reader.TryGetString(index++, out var imageInfos))