From 315b7e0bd07d1edddca6a087ca4120c01b0cce41 Mon Sep 17 00:00:00 2001 From: Wendell Jones Date: Mon, 4 May 2026 13:57:32 -0400 Subject: [PATCH] fix: ensure UTC date handling for Live TV extras in database insert --- .../Item/BaseItemRepository.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index 36ef7815..74c2ac19 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -1224,9 +1224,15 @@ public sealed class BaseItemRepository if (liveTvExtras is not null) { + var startDate = liveTvExtras.StartDate.HasValue + ? (DateTime?)DateTime.SpecifyKind(liveTvExtras.StartDate.Value, DateTimeKind.Utc) + : null; + var endDate = liveTvExtras.EndDate.HasValue + ? (DateTime?)DateTime.SpecifyKind(liveTvExtras.EndDate.Value, DateTimeKind.Utc) + : null; await context.Database.ExecuteSqlAsync( $@"INSERT INTO library.base_item_live_tv_extras (item_id, start_date, end_date, episode_title, show_id, external_series_id, external_service_id, audio) - VALUES ({extItemId}, {liveTvExtras.StartDate}, {liveTvExtras.EndDate}, {liveTvExtras.EpisodeTitle}, {liveTvExtras.ShowId}, {liveTvExtras.ExternalSeriesId}, {liveTvExtras.ExternalServiceId}, {(int?)liveTvExtras.Audio}) + VALUES ({extItemId}, {startDate}, {endDate}, {liveTvExtras.EpisodeTitle}, {liveTvExtras.ShowId}, {liveTvExtras.ExternalSeriesId}, {liveTvExtras.ExternalServiceId}, {(int?)liveTvExtras.Audio}) ON CONFLICT (item_id) DO UPDATE SET start_date = EXCLUDED.start_date, end_date = EXCLUDED.end_date,