aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteItemRepository.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2021-05-05 14:04:20 +0200
committerGitHub <noreply@github.com>2021-05-05 14:04:20 +0200
commitd729a7670782c3a002485bdd3ffefa8651b14d27 (patch)
tree5bf2db9c1776771006b0808d29cb13439b396fef /Emby.Server.Implementations/Data/SqliteItemRepository.cs
parentb6df85136347df691ebc774b9d48dc622cb63a04 (diff)
parent34313ef2165b4889454eaac92b563fe1998854c0 (diff)
Merge pull request #5934 from Bond-009/utf8
SqliteItemRepository: Parse ChannelId directly from utf-8 data
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
-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 4b9b0bed0..72c9d82ad 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;
@@ -1351,7 +1352,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++;