aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-02 16:21:06 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-02 16:21:06 -0500
commit1e88b1ef9f6335a2363bd32221a0e016fdd8b0c0 (patch)
tree40572c096c245024ce76b2f79f6e0ea192f94ae2
parente80cbe5b64fa85a814e8e3009c28b1853dc23988 (diff)
web client touchups
-rw-r--r--MediaBrowser.Model/LiveTv/ChannelInfoDto.cs6
-rw-r--r--MediaBrowser.Providers/Movies/MovieDbProvider.cs16
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs8
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs15
-rw-r--r--MediaBrowser.ServerApplication/ApplicationHost.cs18
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj48
6 files changed, 50 insertions, 61 deletions
diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
index 89c92e6fd..7ee86ffac 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.cs
index dc267b37c..fed1b444e 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 5857088d2..83da28b8f 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.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 c6e5a315d..b38ef5d55 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<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.cs
index fc1319136..151aedd27 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;
+ }
+
/// <summary>
/// Gets the mac address.
/// </summary>
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index e650e48a8..d544d4f30 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>