diff --git a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs index c917851112..9deb34e917 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs @@ -78,6 +78,8 @@ private void Listen() // Handle the processing of a request in here. private void ListenerCallback(IAsyncResult asyncResult) { + _listenForNextRequest.Set(); + var listener = asyncResult.AsyncState as HttpListener; HttpListenerContext context; @@ -88,8 +90,7 @@ private void ListenerCallback(IAsyncResult asyncResult) { if (!isListening) { - _logger.Debug("Ignoring ListenerCallback() as HttpListener is no longer listening"); - return; + _logger.Debug("Ignoring ListenerCallback() as HttpListener is no longer listening"); return; } // The EndGetContext() method, as with all Begin/End asynchronous methods in the .NET Framework, // blocks until there is a request to be processed or some type of data is available. @@ -105,10 +106,6 @@ private void ListenerCallback(IAsyncResult asyncResult) _logger.Warn(errMsg); return; } - finally - { - _listenForNextRequest.Set(); - } Task.Factory.StartNew(() => InitTask(context)); } @@ -268,4 +265,4 @@ protected virtual void Dispose(bool disposing) } } } -} +} \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 297e351ea6..ffe56e3d9c 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -457,5 +457,10 @@ "MessagePendingMediaBrowserAccountAdded": "The Media Browser account has been added to this user. An email will be sent to the owner of the account. The invitation will need to be confirmed by clicking a link within the email.", "HeaderMediaBrowserAccountRemoved": "Media Browser Account Removed", "MessageMediaBrowserAccontRemoved": "The Media Browser account has been removed from this user.", - "TooltipLinkedToMediaBrowserConnect": "Linked to Media Browser Connect" + "TooltipLinkedToMediaBrowserConnect": "Linked to Media Browser Connect", + "HeaderUnrated": "Unrated", + "ValueDiscNumber": "Disc {0}", + "HeaderUnknownDate": "Unknown Date", + "HeaderUnknownYear": "Unknown Year", + "ValueMinutes": "{0} min" } diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/extensions.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/extensions.js index 712980d8b4..c819ecbae0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/extensions.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/extensions.js @@ -513,8 +513,15 @@ function ticks_to_human(str) { window.Globalize = { translate: function (key) { - return window.localizationGlossary[key] || key; + var val = window.localizationGlossary[key] || key; + for (var i = 1; i < arguments.length; i++) { + + val = val.replace('{' + (i - 1) + '}', arguments[i]); + + } + + return val; } }; diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/librarybrowser.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/librarybrowser.js index 064d21888f..11ef46dc0f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/librarybrowser.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/librarybrowser.js @@ -145,10 +145,10 @@ minutes = minutes || 1; - childText += Math.round(minutes) + " min"; + childText += Globalize.translate('ValueMinutes', Math.round(minutes)); } else { - childText += '0 min'; + childText += Globalize.translate('ValueMinutes', 0); } //childText += item.ChildCount == 1 ? "1 item" : item.ChildCount + " items"; @@ -248,28 +248,28 @@ var html = '