aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs23
-rw-r--r--MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs17
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json4
-rw-r--r--MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs3
4 files changed, 36 insertions, 11 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 854d5b4ad..5cbd6d494 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -446,22 +446,29 @@ namespace MediaBrowser.Api.Playback.Hls
while (!cancellationToken.IsCancellationRequested)
{
- using (var fileStream = GetPlaylistFileStream(playlistPath))
+ try
{
- using (var reader = new StreamReader(fileStream))
+ using (var fileStream = GetPlaylistFileStream(playlistPath))
{
- while (!reader.EndOfStream)
+ using (var reader = new StreamReader(fileStream))
{
- var text = await reader.ReadLineAsync().ConfigureAwait(false);
-
- // If it appears in the playlist, it's done
- if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1)
+ while (!reader.EndOfStream)
{
- return GetSegmentResult(segmentPath, segmentIndex, segmentLength, transcodingJob);
+ var text = await reader.ReadLineAsync().ConfigureAwait(false);
+
+ // If it appears in the playlist, it's done
+ if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ return GetSegmentResult(segmentPath, segmentIndex, segmentLength, transcodingJob);
+ }
}
}
}
}
+ catch (IOException)
+ {
+ // May get an error if the file is locked
+ }
await Task.Delay(100, cancellationToken).ConfigureAwait(false);
}
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
index b3a7f70bd..ae2148f08 100644
--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
@@ -105,6 +105,23 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
return client;
}
+ private WebRequest CreateWebRequest(string url)
+ {
+ try
+ {
+ return WebRequest.Create(url);
+ }
+ catch (NotSupportedException)
+ {
+ //Webrequest creation does fail on MONO randomly when using WebRequest.Create
+ //the issue occurs in the GetCreator method here: http://www.oschina.net/code/explore/mono-2.8.1/mcs/class/System/System.Net/WebRequest.cs
+
+ var type = Type.GetType("System.Net.HttpRequestCreator, System, Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089");
+ var creator = Activator.CreateInstance(type, nonPublic: true) as IWebRequestCreate;
+ return creator.Create(new Uri(url)) as HttpWebRequest;
+ }
+ }
+
private WebRequest GetRequest(HttpRequestOptions options, string method, bool enableHttpCompression)
{
var request = WebRequest.Create(options.Url);
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index f801057ab..7e70cd942 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -85,8 +85,8 @@
"ButtonDonateWithPayPal": "Donate with PayPal",
"OptionDetectArchiveFilesAsMedia": "Detect archive files as media",
"OptionDetectArchiveFilesAsMediaHelp": "If enabled, files with .rar and .zip extensions will be detected as media files.",
- "LabelEnterConnectUserName": "User name or email:",
- "LabelEnterConnectUserNameHelp": "This is your Emby online account user name or password.",
+ "LabelEnterConnectUserName": "Username or email:",
+ "LabelEnterConnectUserNameHelp": "This is your Emby online account username or password.",
"LabelEnableEnhancedMovies": "Enable enhanced movie displays",
"LabelEnableEnhancedMoviesHelp": "When enabled, movies will be displayed as folders to include trailers, extras, cast & crew, and other related content.",
"HeaderSyncJobInfo": "Sync Job",
diff --git a/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs b/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs
index 44d8cc437..2adf3e86a 100644
--- a/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs
+++ b/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs
@@ -179,7 +179,8 @@ namespace MediaBrowser.Server.Implementations.ServerManager
if (!message.StartsWith("{", StringComparison.OrdinalIgnoreCase))
{
- _logger.Error("Received web socket message that is not a json structure: " + message);
+ // This info is useful sometimes but also clogs up the log
+ //_logger.Error("Received web socket message that is not a json structure: " + message);
return;
}