diff options
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 37 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/MimeTypes.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/ServerConfiguration.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.ServerApplication/MainWindow.xaml.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/DashboardService.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 10 |
7 files changed, 56 insertions, 23 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index 7dc8301fe..d9442b63d 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Dto; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Movies; @@ -32,6 +33,21 @@ namespace MediaBrowser.Api public string Id { get; set; } } + [Route("/Videos/{Id}/Subtitle/{Index}", "GET")] + [Api(Description = "Gets an external subtitle file")] + public class GetSubtitle + { + /// <summary> + /// Gets or sets the id. + /// </summary> + /// <value>The id.</value> + [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string Id { get; set; } + + [ApiMember(Name = "Index", Description = "The subtitle stream index", IsRequired = true, DataType = "int", ParameterType = "path", Verb = "GET")] + public int Index { get; set; } + } + /// <summary> /// Class GetCriticReviews /// </summary> @@ -240,6 +256,25 @@ namespace MediaBrowser.Api return ToStaticFileResult(item.Path); } + public object Get(GetSubtitle request) + { + var subtitleStream = _itemRepo.GetMediaStreams(new MediaStreamQuery + { + + Index = request.Index, + ItemId = new Guid(request.Id), + Type = MediaStreamType.Subtitle + + }).FirstOrDefault(); + + if (subtitleStream == null) + { + throw new ResourceNotFoundException(); + } + + return ToStaticFileResult(subtitleStream.Path); + } + /// <summary> /// Gets the specified request. /// </summary> diff --git a/MediaBrowser.Common/Net/MimeTypes.cs b/MediaBrowser.Common/Net/MimeTypes.cs index c11ff59d5..47536a341 100644 --- a/MediaBrowser.Common/Net/MimeTypes.cs +++ b/MediaBrowser.Common/Net/MimeTypes.cs @@ -218,6 +218,11 @@ namespace MediaBrowser.Common.Net return "image/svg+xml"; } + if (ext.Equals(".srt", StringComparison.OrdinalIgnoreCase)) + { + return "text/plain"; + } + throw new ArgumentException("Argument not supported: " + path); } } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 58f8b4e05..9527fcbf3 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -175,12 +175,6 @@ namespace MediaBrowser.Model.Configuration public int FileWatcherDelay { get; set; } /// <summary> - /// Gets or sets a value indicating whether [enable developer tools]. - /// </summary> - /// <value><c>true</c> if [enable developer tools]; otherwise, <c>false</c>.</value> - public bool EnableDeveloperTools { get; set; } - - /// <summary> /// Gets or sets a value indicating whether [enable dashboard response caching]. /// Allows potential contributors without visual studio to modify production dashboard code and test changes. /// </summary> @@ -255,10 +249,6 @@ namespace MediaBrowser.Model.Configuration EnableEpisodeChapterImageExtraction = false; EnableOtherVideoChapterImageExtraction = false; -#if (DEBUG) - EnableDeveloperTools = true; -#endif - MinResumePct = 5; MaxResumePct = 90; MinResumeDurationSeconds = Convert.ToInt32(TimeSpan.FromMinutes(5).TotalSeconds); diff --git a/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs b/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs index ffe33d763..b9e8b7950 100644 --- a/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs +++ b/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs @@ -139,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.Roku return _httpClient.Post(new HttpRequestOptions { - Url = "mb/remotecontrol", + Url = "http://" + Session.RemoteEndPoint + "/mb/remotecontrol", CancellationToken = cancellationToken, RequestContent = json, RequestContentType = "application/json" diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml.cs b/MediaBrowser.ServerApplication/MainWindow.xaml.cs index 61c0e82b9..040d714cf 100644 --- a/MediaBrowser.ServerApplication/MainWindow.xaml.cs +++ b/MediaBrowser.ServerApplication/MainWindow.xaml.cs @@ -133,14 +133,10 @@ namespace MediaBrowser.ServerApplication { Dispatcher.InvokeAsync(() => { - var developerToolsVisibility = _configurationManager.Configuration.EnableDeveloperTools - ? Visibility.Visible - : Visibility.Collapsed; - - separatorDeveloperTools.Visibility = developerToolsVisibility; - cmdReloadServer.Visibility = developerToolsVisibility; - cmOpenExplorer.Visibility = developerToolsVisibility; - cmShowLogWindow.Visibility = developerToolsVisibility; + separatorDeveloperTools.Visibility = Visibility.Visible; + cmdReloadServer.Visibility = Visibility.Visible; + cmOpenExplorer.Visibility = Visibility.Visible; + cmShowLogWindow.Visibility = Visibility.Visible; }); } diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 20284cb3d..e68abd23e 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -474,7 +474,8 @@ namespace MediaBrowser.WebDashboard.Api "advancedconfigurationpage.js", "advancedmetadataconfigurationpage.js", "boxsets.js", - "clientsettings.js", + "appsplayback.js", + "appsweather.js", "dashboardpage.js", "directorybrowser.js", "edititemmetadata.js", diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 5beaa133c..d441abfeb 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -85,6 +85,9 @@ </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ApiClient.js" />
+ <Content Include="dashboard-ui\appsplayback.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\css\icons.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -406,6 +409,9 @@ <Content Include="dashboard-ui\livetvrecordings.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\scripts\appsplayback.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\scripts\livetvchannel.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1415,7 +1421,7 @@ </Content>
</ItemGroup>
<ItemGroup>
- <Content Include="dashboard-ui\clientsettings.html">
+ <Content Include="dashboard-ui\appsweather.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
@@ -1486,7 +1492,7 @@ </Content>
</ItemGroup>
<ItemGroup>
- <Content Include="dashboard-ui\scripts\clientsettings.js">
+ <Content Include="dashboard-ui\scripts\appsweather.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
|
