From 3241a11e9902f4d42b0668c04e6eb8bebf7d54e5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 28 May 2015 01:51:48 -0400 Subject: bump dev version --- MediaBrowser.Common.Implementations/BaseApplicationPaths.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Common.Implementations') diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index 4ad63b2e3..9ba2effd3 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -24,7 +24,10 @@ namespace MediaBrowser.Common.Implementations /// /// Gets the path to the system folder /// - public string ProgramSystemPath { get { return Path.Combine(ProgramDataPath, "system"); } } + public string ProgramSystemPath + { + get { return Path.GetDirectoryName(ApplicationPath); } + } /// /// The _data directory -- cgit v1.2.3 From 00aa3b0de09a97c5eba2f46acf7a78c998d79f2b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 5 Jun 2015 01:32:14 -0400 Subject: update connect --- MediaBrowser.Api/Playback/TranscodingThrottler.cs | 13 +++---------- .../HttpClientManager/HttpClientManager.cs | 17 ++++++++++++++--- .../Persistence/SqliteItemRepository.cs | 18 ++++++++++++++++-- .../MediaBrowser.WebDashboard.csproj | 3 +++ 4 files changed, 36 insertions(+), 15 deletions(-) (limited to 'MediaBrowser.Common.Implementations') diff --git a/MediaBrowser.Api/Playback/TranscodingThrottler.cs b/MediaBrowser.Api/Playback/TranscodingThrottler.cs index f94d5d837..fec3dda86 100644 --- a/MediaBrowser.Api/Playback/TranscodingThrottler.cs +++ b/MediaBrowser.Api/Playback/TranscodingThrottler.cs @@ -42,14 +42,7 @@ namespace MediaBrowser.Api.Playback var options = GetOptions(); - var threshold = options.ThrottleThresholdInSeconds; - - if (!options.EnableThrottling) - { - threshold *= 2; - } - - if (IsThrottleAllowed(_job, threshold)) + if (options.EnableThrottling && IsThrottleAllowed(_job, options.ThrottleThresholdInSeconds)) { PauseTranscoding(); } @@ -63,7 +56,7 @@ namespace MediaBrowser.Api.Playback { if (!_isPaused) { - //_logger.Debug("Sending pause command to ffmpeg"); + _logger.Debug("Sending pause command to ffmpeg"); try { @@ -81,7 +74,7 @@ namespace MediaBrowser.Api.Playback { if (_isPaused) { - //_logger.Debug("Sending unpause command to ffmpeg"); + _logger.Debug("Sending unpause command to ffmpeg"); try { diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index 94c91c55a..b3a7f70bd 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -723,9 +723,20 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager /// System.String. private string GetHostFromUrl(string url) { - var start = url.IndexOf("://", StringComparison.OrdinalIgnoreCase) + 3; - var len = url.IndexOf('/', start) - start; - return url.Substring(start, len); + var index = url.IndexOf("://", StringComparison.OrdinalIgnoreCase); + + if (index != -1) + { + url = url.Substring(index + 3); + var host = url.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); + + if (!string.IsNullOrWhiteSpace(host)) + { + return host; + } + } + + return url; } /// diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 9a013e2e7..5e992d9db 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -137,6 +137,10 @@ namespace MediaBrowser.Server.Implementations.Persistence _connection.AddColumn(_logger, "TypedBaseItems", "IsKids", "BIT"); _connection.AddColumn(_logger, "TypedBaseItems", "CommunityRating", "Float"); _connection.AddColumn(_logger, "TypedBaseItems", "CustomRating", "Text"); + _connection.AddColumn(_logger, "TypedBaseItems", "IndexNumber", "INT"); + _connection.AddColumn(_logger, "TypedBaseItems", "IsLocked", "BIT"); + _connection.AddColumn(_logger, "TypedBaseItems", "Name", "Text"); + _connection.AddColumn(_logger, "TypedBaseItems", "OfficialRating", "Text"); PrepareStatements(); @@ -166,10 +170,14 @@ namespace MediaBrowser.Server.Implementations.Persistence "IsMovie", "IsSports", "CommunityRating", - "CustomRating" + "CustomRating", + "IndexNumber", + "IsLocked", + "Name", + "OfficialRating" }; _saveItemCommand = _connection.CreateCommand(); - _saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11)"; + _saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15)"; for (var i = 1; i <= saveColumns.Count; i++) { _saveItemCommand.Parameters.Add(_saveItemCommand, "@" + i.ToString(CultureInfo.InvariantCulture)); @@ -276,6 +284,12 @@ namespace MediaBrowser.Server.Implementations.Persistence _saveItemCommand.GetParameter(index++).Value = item.CommunityRating; _saveItemCommand.GetParameter(index++).Value = item.CustomRating; + _saveItemCommand.GetParameter(index++).Value = item.IndexNumber; + _saveItemCommand.GetParameter(index++).Value = item.IsLocked; + + _saveItemCommand.GetParameter(index++).Value = item.Name; + _saveItemCommand.GetParameter(index++).Value = item.OfficialRating; + _saveItemCommand.Transaction = transaction; _saveItemCommand.ExecuteNonQuery(); diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 48cd3f234..92a3f5c16 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -126,6 +126,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From e8322b4a12652004a19835d0f27390ff1335da16 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 7 Jun 2015 17:21:30 -0400 Subject: add mono CreateWebRequest workaround --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 23 ++++++++++++++-------- .../HttpClientManager/HttpClientManager.cs | 17 ++++++++++++++++ .../Localization/Server/server.json | 4 ++-- .../ServerManager/WebSocketConnection.cs | 3 ++- 4 files changed, 36 insertions(+), 11 deletions(-) (limited to 'MediaBrowser.Common.Implementations') 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; } -- cgit v1.2.3