mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #5934 from Bond-009/utf8
SqliteItemRepository: Parse ChannelId directly from utf-8 data
This commit is contained in:
commit
d729a76707
@ -1,6 +1,7 @@
|
|||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Buffers.Text;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -1351,7 +1352,14 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
if (!reader.IsDBNull(index))
|
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++;
|
index++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user