aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteItemRepository.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs66
1 files changed, 0 insertions, 66 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index ea3845f0c..b895f68aa 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -4716,72 +4716,6 @@ namespace Emby.Server.Implementations.Data
public void UpdateInheritedValues(CancellationToken cancellationToken)
{
- UpdateInheritedTags(cancellationToken);
- }
-
- private void UpdateInheritedTags(CancellationToken cancellationToken)
- {
- var newValues = new List<Tuple<Guid, string[]>>();
-
- var commandText = @"select guid,
-(select group_concat(Value, '|') from ItemValues where (ItemValues.ItemId = Outer.Guid OR ItemValues.ItemId in ((Select AncestorId from AncestorIds where AncestorIds.ItemId=Outer.guid))) and ItemValues.Type = 4) NewInheritedTags,
-(select group_concat(Value, '|') from ItemValues where ItemValues.ItemId = Outer.Guid and ItemValues.Type = 6) CurrentInheritedTags
-from typedbaseitems as Outer
-where (NewInheritedTags <> CurrentInheritedTags or (NewInheritedTags is null) <> (CurrentInheritedTags is null))
-limit 100";
-
- using (WriteLock.Write())
- {
- using (var connection = CreateConnection())
- {
- connection.RunInTransaction(db =>
- {
- foreach (var row in connection.Query(commandText))
- {
- var id = row.GetGuid(0);
- string value = row.IsDBNull(1) ? null : row.GetString(1);
-
- var valuesArray = string.IsNullOrWhiteSpace(value) ? new string[] { } : value.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
-
- newValues.Add(new Tuple<Guid, string[]>(id, valuesArray));
- }
-
- Logger.Debug("UpdateInheritedTags - {0} rows", newValues.Count);
- if (newValues.Count == 0)
- {
- return;
- }
-
- using (var insertStatement = PrepareStatement(connection, "insert into ItemValues (ItemId, Type, Value, CleanValue) values (@ItemId, 6, @Value, @CleanValue)"))
- {
- using (var deleteStatement = PrepareStatement(connection, "delete from ItemValues where ItemId=@ItemId and Type=6"))
- {
- foreach (var item in newValues)
- {
- var guidBlob = item.Item1.ToGuidBlob();
-
- deleteStatement.Reset();
- deleteStatement.TryBind("@ItemId", guidBlob);
- deleteStatement.MoveNext();
-
- foreach (var itemValue in item.Item2)
- {
- insertStatement.Reset();
-
- insertStatement.TryBind("@ItemId", guidBlob);
- insertStatement.TryBind("@Value", itemValue);
-
- insertStatement.TryBind("@CleanValue", GetCleanValue(itemValue));
-
- insertStatement.MoveNext();
- }
- }
- }
- }
-
- }, TransactionMode);
- }
- }
}
private static Dictionary<string, string[]> GetTypeMapDictionary()