diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-17 15:51:29 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-17 15:51:29 -0500 |
| commit | fb335141fb9cb2b2ed626e2ffb555fccb26b3edf (patch) | |
| tree | 57d621fddd079d8821f1e1fe96d75665d65175d5 | |
| parent | 33d99575940ac97574d328ab9c6143bb3ccb9e8e (diff) | |
display tv service version info
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ArtistsService.cs | 14 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvService.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IApiClient.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Model/LiveTv/ProgramInfoDto.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/LiveTv/RecordingInfoDto.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs | 24 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs | 15 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.Internal.nuspec | 4 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.nuspec | 2 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Server.Core.nuspec | 4 |
13 files changed, 107 insertions, 22 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index 48fc72913..a96630efe 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -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) diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 955d81b03..988b62002 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -27,6 +27,12 @@ namespace MediaBrowser.Controller.LiveTv 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> /// <param name="cancellationToken">The cancellation token.</param> diff --git a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs index 3da00de49..cc5107590 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs @@ -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; } } } diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index d672340e4..0368c5f2f 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -18,6 +18,12 @@ namespace MediaBrowser.Controller.LiveTv 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> public string Name { get; set; } diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index cf90fb757..1e54e2dae 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -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. diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs index dd2dc81bd..b54369ef5 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs @@ -15,6 +15,12 @@ namespace MediaBrowser.Model.LiveTv 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> /// <value>The status.</value> @@ -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 diff --git a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs index aeaf2c15b..9a29f1800 100644 --- a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs @@ -38,6 +38,12 @@ namespace MediaBrowser.Model.LiveTv 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> /// <value>The name of the channel.</value> diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs index 5076e9d02..2a95247ce 100644 --- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs @@ -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 { @@ -37,6 +37,12 @@ namespace MediaBrowser.Model.LiveTv 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> public string ChannelName { get; set; } diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs index 1546f8045..2fea919b0 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -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) diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 2d91222c1..8577e7510 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -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) { diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 1bf4b8073..ee0488546 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -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" /> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 5b1d85616..c0893d26b 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -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> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index ae2c7770b..8feb93f2a 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -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> |
