aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaus Vium <clausvium@gmail.com>2019-08-18 17:22:45 +0200
committerClaus Vium <clausvium@gmail.com>2019-08-18 17:22:45 +0200
commite7c05dcfaf5b06a98e89c6eee6e8ccb47c44fdf1 (patch)
tree2ca31b3e1012f41a6c73ca514ebb54180ed77065
parent685e9e4f58c2e00a0157098a2309b2cb97cb2f14 (diff)
Speed up BaseItem deserialization
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs17
1 files changed, 6 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index bb4c34f02..a29ef769d 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -1298,18 +1298,13 @@ namespace Emby.Server.Implementations.Data
if (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");
}
}