From 74adff0d8d63c4c764be0ccd7b1935480a2a2e0a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 2 Apr 2015 12:26:42 -0400 Subject: [PATCH] combine movie fixes --- .../Playback/Dash/MpegDashService.cs | 14 +------------- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 16 +++++++++++++++- .../Playback/Hls/DynamicHlsService.cs | 3 +-- .../Localization/Server/server.json | 1 + MediaBrowser.WebDashboard/Api/PackageCreator.cs | 1 - .../MediaBrowser.WebDashboard.csproj | 6 ------ 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs index ba3f172579..0692c4863e 100644 --- a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs +++ b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs @@ -5,7 +5,6 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Net; using MediaBrowser.Model.IO; @@ -518,25 +517,14 @@ namespace MediaBrowser.Api.Playback.Dash private async Task WaitForSegment(string playlist, string segment, CancellationToken cancellationToken) { - var tmpPath = playlist + ".tmp"; - var segmentFilename = Path.GetFileName(segment); Logger.Debug("Waiting for {0} in {1}", segmentFilename, playlist); while (true) { - FileStream fileStream; - try - { - fileStream = FileSystem.GetFileStream(tmpPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true); - } - catch (IOException) - { - fileStream = FileSystem.GetFileStream(playlist, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true); - } // Need to use FileShare.ReadWrite because we're reading the file at the same time it's being written - using (fileStream) + using (var fileStream = GetPlaylistFileStream(playlist)) { using (var reader = new StreamReader(fileStream)) { diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 207bc2f679..657a97ac15 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -186,7 +186,7 @@ namespace MediaBrowser.Api.Playback.Hls while (true) { // Need to use FileShare.ReadWrite because we're reading the file at the same time it's being written - using (var fileStream = FileSystem.GetFileStream(playlist, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true)) + using (var fileStream = GetPlaylistFileStream(playlist)) { using (var reader = new StreamReader(fileStream)) { @@ -212,6 +212,20 @@ namespace MediaBrowser.Api.Playback.Hls } } + protected Stream GetPlaylistFileStream(string path) + { + var tmpPath = path + ".tmp"; + + try + { + return FileSystem.GetFileStream(tmpPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true); + } + catch (IOException) + { + return FileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true); + } + } + protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding) { var hlsVideoRequest = state.VideoRequest as GetHlsVideoStream; diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 4f043d3217..dc5f9d4e0a 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -4,7 +4,6 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Net; using MediaBrowser.Model.Dlna; @@ -300,7 +299,7 @@ namespace MediaBrowser.Api.Playback.Hls var segmentFilename = Path.GetFileName(segmentPath); - using (var fileStream = FileSystem.GetFileStream(playlistPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true)) + using (var fileStream = GetPlaylistFileStream(playlistPath)) { using (var reader = new StreamReader(fileStream)) { diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 0cff99c5d1..d27403dda5 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -168,6 +168,7 @@ "MessageNothingHere": "Nothing here.", "MessagePleaseEnsureInternetMetadata": "Please ensure downloading of internet metadata is enabled.", "TabSuggested": "Suggested", + "TabSuggestions": "Suggestions", "TabLatest": "Latest", "TabUpcoming": "Upcoming", "TabShows": "Shows", diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 8982b5739c..5138b157f1 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -451,7 +451,6 @@ namespace MediaBrowser.WebDashboard.Api "moviegenres.js", "moviecollections.js", "movies.js", - "movieslatest.js", "moviepeople.js", "moviesrecommended.js", "moviestudios.js", diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 2725d63ad8..88a2a8ae1b 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -556,9 +556,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest @@ -889,9 +886,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest