| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 | 
							- using MediaBrowser.Common;
 
- using MediaBrowser.Common.Extensions;
 
- using MediaBrowser.Controller.Drawing;
 
- using MediaBrowser.Controller.Dto;
 
- using MediaBrowser.Controller.Entities;
 
- using MediaBrowser.Controller.Library;
 
- using MediaBrowser.Controller.LiveTv;
 
- using MediaBrowser.Model.Entities;
 
- using MediaBrowser.Model.LiveTv;
 
- using MediaBrowser.Model.Logging;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Threading;
 
- using System.Threading.Tasks;
 
- using MediaBrowser.Model.Querying;
 
- namespace MediaBrowser.Server.Implementations.LiveTv
 
- {
 
-     public class LiveTvDtoService
 
-     {
 
-         private readonly ILogger _logger;
 
-         private readonly IImageProcessor _imageProcessor;
 
-         private readonly IUserDataManager _userDataManager;
 
-         private readonly IDtoService _dtoService;
 
-         private readonly IApplicationHost _appHost;
 
-         public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost)
 
-         {
 
-             _dtoService = dtoService;
 
-             _userDataManager = userDataManager;
 
-             _imageProcessor = imageProcessor;
 
-             _logger = logger;
 
-             _appHost = appHost;
 
-         }
 
-         public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program, LiveTvChannel channel)
 
-         {
 
-             var dto = new TimerInfoDto
 
-             {
 
-                 Id = GetInternalTimerId(service.Name, info.Id).ToString("N"),
 
-                 Overview = info.Overview,
 
-                 EndDate = info.EndDate,
 
-                 Name = info.Name,
 
-                 StartDate = info.StartDate,
 
-                 ExternalId = info.Id,
 
-                 ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N"),
 
-                 Status = info.Status,
 
-                 SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId) ? null : GetInternalSeriesTimerId(service.Name, info.SeriesTimerId).ToString("N"),
 
-                 PrePaddingSeconds = info.PrePaddingSeconds,
 
-                 PostPaddingSeconds = info.PostPaddingSeconds,
 
-                 IsPostPaddingRequired = info.IsPostPaddingRequired,
 
-                 IsPrePaddingRequired = info.IsPrePaddingRequired,
 
-                 ExternalChannelId = info.ChannelId,
 
-                 ExternalSeriesTimerId = info.SeriesTimerId,
 
-                 ServiceName = service.Name,
 
-                 ExternalProgramId = info.ProgramId,
 
-                 Priority = info.Priority,
 
-                 RunTimeTicks = (info.EndDate - info.StartDate).Ticks,
 
-                 ServerId = _appHost.SystemId
 
-             };
 
-             if (!string.IsNullOrEmpty(info.ProgramId))
 
-             {
 
-                 dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
 
-             }
 
-             if (program != null)
 
-             {
 
-                 dto.ProgramInfo = GetProgramInfoDto(program, channel);
 
-                 dto.ProgramInfo.TimerId = dto.Id;
 
-                 dto.ProgramInfo.SeriesTimerId = dto.SeriesTimerId;
 
-             }
 
-             if (channel != null)
 
-             {
 
-                 dto.ChannelName = channel.Name;
 
-             }
 
-             return dto;
 
-         }
 
-         public SeriesTimerInfoDto GetSeriesTimerInfoDto(SeriesTimerInfo info, ILiveTvService service, string channelName)
 
-         {
 
-             var dto = new SeriesTimerInfoDto
 
-             {
 
-                 Id = GetInternalSeriesTimerId(service.Name, info.Id).ToString("N"),
 
-                 Overview = info.Overview,
 
-                 EndDate = info.EndDate,
 
-                 Name = info.Name,
 
-                 StartDate = info.StartDate,
 
-                 ExternalId = info.Id,
 
-                 PrePaddingSeconds = info.PrePaddingSeconds,
 
-                 PostPaddingSeconds = info.PostPaddingSeconds,
 
-                 IsPostPaddingRequired = info.IsPostPaddingRequired,
 
-                 IsPrePaddingRequired = info.IsPrePaddingRequired,
 
-                 Days = info.Days,
 
-                 Priority = info.Priority,
 
-                 RecordAnyChannel = info.RecordAnyChannel,
 
-                 RecordAnyTime = info.RecordAnyTime,
 
-                 RecordNewOnly = info.RecordNewOnly,
 
-                 ExternalChannelId = info.ChannelId,
 
-                 ExternalProgramId = info.ProgramId,
 
-                 ServiceName = service.Name,
 
-                 ChannelName = channelName,
 
-                 ServerId = _appHost.SystemId
 
-             };
 
-             if (!string.IsNullOrEmpty(info.ChannelId))
 
-             {
 
-                 dto.ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N");
 
-             }
 
-             if (!string.IsNullOrEmpty(info.ProgramId))
 
-             {
 
-                 dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
 
-             }
 
-             dto.DayPattern = info.Days == null ? null : GetDayPattern(info.Days);
 
-             return dto;
 
-         }
 
-         public DayPattern? GetDayPattern(List<DayOfWeek> days)
 
-         {
 
-             DayPattern? pattern = null;
 
-             if (days.Count > 0)
 
-             {
 
-                 if (days.Count == 7)
 
-                 {
 
-                     pattern = DayPattern.Daily;
 
-                 }
 
-                 else if (days.Count == 2)
 
-                 {
 
-                     if (days.Contains(DayOfWeek.Saturday) && days.Contains(DayOfWeek.Sunday))
 
-                     {
 
-                         pattern = DayPattern.Weekends;
 
-                     }
 
-                 }
 
-                 else if (days.Count == 5)
 
-                 {
 
-                     if (days.Contains(DayOfWeek.Monday) && days.Contains(DayOfWeek.Tuesday) && days.Contains(DayOfWeek.Wednesday) && days.Contains(DayOfWeek.Thursday) && days.Contains(DayOfWeek.Friday))
 
-                     {
 
-                         pattern = DayPattern.Weekdays;
 
-                     }
 
-                 }
 
-             }
 
-             return pattern;
 
-         }
 
-         /// <summary>
 
-         /// Convert the provider 0-5 scale to our 0-10 scale
 
-         /// </summary>
 
-         /// <param name="val"></param>
 
-         /// <returns></returns>
 
-         private float? GetClientCommunityRating(float? val)
 
-         {
 
-             if (!val.HasValue)
 
-             {
 
-                 return null;
 
-             }
 
-             return val.Value;
 
-         }
 
-         public string GetStatusName(RecordingStatus status)
 
-         {
 
-             if (status == RecordingStatus.InProgress)
 
-             {
 
-                 return "In Progress";
 
-             }
 
-             if (status == RecordingStatus.ConflictedNotOk)
 
-             {
 
-                 return "Conflicted";
 
-             }
 
-             if (status == RecordingStatus.ConflictedOk)
 
-             {
 
-                 return "Scheduled";
 
-             }
 
-             return status.ToString();
 
-         }
 
-         public RecordingInfoDto GetRecordingInfoDto(ILiveTvRecording recording, LiveTvChannel channel, ILiveTvService service, User user = null)
 
