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

@ -112,7 +112,19 @@ namespace MediaBrowser.Api.UserLibrary
protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
{
return LibraryManager.GetAllArtists(items)
.Select(name => LibraryManager.GetArtist(name));
.Select(name =>
{
try
{
return LibraryManager.GetArtist(name);
}
catch (Exception ex)
{
Logger.ErrorException("Error getting artist {0}", ex, name);
return null;
}
}).Where(i => i != null);
}
protected override IEnumerable<BaseItem> GetLibraryItems(MusicArtist item, IEnumerable<BaseItem> libraryItems)

View File

@ -26,6 +26,12 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The name.</value>
string Name { get; }
/// <summary>
/// Gets the home page URL.
/// </summary>
/// <value>The home page URL.</value>
string HomePageUrl { get; }
/// <summary>
/// Gets the status information asynchronous.
/// </summary>

View File

@ -15,5 +15,17 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
/// <value>The status message.</value>
public string StatusMessage { get; set; }
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
public string Version { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has update available.
/// </summary>
/// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
public bool HasUpdateAvailable { get; set; }
}
}

View File

@ -17,6 +17,12 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The channel identifier.</value>
public string ChannelId { get; set; }
/// <summary>
/// Gets or sets the channel primary image tag.
/// </summary>
/// <value>The channel primary image tag.</value>
public Guid? ChannelPrimaryImageTag { get; set; }
/// <summary>
/// Name of the program
/// </summary>

View File

@ -1017,6 +1017,14 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{ProgramInfoDto}}.</returns>
Task<QueryResult<ProgramInfoDto>> GetLiveTvProgramsAsync(ProgramQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the recommended live tv programs asynchronous.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{ProgramInfoDto}}.</returns>
Task<QueryResult<ProgramInfoDto>> GetRecommendedLiveTvProgramsAsync(RecommendedProgramQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the live tv timer asynchronous.

View File

@ -14,6 +14,12 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the home page URL.
/// </summary>
/// <value>The home page URL.</value>
public string HomePageUrl { get; set; }
/// <summary>
/// Gets or sets the status.
/// </summary>
@ -25,6 +31,18 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
/// <value>The status message.</value>
public string StatusMessage { get; set; }
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
public string Version { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has update available.
/// </summary>
/// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
public bool HasUpdateAvailable { get; set; }
}
public class GuideInfo

View File

@ -37,6 +37,12 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The channel identifier.</value>
public string ChannelId { get; set; }
/// <summary>
/// Gets or sets the channel primary image tag.
/// </summary>
/// <value>The channel primary image tag.</value>
public Guid? ChannelPrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the name of the channel.
/// </summary>

View File

@ -1,8 +1,8 @@
using System.ComponentModel;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace MediaBrowser.Model.LiveTv
{
@ -36,6 +36,12 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
public string ChannelId { get; set; }
/// <summary>
/// Gets or sets the channel primary image tag.
/// </summary>
/// <value>The channel primary image tag.</value>
public Guid? ChannelPrimaryImageTag { get; set; }
/// <summary>
/// ChannelName of the recording.
/// </summary>

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)
{

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.304</version>
<version>3.0.305</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.304" />
<dependency id="MediaBrowser.Common" version="3.0.305" />
<dependency id="NLog" version="2.1.0" />
<dependency id="SimpleInjector" version="2.4.0" />
<dependency id="sharpcompress" version="0.10.2" />

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.304</version>
<version>3.0.305</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.304</version>
<version>3.0.305</version>
<title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.304" />
<dependency id="MediaBrowser.Common" version="3.0.305" />
</dependencies>
</metadata>
<files>