@ -1189,10 +1189,18 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
@@ -1189,10 +1189,18 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
// must deserialize channel from json
foreach(ExternalJsonChannelchannelinmaybeChannel)
{
// TODO: null start time should log and throw
if(string.IsNullOrWhiteSpace(channel.StartTime))
{
_logger.LogError(
"External json channel in file {File} has no start time; unable to refresh channel data",
path);
thrownewInvalidOperationException(
$"External json channel in file {path} has no start time");
@ -20,7 +20,10 @@ public class ReplacePlayoutAlternateScheduleItemsHandler(
@@ -20,7 +20,10 @@ public class ReplacePlayoutAlternateScheduleItemsHandler(
ReplacePlayoutAlternateScheduleItemsrequest,
CancellationTokencancellationToken)
{
// TODO: validate that items is not empty
if(request.Items.Count==0)
{
returnBaseError.New("Playout alternate schedule items must not be empty");
@ -92,10 +92,18 @@ public class ExternalJsonPlayoutItemProvider : IExternalJsonPlayoutItemProvider
@@ -92,10 +92,18 @@ public class ExternalJsonPlayoutItemProvider : IExternalJsonPlayoutItemProvider
// must deserialize channel from json
foreach(ExternalJsonChannelchannelinmaybeChannel)
{
// TODO: null start time should log and throw
if(string.IsNullOrWhiteSpace(channel.StartTime))
{
_logger.LogError(
"External json channel in file {File} has no start time; unable to locate playout item",
playout.ScheduleFile);
thrownewInvalidOperationException(
$"External json channel in file {playout.ScheduleFile} has no start time");
}
DateTimeOffsetstartTime=DateTimeOffset.Parse(
channel.StartTime??string.Empty,
channel.StartTime,
CultureInfo.InvariantCulture,
DateTimeStyles.AssumeUniversal).ToLocalTime();
@ -207,14 +215,35 @@ public class ExternalJsonPlayoutItemProvider : IExternalJsonPlayoutItemProvider
@@ -207,14 +215,35 @@ public class ExternalJsonPlayoutItemProvider : IExternalJsonPlayoutItemProvider
"Unable to stream remotely; Plex server {ServerName} has no auth token",
server.ServerName);
}
foreach(PlexServerAuthTokentokeninmaybeToken)
{
MediaItemmediaItem=program.Typeswitch
@ -230,7 +259,6 @@ public class ExternalJsonPlayoutItemProvider : IExternalJsonPlayoutItemProvider
@@ -230,7 +259,6 @@ public class ExternalJsonPlayoutItemProvider : IExternalJsonPlayoutItemProvider