mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-08 10:44:23 -04:00
handle duplicate provider ids
This commit is contained in:
parent
2e91d69d20
commit
8627683f18
@ -4179,6 +4179,13 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
throw new ArgumentNullException("values");
|
throw new ArgumentNullException("values");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Just in case there might be case-insensitive duplicates, strip them out now
|
||||||
|
var newValues = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
foreach (var pair in values)
|
||||||
|
{
|
||||||
|
newValues[pair.Key] = pair.Value;
|
||||||
|
}
|
||||||
|
|
||||||
CheckDisposed();
|
CheckDisposed();
|
||||||
|
|
||||||
// First delete
|
// First delete
|
||||||
@ -4187,7 +4194,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
|
|
||||||
_deleteProviderIdsCommand.ExecuteNonQuery();
|
_deleteProviderIdsCommand.ExecuteNonQuery();
|
||||||
|
|
||||||
foreach (var pair in values)
|
foreach (var pair in newValues)
|
||||||
{
|
{
|
||||||
_saveProviderIdsCommand.GetParameter(0).Value = itemId;
|
_saveProviderIdsCommand.GetParameter(0).Value = itemId;
|
||||||
_saveProviderIdsCommand.GetParameter(1).Value = pair.Key;
|
_saveProviderIdsCommand.GetParameter(1).Value = pair.Key;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user