display tv service version info

This commit is contained in:
Luke Pulverenti
2014-01-17 15:51:29 -05:00
parent 33d9957594
commit fb335141fb
13 changed files with 107 additions and 22 deletions

View File

@@ -66,7 +66,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (program != null)
{
dto.ProgramInfo = GetProgramInfoDto(program, channel.ChannelInfo.Name);
dto.ProgramInfo = GetProgramInfoDto(program, channel);
dto.ProgramInfo.TimerId = dto.Id;
dto.ProgramInfo.SeriesTimerId = dto.SeriesTimerId;
@@ -260,7 +260,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (channel != null)
{
dto.ChannelName = channel.ChannelInfo.Name;
dto.ChannelName = channel.Name;
if (!string.IsNullOrEmpty(channel.PrimaryImagePath))
{
dto.ChannelPrimaryImageTag = GetImageTag(channel);
}
}
return dto;
@@ -303,13 +308,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (currentProgram != null)
{
dto.CurrentProgram = GetProgramInfoDto(currentProgram, channelInfo.Name, user);
dto.CurrentProgram = GetProgramInfoDto(currentProgram, info, user);
}
return dto;
}
public ProgramInfoDto GetProgramInfoDto(LiveTvProgram item, string channelName, User user = null)
public ProgramInfoDto GetProgramInfoDto(LiveTvProgram item, LiveTvChannel channel, User user = null)
{
var program = item.ProgramInfo;
@@ -331,7 +336,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
CommunityRating = GetClientCommunityRating(program.CommunityRating),
IsRepeat = program.IsRepeat,
EpisodeTitle = program.EpisodeTitle,
ChannelName = channelName,
IsMovie = program.IsMovie,
IsSeries = program.IsSeries,
IsSports = program.IsSports,
@@ -343,6 +347,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Type = "Program"
};
if (channel != null)
{
dto.ChannelName = channel.Name;
if (!string.IsNullOrEmpty(channel.PrimaryImagePath))
{
dto.ChannelPrimaryImageTag = GetImageTag(channel);
}
}
var imageTag = GetImageTag(item);
if (imageTag.HasValue)

View File

@@ -409,9 +409,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var channel = GetChannel(program);
var channelName = channel == null ? null : channel.ChannelInfo.Name;
var dto = _tvDtoService.GetProgramInfoDto(program, channelName, user);
var dto = _tvDtoService.GetProgramInfoDto(program, channel, user);
await AddRecordingInfo(new[] { dto }, cancellationToken).ConfigureAwait(false);
@@ -479,9 +477,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
var channel = GetChannel(i);
var channelName = channel == null ? null : channel.ChannelInfo.Name;
return _tvDtoService.GetProgramInfoDto(i, channelName, user);
return _tvDtoService.GetProgramInfoDto(i, channel, user);
})
.ToArray();
@@ -541,9 +537,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
var channel = GetChannel(i);
var channelName = channel == null ? null : channel.ChannelInfo.Name;
return _tvDtoService.GetProgramInfoDto(i, channelName, user);
return _tvDtoService.GetProgramInfoDto(i, channel, user);
})
.ToArray();
@@ -1342,6 +1336,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
info.Status = statusInfo.Status;
info.StatusMessage = statusInfo.StatusMessage;
info.Version = statusInfo.Version;
info.HasUpdateAvailable = statusInfo.HasUpdateAvailable;
info.HomePageUrl = service.HomePageUrl;
}
catch (Exception ex)
{