aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-02-15 19:21:16 +0100
committerGitHub <noreply@github.com>2025-02-15 19:21:16 +0100
commit66e571cd9761bea26ce3c7d4626150aac09ef7af (patch)
tree2ec73e8d86a0c7a063d674c7f14246765be6e663 /Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
parent2db0750abbcb3994a6d6163652566fe5e0e7c7b7 (diff)
parentdebc4997119d4ee2382ed2b31a2d4e38deace1d9 (diff)
Merge pull request #13553 from crobibero/efcore-livetv-epg
Change BaseItemEntity ChannelId to nullable Guid
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/BaseItemRepository.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemRepository.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
index c4f6bf5aa..392b7de74 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
@@ -553,7 +553,7 @@ public sealed class BaseItemRepository
dto.Genres = entity.Genres?.Split('|') ?? [];
dto.DateCreated = entity.DateCreated.GetValueOrDefault();
dto.DateModified = entity.DateModified.GetValueOrDefault();
- dto.ChannelId = string.IsNullOrWhiteSpace(entity.ChannelId) ? Guid.Empty : (Guid.TryParse(entity.ChannelId, out var channelId) ? channelId : Guid.Empty);
+ dto.ChannelId = entity.ChannelId ?? Guid.Empty;
dto.DateLastRefreshed = entity.DateLastRefreshed.GetValueOrDefault();
dto.DateLastSaved = entity.DateLastSaved.GetValueOrDefault();
dto.OwnerId = string.IsNullOrWhiteSpace(entity.OwnerId) ? Guid.Empty : (Guid.TryParse(entity.OwnerId, out var ownerId) ? ownerId : Guid.Empty);
@@ -717,7 +717,7 @@ public sealed class BaseItemRepository
entity.Genres = string.Join('|', dto.Genres);
entity.DateCreated = dto.DateCreated;
entity.DateModified = dto.DateModified;
- entity.ChannelId = dto.ChannelId.ToString();
+ entity.ChannelId = dto.ChannelId;
entity.DateLastRefreshed = dto.DateLastRefreshed;
entity.DateLastSaved = dto.DateLastSaved;
entity.OwnerId = dto.OwnerId.ToString();
@@ -1451,8 +1451,7 @@ public sealed class BaseItemRepository
if (filter.ChannelIds.Count > 0)
{
- var channelIds = filter.ChannelIds.Select(e => e.ToString("N", CultureInfo.InvariantCulture)).ToArray();
- baseQuery = baseQuery.Where(e => channelIds.Contains(e.ChannelId));
+ baseQuery = baseQuery.Where(e => e.ChannelId != null && filter.ChannelIds.Contains(e.ChannelId.Value));
}
if (!filter.ParentId.IsEmpty())