aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2021-04-29 16:23:29 +0200
committerBond_009 <bond.009@outlook.com>2021-04-29 16:23:29 +0200
commit34313ef2165b4889454eaac92b563fe1998854c0 (patch)
treecfdd22df8fa2cf2aa8258f12c9bd81a7c8a7ac7a
parentdcc2df75ec176ca2b4958b0f358f68f2bbaeddd5 (diff)
SqliteItemRepository: Parse ChannelId directly from utf-8 data
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 694805ebe..8d220c807 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -1,6 +1,7 @@
#pragma warning disable CS1591
using System;
+using System.Buffers.Text;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
@@ -1311,7 +1312,14 @@ namespace Emby.Server.Implementations.Data
if (!reader.IsDBNull(index))
{
- item.ChannelId = new Guid(reader.GetString(index));
+ if (!Utf8Parser.TryParse(reader[index].ToBlob(), out Guid value, out _, standardFormat: 'N'))
+ {
+ var str = reader.GetString(index);
+ Logger.LogWarning("{ChannelId} isn't in the expected format", str);
+ value = new Guid(str);
+ }
+
+ item.ChannelId = value;
}
index++;