The Free Software Media System - Server Backend & API
web client touchups
Luke Pulverenti1e88b1ef9f63
diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.csindex 89c92e6fdf..7ee86ffac6 100644--- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs+++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs@@ -70,6 +70,12 @@ namespace MediaBrowser.Model.LiveTv/// <value>The user data.</value>public UserItemDataDto UserData { get; set; }+ /// <summary>+ /// Gets or sets the now playing program.+ /// </summary>+ /// <value>The now playing program.</value>+ public ProgramInfoDto CurrentProgram { get; set; }+public ChannelInfoDto(){ImageTags = new Dictionary<ImageType, Guid>();diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.csindex dc267b37cc..fed1b444e8 100644--- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs+++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs@@ -822,14 +822,14 @@ namespace MediaBrowser.Providers.Movies}}- if (movieData.keywords != null && movieData.keywords.keywords != null && !movie.LockedFields.Contains(MetadataFields.Tags))- {- var hasTags = movie as IHasTags;- if (hasTags != null)- {- hasTags.Tags = movieData.keywords.keywords.Select(i => i.name).ToList();- }- }+ //if (movieData.keywords != null && movieData.keywords.keywords != null && !movie.LockedFields.Contains(MetadataFields.Tags))+ //{+ // var hasTags = movie as IHasTags;+ // if (hasTags != null)+ // {+ // hasTags.Tags = movieData.keywords.keywords.Select(i => i.name).ToList();+ // }+ //}if (movieData.trailers != null && movieData.trailers.youtube != null &&movieData.trailers.youtube.Count > 0)diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.csindex 5857088d2a..83da28b8f2 100644--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs@@ -259,9 +259,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv/// Gets the channel info dto./// </summary>/// <param name="info">The info.</param>+ /// <param name="currentProgram">The current program.</param>/// <param name="user">The user.</param>/// <returns>ChannelInfoDto.</returns>- public ChannelInfoDto GetChannelInfoDto(LiveTvChannel info, User user = null)+ public ChannelInfoDto GetChannelInfoDto(LiveTvChannel info, LiveTvProgram currentProgram, User user = null){var channelInfo = info.ChannelInfo;@@ -289,6 +290,11 @@ namespace MediaBrowser.Server.Implementations.LiveTvdto.ImageTags[ImageType.Primary] = imageTag.Value;}+ if (currentProgram != null)+ {+ dto.CurrentProgram = GetProgramInfoDto(currentProgram, channelInfo.Name, user);+ }+return dto;}diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.csindex c6e5a315d9..b38ef5d553 100644--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs@@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.LiveTvreturn number;}).ThenBy(i => i.Name)- .Select(i => _tvDtoService.GetChannelInfoDto(i, user))+ .Select(i => _tvDtoService.GetChannelInfoDto(i, GetCurrentProgram(i.ChannelInfo.Id), user)).ToArray();var result = new QueryResult<ChannelInfoDto>@@ -705,11 +705,22 @@ namespace MediaBrowser.Server.Implementations.LiveTv{var channel = GetInternalChannel(id);- var dto = _tvDtoService.GetChannelInfoDto(channel, user);+ var dto = _tvDtoService.GetChannelInfoDto(channel, GetCurrentProgram(channel.ChannelInfo.Id), user);return Task.FromResult(dto);}+ private LiveTvProgram GetCurrentProgram(string externalChannelId)+ {+ var now = DateTime.UtcNow;++ return _programs.Values+ .Where(i => string.Equals(externalChannelId, i.ProgramInfo.ChannelId, StringComparison.OrdinalIgnoreCase))+ .OrderBy(i => i.ProgramInfo.StartDate)+ .SkipWhile(i => now >= i.ProgramInfo.EndDate)+ .FirstOrDefault();+ }+public async Task<SeriesTimerInfoDto> GetNewTimerDefaults(CancellationToken cancellationToken){var service = ActiveService;diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.csindex fc13191368..151aedd27f 100644--- a/MediaBrowser.ServerApplication/ApplicationHost.cs+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs@@ -1,4 +1,5 @@-using MediaBrowser.Api;+using System.Globalization;+using MediaBrowser.Api;using MediaBrowser.Common;using MediaBrowser.Common.Configuration;using MediaBrowser.Common.Constants;@@ -627,10 +628,23 @@ namespace MediaBrowser.ServerApplicationOperatingSystem = Environment.OSVersion.ToString(),CanSelfRestart = CanSelfRestart,CanSelfUpdate = CanSelfUpdate,- WanAddress = WanAddressEntryPoint.WanAddress+ WanAddress = GetWanAddress()};}+ private readonly CultureInfo _usCulture = new CultureInfo("en-US");+ private string GetWanAddress()+ {+ var ip = WanAddressEntryPoint.WanAddress;++ if (!string.IsNullOrEmpty(ip))+ {+ return "http://" + ip + ":" + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(_usCulture);+ }++ return null;+ }+/// <summary>/// Gets the mac address./// </summary>diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex e650e48a89..d544d4f305 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -244,42 +244,18 @@<Content Include="dashboard-ui\css\images\media\audioflyout.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\audiotrack.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\media\chapterflyout.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\chapters.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\mute.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\quality.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\media\qualityflyout.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\remove.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\media\selected.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\settings.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\media\subtitleflyout.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\subtitles.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\volume.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\rotten.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>@@ -313,12 +289,6 @@<Content Include="dashboard-ui\css\images\items\list\video.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\playlist.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\fullscreen.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\supporter\nonsupporterbadge.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>@@ -1778,24 +1748,6 @@<Content Include="dashboard-ui\scripts\wizardfinishpage.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\css\images\media\playcircle.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\nexttrack.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\pause.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\play.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\previoustrack.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content>- <Content Include="dashboard-ui\css\images\media\stop.png">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </Content><Content Include="dashboard-ui\css\images\items\detail\video.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>