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) protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
{ {
return LibraryManager.GetAllArtists(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) protected override IEnumerable<BaseItem> GetLibraryItems(MusicArtist item, IEnumerable<BaseItem> libraryItems)

View File

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

View File

@ -15,5 +15,17 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value>The status message.</value> /// <value>The status message.</value>
public string StatusMessage { get; set; } 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> /// <value>The channel identifier.</value>
public string ChannelId { get; set; } 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> /// <summary>
/// Name of the program /// Name of the program
/// </summary> /// </summary>

View File

@ -1018,6 +1018,14 @@ namespace MediaBrowser.Model.ApiClient
/// <returns>Task{QueryResult{ProgramInfoDto}}.</returns> /// <returns>Task{QueryResult{ProgramInfoDto}}.</returns>
Task<QueryResult<ProgramInfoDto>> GetLiveTvProgramsAsync(ProgramQuery query, CancellationToken cancellationToken); 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> /// <summary>
/// Gets the live tv timer asynchronous. /// Gets the live tv timer asynchronous.
/// </summary> /// </summary>

View File

@ -14,6 +14,12 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The name.</value> /// <value>The name.</value>
public string Name { get; set; } 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> /// <summary>
/// Gets or sets the status. /// Gets or sets the status.
/// </summary> /// </summary>
@ -25,6 +31,18 @@ namespace MediaBrowser.Model.LiveTv
/// </summary> /// </summary>
/// <value>The status message.</value> /// <value>The status message.</value>
public string StatusMessage { get; set; } 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 public class GuideInfo

View File

@ -37,6 +37,12 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The channel identifier.</value> /// <value>The channel identifier.</value>
public string ChannelId { get; set; } 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> /// <summary>
/// Gets or sets the name of the channel. /// Gets or sets the name of the channel.
/// </summary> /// </summary>

View File

@ -1,8 +1,8 @@
using System.ComponentModel; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
namespace MediaBrowser.Model.LiveTv namespace MediaBrowser.Model.LiveTv
{ {
@ -36,6 +36,12 @@ namespace MediaBrowser.Model.LiveTv
/// </summary> /// </summary>
public string ChannelId { get; set; } 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> /// <summary>
/// ChannelName of the recording. /// ChannelName of the recording.
/// </summary> /// </summary>

View File

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

View File

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

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.304</version> <version>3.0.305</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <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> <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> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <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="NLog" version="2.1.0" />
<dependency id="SimpleInjector" version="2.4.0" /> <dependency id="SimpleInjector" version="2.4.0" />
<dependency id="sharpcompress" version="0.10.2" /> <dependency id="sharpcompress" version="0.10.2" />

View File

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

View File

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