Browse Source

combine movie fixes

Luke Pulverenti 10 years ago
parent
commit
74adff0d8d

+ 1 - 13
MediaBrowser.Api/Playback/Dash/MpegDashService.cs

@@ -5,7 +5,6 @@ using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Devices;
 using MediaBrowser.Controller.Devices;
 using MediaBrowser.Controller.Dlna;
 using MediaBrowser.Controller.Dlna;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Controller.MediaEncoding;
 using MediaBrowser.Controller.MediaEncoding;
 using MediaBrowser.Controller.Net;
 using MediaBrowser.Controller.Net;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.IO;
@@ -518,25 +517,14 @@ namespace MediaBrowser.Api.Playback.Dash
 
 
         private async Task WaitForSegment(string playlist, string segment, CancellationToken cancellationToken)
         private async Task WaitForSegment(string playlist, string segment, CancellationToken cancellationToken)
         {
         {
-            var tmpPath = playlist + ".tmp";
-
             var segmentFilename = Path.GetFileName(segment);
             var segmentFilename = Path.GetFileName(segment);
 
 
             Logger.Debug("Waiting for {0} in {1}", segmentFilename, playlist);
             Logger.Debug("Waiting for {0} in {1}", segmentFilename, playlist);
 
 
             while (true)
             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
                 // 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))
                     using (var reader = new StreamReader(fileStream))
                     {
                     {

+ 15 - 1
MediaBrowser.Api/Playback/Hls/BaseHlsService.cs

@@ -186,7 +186,7 @@ namespace MediaBrowser.Api.Playback.Hls
             while (true)
             while (true)
             {
             {
                 // Need to use FileShare.ReadWrite because we're reading the file at the same time it's being written
                 // 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))
                     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)
         protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding)
         {
         {
             var hlsVideoRequest = state.VideoRequest as GetHlsVideoStream;
             var hlsVideoRequest = state.VideoRequest as GetHlsVideoStream;

+ 1 - 2
MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs

@@ -4,7 +4,6 @@ using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Devices;
 using MediaBrowser.Controller.Devices;
 using MediaBrowser.Controller.Dlna;
 using MediaBrowser.Controller.Dlna;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Controller.MediaEncoding;
 using MediaBrowser.Controller.MediaEncoding;
 using MediaBrowser.Controller.Net;
 using MediaBrowser.Controller.Net;
 using MediaBrowser.Model.Dlna;
 using MediaBrowser.Model.Dlna;
@@ -300,7 +299,7 @@ namespace MediaBrowser.Api.Playback.Hls
 
 
             var segmentFilename = Path.GetFileName(segmentPath);
             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))
                 using (var reader = new StreamReader(fileStream))
                 {
                 {

+ 1 - 0
MediaBrowser.Server.Implementations/Localization/Server/server.json

@@ -168,6 +168,7 @@
     "MessageNothingHere": "Nothing here.",
     "MessageNothingHere": "Nothing here.",
     "MessagePleaseEnsureInternetMetadata": "Please ensure downloading of internet metadata is enabled.",
     "MessagePleaseEnsureInternetMetadata": "Please ensure downloading of internet metadata is enabled.",
     "TabSuggested": "Suggested",
     "TabSuggested": "Suggested",
+    "TabSuggestions": "Suggestions",
     "TabLatest": "Latest",
     "TabLatest": "Latest",
     "TabUpcoming": "Upcoming",
     "TabUpcoming": "Upcoming",
     "TabShows": "Shows",
     "TabShows": "Shows",

+ 0 - 1
MediaBrowser.WebDashboard/Api/PackageCreator.cs

@@ -451,7 +451,6 @@ namespace MediaBrowser.WebDashboard.Api
                                 "moviegenres.js",
                                 "moviegenres.js",
                                 "moviecollections.js",
                                 "moviecollections.js",
                                 "movies.js",
                                 "movies.js",
-                                "movieslatest.js",
                                 "moviepeople.js",
                                 "moviepeople.js",
                                 "moviesrecommended.js",
                                 "moviesrecommended.js",
                                 "moviestudios.js",
                                 "moviestudios.js",

+ 0 - 6
MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj

@@ -556,9 +556,6 @@
     <Content Include="dashboard-ui\metadatasubtitles.html">
     <Content Include="dashboard-ui\metadatasubtitles.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
-    <Content Include="dashboard-ui\movieslatest.html">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
     <Content Include="dashboard-ui\musicalbumartists.html">
     <Content Include="dashboard-ui\musicalbumartists.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
@@ -889,9 +886,6 @@
     <Content Include="dashboard-ui\scripts\metadatasubtitles.js">
     <Content Include="dashboard-ui\scripts\metadatasubtitles.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
-    <Content Include="dashboard-ui\scripts\movieslatest.js">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
     <Content Include="dashboard-ui\scripts\musicalbumartists.js">
     <Content Include="dashboard-ui\scripts\musicalbumartists.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>