-         {
 
-             var info = recording.RecordingInfo;
 
-             var dto = new RecordingInfoDto
 
-             {
 
-                 Id = GetInternalRecordingId(service.Name, info.Id).ToString("N"),
 
-                 SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId) ? null : GetInternalSeriesTimerId(service.Name, info.SeriesTimerId).ToString("N"),
 
-                 Type = recording.GetClientTypeName(),
 
-                 Overview = info.Overview,
 
-                 EndDate = info.EndDate,
 
-                 Name = info.Name,
 
-                 StartDate = info.StartDate,
 
-                 ExternalId = info.Id,
 
-                 ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N"),
 
-                 Status = info.Status,
 
-                 StatusName = GetStatusName(info.Status),
 
-                 Path = info.Path,
 
-                 Genres = info.Genres,
 
-                 IsRepeat = info.IsRepeat,
 
-                 EpisodeTitle = info.EpisodeTitle,
 
-                 ChannelType = info.ChannelType,
 
-                 MediaType = info.ChannelType == ChannelType.Radio ? MediaType.Audio : MediaType.Video,
 
-                 CommunityRating = GetClientCommunityRating(info.CommunityRating),
 
-                 OfficialRating = info.OfficialRating,
 
-                 Audio = info.Audio,
 
-                 IsHD = info.IsHD,
 
-                 ServiceName = service.Name,
 
-                 IsMovie = info.IsMovie,
 
-                 IsSeries = info.IsSeries,
 
-                 IsSports = info.IsSports,
 
-                 IsLive = info.IsLive,
 
-                 IsNews = info.IsNews,
 
-                 IsKids = info.IsKids,
 
-                 IsPremiere = info.IsPremiere,
 
-                 RunTimeTicks = (info.EndDate - info.StartDate).Ticks,
 
-                 OriginalAirDate = info.OriginalAirDate,
 
-                 MediaSources = recording.GetMediaSources(true).ToList(),
 
-                 ServerId = _appHost.SystemId
 
-             };
 
-             dto.CanDelete = user == null
 
-                 ? recording.CanDelete()
 
-                 : recording.CanDelete(user);
 
-             
 
-             dto.MediaStreams = dto.MediaSources.SelectMany(i => i.MediaStreams).ToList();
 
-             if (info.Status == RecordingStatus.InProgress)
 
-             {
 
-                 var now = DateTime.UtcNow.Ticks;
 
-                 var start = info.StartDate.Ticks;
 
-                 var end = info.EndDate.Ticks;
 
-                 var pct = now - start;
 
-                 pct /= end;
 
-                 pct *= 100;
 
-                 dto.CompletionPercentage = pct;
 
-             }
 
-             var imageTag = GetImageTag(recording);
 
-             if (imageTag != null)
 
-             {
 
-                 dto.ImageTags[ImageType.Primary] = imageTag;
 
-                 _dtoService.AttachPrimaryImageAspectRatio(dto, recording, new List<ItemFields>
 
-                     {
 
-                         ItemFields.PrimaryImageAspectRatio
 
-                     });
 
-             }
 
-             if (user != null)
 
-             {
 
-                 dto.UserData = _userDataManager.GetUserDataDto(recording, user);
 
-                 dto.PlayAccess = recording.GetPlayAccess(user);
 
-             }
 
-             if (!string.IsNullOrEmpty(info.ProgramId))
 
-             {
 
-                 dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
 
-             }
 
-             if (channel != null)
 
-             {
 
-                 dto.ChannelName = channel.Name;
 
-                 if (!string.IsNullOrEmpty(channel.PrimaryImagePath))
 
-                 {
 
-                     dto.ChannelPrimaryImageTag = GetImageTag(channel);
 
-                 }
 
-             }
 
-             return dto;
 
-         }
 
-         public LiveTvTunerInfoDto GetTunerInfoDto(string serviceName, LiveTvTunerInfo info, string channelName)
 
-         {
 
-             var dto = new LiveTvTunerInfoDto
 
-             {
 
-                 Name = info.Name,
 
-                 Id = info.Id,
 
-                 Clients = info.Clients,
 
-                 ProgramName = info.ProgramName,
 
-                 SourceType = info.SourceType,
 
-                 Status = info.Status,
 
-                 ChannelName = channelName
 
-             };
 
-             if (!string.IsNullOrEmpty(info.ChannelId))
 
-             {
 
-                 dto.ChannelId = GetInternalChannelId(serviceName, info.ChannelId).ToString("N");
 
-             }
 
-             if (!string.IsNullOrEmpty(info.RecordingId))
 
-             {
 
-                 dto.RecordingId = GetInternalRecordingId(serviceName, info.RecordingId).ToString("N");
 
-             }
 
-             return dto;
 
-         }
 
