|
@@ -1489,70 +1489,79 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- public void AddInfoToProgramDto(BaseItem item, BaseItemDto dto, List<ItemFields> fields, User user = null)
|
|
|
|
|
|
+ public async Task AddInfoToProgramDto(List<Tuple<BaseItem, BaseItemDto>> tuples, List<ItemFields> fields, User user = null)
|
|
{
|
|
{
|
|
- var program = (LiveTvProgram)item;
|
|
|
|
|
|
+ var recordingTuples = new List<Tuple<BaseItemDto, string, string>>();
|
|
|
|
|
|
- dto.StartDate = program.StartDate;
|
|
|
|
- dto.EpisodeTitle = program.EpisodeTitle;
|
|
|
|
-
|
|
|
|
- if (program.IsRepeat)
|
|
|
|
- {
|
|
|
|
- dto.IsRepeat = program.IsRepeat;
|
|
|
|
- }
|
|
|
|
- if (program.IsMovie)
|
|
|
|
- {
|
|
|
|
- dto.IsMovie = program.IsMovie;
|
|
|
|
- }
|
|
|
|
- if (program.IsSeries)
|
|
|
|
- {
|
|
|
|
- dto.IsSeries = program.IsSeries;
|
|
|
|
- }
|
|
|
|
- if (program.IsSports)
|
|
|
|
- {
|
|
|
|
- dto.IsSports = program.IsSports;
|
|
|
|
- }
|
|
|
|
- if (program.IsLive)
|
|
|
|
- {
|
|
|
|
- dto.IsLive = program.IsLive;
|
|
|
|
- }
|
|
|
|
- if (program.IsNews)
|
|
|
|
- {
|
|
|
|
- dto.IsNews = program.IsNews;
|
|
|
|
- }
|
|
|
|
- if (program.IsKids)
|
|
|
|
|
|
+ foreach (var tuple in tuples)
|
|
{
|
|
{
|
|
- dto.IsKids = program.IsKids;
|
|
|
|
- }
|
|
|
|
- if (program.IsPremiere)
|
|
|
|
- {
|
|
|
|
- dto.IsPremiere = program.IsPremiere;
|
|
|
|
- }
|
|
|
|
|
|
+ var program = (LiveTvProgram)tuple.Item1;
|
|
|
|
+ var dto = tuple.Item2;
|
|
|
|
|
|
- if (fields.Contains(ItemFields.ChannelInfo))
|
|
|
|
- {
|
|
|
|
- var channel = GetInternalChannel(program.ChannelId);
|
|
|
|
|
|
+ dto.StartDate = program.StartDate;
|
|
|
|
+ dto.EpisodeTitle = program.EpisodeTitle;
|
|
|
|
+
|
|
|
|
+ if (program.IsRepeat)
|
|
|
|
+ {
|
|
|
|
+ dto.IsRepeat = program.IsRepeat;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsMovie)
|
|
|
|
+ {
|
|
|
|
+ dto.IsMovie = program.IsMovie;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsSeries)
|
|
|
|
+ {
|
|
|
|
+ dto.IsSeries = program.IsSeries;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsSports)
|
|
|
|
+ {
|
|
|
|
+ dto.IsSports = program.IsSports;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsLive)
|
|
|
|
+ {
|
|
|
|
+ dto.IsLive = program.IsLive;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsNews)
|
|
|
|
+ {
|
|
|
|
+ dto.IsNews = program.IsNews;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsKids)
|
|
|
|
+ {
|
|
|
|
+ dto.IsKids = program.IsKids;
|
|
|
|
+ }
|
|
|
|
+ if (program.IsPremiere)
|
|
|
|
+ {
|
|
|
|
+ dto.IsPremiere = program.IsPremiere;
|
|
|
|
+ }
|
|
|
|
|
|
- if (channel != null)
|
|
|
|
|
|
+ if (fields.Contains(ItemFields.ChannelInfo))
|
|
{
|
|
{
|
|
- dto.ChannelName = channel.Name;
|
|
|
|
- dto.MediaType = channel.MediaType;
|
|
|
|
|
|
+ var channel = GetInternalChannel(program.ChannelId);
|
|
|
|
|
|
- if (channel.HasImage(ImageType.Primary))
|
|
|
|
|
|
+ if (channel != null)
|
|
{
|
|
{
|
|
- dto.ChannelPrimaryImageTag = _tvDtoService.GetImageTag(channel);
|
|
|
|
|
|
+ dto.ChannelName = channel.Name;
|
|
|
|
+ dto.MediaType = channel.MediaType;
|
|
|
|
+
|
|
|
|
+ if (channel.HasImage(ImageType.Primary))
|
|
|
|
+ {
|
|
|
|
+ dto.ChannelPrimaryImageTag = _tvDtoService.GetImageTag(channel);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- if (fields.Contains(ItemFields.ServiceName))
|
|
|
|
- {
|
|
|
|
var service = GetService(program);
|
|
var service = GetService(program);
|
|
- if (service != null)
|
|
|
|
|
|
+ var serviceName = service == null ? null : service.Name;
|
|
|
|
+
|
|
|
|
+ if (fields.Contains(ItemFields.ServiceName))
|
|
{
|
|
{
|
|
- dto.ServiceName = service.Name;
|
|
|
|
|
|
+ dto.ServiceName = serviceName;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ recordingTuples.Add(new Tuple<BaseItemDto, string, string>(dto, serviceName, program.ExternalId));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ await AddRecordingInfo(recordingTuples, CancellationToken.None).ConfigureAwait(false);
|
|
}
|
|
}
|
|
|
|
|
|
public void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null)
|
|
public void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null)
|