The Free Software Media System - Server Backend & API
Speed up BaseItem deserialization
Claus Viume7c05dcfaf5b
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex bb4c34f02f..a29ef769d3 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -1298,18 +1298,13 @@ namespace Emby.Server.Implementations.Dataif (TypeRequiresDeserialization(type)){- using (var stream = new MemoryStream(reader[1].ToBlob()))+ try{- stream.Position = 0;-- try- {- item = _jsonSerializer.DeserializeFromStream(stream, type) as BaseItem;- }- catch (SerializationException ex)- {- Logger.LogError(ex, "Error deserializing item");- }+ item = _jsonSerializer.DeserializeFromString(reader[1].ToString(), type) as BaseItem;+ }+ catch (SerializationException ex)+ {+ Logger.LogError(ex, "Error deserializing item");}}