-         /// <summary>
 
-         /// Gets the channel info dto.
 
-         /// </summary>
 
-         /// <param name="info">The info.</param>
 
-         /// <param name="currentProgram">The current program.</param>
 
-         /// <param name="user">The user.</param>
 
-         /// <returns>ChannelInfoDto.</returns>
 
-         public ChannelInfoDto GetChannelInfoDto(LiveTvChannel info, LiveTvProgram currentProgram, User user = null)
 
-         {
 
-             var dto = new ChannelInfoDto
 
-             {
 
-                 Name = info.Name,
 
-                 ServiceName = info.ServiceName,
 
-                 ChannelType = info.ChannelType,
 
-                 Number = info.Number,
 
-                 Type = info.GetClientTypeName(),
 
-                 Id = info.Id.ToString("N"),
 
-                 MediaType = info.MediaType,
 
-                 ExternalId = info.ExternalId,
 
-                 MediaSources = info.GetMediaSources(true).ToList(),
 
-                 ServerId = _appHost.SystemId
 
-             };
 
-             if (user != null)
 
-             {
 
-                 dto.UserData = _userDataManager.GetUserDataDto(info, user);
 
-                 dto.PlayAccess = info.GetPlayAccess(user);
 
-             }
 
-             var imageTag = GetImageTag(info);
 
-             if (imageTag != null)
 
-             {
 
-                 dto.ImageTags[ImageType.Primary] = imageTag;
 
-                 _dtoService.AttachPrimaryImageAspectRatio(dto, info, new List<ItemFields>
 
-                     {
 
-                         ItemFields.PrimaryImageAspectRatio
 
-                     });
 
-             }
 
-             if (currentProgram != null)
 
-             {
 
-                 dto.CurrentProgram = GetProgramInfoDto(currentProgram, info, user);
 
-             }
 
-             return dto;
 
-         }
 
-         public ProgramInfoDto GetProgramInfoDto(LiveTvProgram item, LiveTvChannel channel, User user = null)
 
-         {
 
-             var dto = new ProgramInfoDto
 
-             {
 
-                 Id = GetInternalProgramId(item.ServiceName, item.ExternalId).ToString("N"),
 
-                 ChannelId = GetInternalChannelId(item.ServiceName, item.ExternalChannelId).ToString("N"),
 
-                 Overview = item.Overview,
 
-                 Genres = item.Genres,
 
-                 ExternalId = item.ExternalId,
 
-                 Name = item.Name,
 
-                 ServiceName = item.ServiceName,
 
-                 StartDate = item.StartDate,
 
-                 OfficialRating = item.OfficialRating,
 
-                 IsHD = item.IsHD,
 
-                 OriginalAirDate = item.PremiereDate,
 
-                 Audio = item.Audio,
 
-                 CommunityRating = GetClientCommunityRating(item.CommunityRating),
 
-                 IsRepeat = item.IsRepeat,
 
-                 EpisodeTitle = item.EpisodeTitle,
 
-                 IsMovie = item.IsMovie,
 
-                 IsSeries = item.IsSeries,
 
-                 IsSports = item.IsSports,
 
-                 IsLive = item.IsLive,
 
-                 IsNews = item.IsNews,
 
-                 IsKids = item.IsKids,
 
-                 IsPremiere = item.IsPremiere,
 
-                 Type = "Program",
 
-                 MediaType = item.MediaType,
 
-                 ServerId = _appHost.SystemId,
 
-                 ProductionYear = item.ProductionYear
 
-             };
 
-             if (item.EndDate.HasValue)
 
-             {
 
-                 dto.EndDate = item.EndDate.Value;
 
-                 dto.RunTimeTicks = (item.EndDate.Value - item.StartDate).Ticks;
 
-             }
 
-             if (channel != null)
 
-             {
 
-                 dto.ChannelName = channel.Name;
 
-                 if (!string.IsNullOrEmpty(channel.PrimaryImagePath))
 
-                 {
 
-                     dto.ChannelPrimaryImageTag = GetImageTag(channel);
 
-                 }
 
-             }
 
-             var imageTag = GetImageTag(item);
 
-             if (imageTag != null)
 
-             {
 
-                 dto.ImageTags[ImageType.Primary] = imageTag;
 
-                 _dtoService.AttachPrimaryImageAspectRatio(dto, item, new List<ItemFields>
 
-                     {
 
-                         ItemFields.PrimaryImageAspectRatio
 
-                     });
 
-             }
 
-             if (user != null)
 
-             {
 
-                 dto.UserData = _userDataManager.GetUserDataDto(item, user);
 
-                 dto.PlayAccess = item.GetPlayAccess(user);
 
-             }
 
-             return dto;
 
-         }
 
