diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
index 89c92e6fdf..7ee86ffac6 100644
--- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
@@ -70,6 +70,12 @@ namespace MediaBrowser.Model.LiveTv
/// The user data.
public UserItemDataDto UserData { get; set; }
+ ///
+ /// Gets or sets the now playing program.
+ ///
+ /// The now playing program.
+ public ProgramInfoDto CurrentProgram { get; set; }
+
public ChannelInfoDto()
{
ImageTags = new Dictionary();
diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs
index 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.cs
index 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.
///
/// The info.
+ /// The current program.
/// The user.
/// ChannelInfoDto.
- 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.LiveTv
dto.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.cs
index 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.LiveTv
return 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
@@ -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 GetNewTimerDefaults(CancellationToken cancellationToken)
{
var service = ActiveService;
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs
index 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.ServerApplication
OperatingSystem = 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;
+ }
+
///
/// Gets the mac address.
///
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index e650e48a89..d544d4f305 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -244,42 +244,18 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -313,12 +289,6 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -1778,24 +1748,6 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest