fix: ensure UTC date handling for Live TV extras in database insert
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user