-         private string GetImageTag(IHasImages info)
 
-         {
 
-             try
 
-             {
 
-                 return _imageProcessor.GetImageCacheTag(info, ImageType.Primary);
 
-             }
 
-             catch (Exception ex)
 
-             {
 
-                 _logger.ErrorException("Error getting image info for {0}", ex, info.Name);
 
-             }
 
-             return null;
 
-         }
 
-         private const string InternalVersionNumber = "4";
 
-         public Guid GetInternalChannelId(string serviceName, string externalId)
 
-         {
 
-             var name = serviceName + externalId + InternalVersionNumber;
 
-             return name.ToLower().GetMBId(typeof(LiveTvChannel));
 
-         }
 
-         public Guid GetInternalTimerId(string serviceName, string externalId)
 
-         {
 
-             var name = serviceName + externalId + InternalVersionNumber;
 
-             return name.ToLower().GetMD5();
 
-         }
 
-         public Guid GetInternalSeriesTimerId(string serviceName, string externalId)
 
-         {
 
-             var name = serviceName + externalId + InternalVersionNumber;
 
-             return name.ToLower().GetMD5();
 
-         }
 
-         public Guid GetInternalProgramId(string serviceName, string externalId)
 
-         {
 
-             var name = serviceName + externalId + InternalVersionNumber;
 
-             return name.ToLower().GetMBId(typeof(LiveTvProgram));
 
-         }
 
-         public Guid GetInternalRecordingId(string serviceName, string externalId)
 
-         {
 
-             var name = serviceName + externalId + InternalVersionNumber;
 
-             return name.ToLower().GetMBId(typeof(ILiveTvRecording));
 
-         }
 
-         public async Task<TimerInfo> GetTimerInfo(TimerInfoDto dto, bool isNew, ILiveTvManager liveTv, CancellationToken cancellationToken)
 
