move a computation out of transaction and skip season updates if name matches
This commit is contained in:
parent
7e4e715a90
commit
9a246166b0
|
@ -564,11 +564,12 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
CheckDisposed();
|
||||
|
||||
var images = SerializeImages(item.ImageInfos);
|
||||
using var connection = GetConnection();
|
||||
using var transaction = connection.BeginTransaction();
|
||||
using var saveImagesStatement = PrepareStatement(connection, "Update TypedBaseItems set Images=@Images where guid=@Id");
|
||||
saveImagesStatement.TryBind("@Id", item.Id);
|
||||
saveImagesStatement.TryBind("@Images", SerializeImages(item.ImageInfos));
|
||||
saveImagesStatement.TryBind("@Images", images);
|
||||
|
||||
saveImagesStatement.ExecuteNonQuery();
|
||||
transaction.Commit();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
@ -227,7 +228,13 @@ namespace MediaBrowser.Providers.TV
|
|||
}
|
||||
else
|
||||
{
|
||||
existingSeason.Name = GetValidSeasonNameForSeries(series, seasonName, seasonNumber);
|
||||
var name = GetValidSeasonNameForSeries(series, seasonName, seasonNumber);
|
||||
if (string.Equals(existingSeason.Name, name, StringComparison.Ordinal))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
existingSeason.Name = name;
|
||||
await existingSeason.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user