-         {
 
-             var info = new TimerInfo
 
-             {
 
-                 Overview = dto.Overview,
 
-                 EndDate = dto.EndDate,
 
-                 Name = dto.Name,
 
-                 StartDate = dto.StartDate,
 
-                 Status = dto.Status,
 
-                 PrePaddingSeconds = dto.PrePaddingSeconds,
 
-                 PostPaddingSeconds = dto.PostPaddingSeconds,
 
-                 IsPostPaddingRequired = dto.IsPostPaddingRequired,
 
-                 IsPrePaddingRequired = dto.IsPrePaddingRequired,
 
-                 Priority = dto.Priority,
 
-                 SeriesTimerId = dto.ExternalSeriesTimerId,
 
-                 ProgramId = dto.ExternalProgramId,
 
-                 ChannelId = dto.ExternalChannelId,
 
-                 Id = dto.ExternalId
 
-             };
 
-             // Convert internal server id's to external tv provider id's
 
-             if (!isNew && !string.IsNullOrEmpty(dto.Id) && string.IsNullOrEmpty(info.Id))
 
-             {
 
-                 var timer = await liveTv.GetSeriesTimer(dto.Id, cancellationToken).ConfigureAwait(false);
 
-                 info.Id = timer.ExternalId;
 
-             }
 
-             if (!string.IsNullOrEmpty(dto.ChannelId) && string.IsNullOrEmpty(info.ChannelId))
 
-             {
 
-                 var channel = await liveTv.GetChannel(dto.ChannelId, cancellationToken).ConfigureAwait(false);
 
-                 if (channel != null)
 
-                 {
 
-                     info.ChannelId = channel.ExternalId;
 
-                 }
 
-             }
 
-             if (!string.IsNullOrEmpty(dto.ProgramId) && string.IsNullOrEmpty(info.ProgramId))
 
-             {
 
-                 var program = await liveTv.GetProgram(dto.ProgramId, cancellationToken).ConfigureAwait(false);
 
-                 if (program != null)
 
-                 {
 
-                     info.ProgramId = program.ExternalId;
 
-                 }
 
-             }
 
-             if (!string.IsNullOrEmpty(dto.SeriesTimerId) && string.IsNullOrEmpty(info.SeriesTimerId))
 
-             {
 
-                 var timer = await liveTv.GetSeriesTimer(dto.SeriesTimerId, cancellationToken).ConfigureAwait(false);
 
-                 if (timer != null)
 
-                 {
 
-                     info.SeriesTimerId = timer.ExternalId;
 
-                 }
 
-             }
 
-             return info;
 
-         }
 
-         public async Task<SeriesTimerInfo> GetSeriesTimerInfo(SeriesTimerInfoDto dto, bool isNew, ILiveTvManager liveTv, CancellationToken cancellationToken)
 
-         {
 
-             var info = new SeriesTimerInfo
 
-             {
 
-                 Overview = dto.Overview,
 
-                 EndDate = dto.EndDate,
 
-                 Name = dto.Name,
 
-                 StartDate = dto.StartDate,
 
-                 PrePaddingSeconds = dto.PrePaddingSeconds,
 
-                 PostPaddingSeconds = dto.PostPaddingSeconds,
 
-                 IsPostPaddingRequired = dto.IsPostPaddingRequired,
 
-                 IsPrePaddingRequired = dto.IsPrePaddingRequired,
 
-                 Days = dto.Days,
 
-                 Priority = dto.Priority,
 
-                 RecordAnyChannel = dto.RecordAnyChannel,
 
-                 RecordAnyTime = dto.RecordAnyTime,
 
-                 RecordNewOnly = dto.RecordNewOnly,
 
-                 ProgramId = dto.ExternalProgramId,
 
-                 ChannelId = dto.ExternalChannelId,
 
-                 Id = dto.ExternalId
 
-             };
 
-             // Convert internal server id's to external tv provider id's
 
-             if (!isNew && !string.IsNullOrEmpty(dto.Id) && string.IsNullOrEmpty(info.Id))
 
-             {
 
-                 var timer = await liveTv.GetSeriesTimer(dto.Id, cancellationToken).ConfigureAwait(false);
 
-                 info.Id = timer.ExternalId;
 
-             }
 
-             if (!string.IsNullOrEmpty(dto.ChannelId) && string.IsNullOrEmpty(info.ChannelId))
 
-             {
 
-                 var channel = await liveTv.GetChannel(dto.ChannelId, cancellationToken).ConfigureAwait(false);
 
-                 if (channel != null)
 
-                 {
 
-                     info.ChannelId = channel.ExternalId;
 
-                 }
 
-             }
 
-             if (!string.IsNullOrEmpty(dto.ProgramId) && string.IsNullOrEmpty(info.ProgramId))
 
-             {
 
-                 var program = await liveTv.GetProgram(dto.ProgramId, cancellationToken).ConfigureAwait(false);
 
-                 if (program != null)
 
-                 {
 
-                     info.ProgramId = program.ExternalId;
 
-                 }
 
-             }
 
-             return info;
 
-         }
 
-     }
 
- }
 
 
  |