diff options
5 files changed, 48 insertions, 21 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 84b6d8097..f81485867 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -125,7 +125,7 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The trailer URL.</value> public List<MediaUrl> RemoteTrailers { get; set; } - + /// <summary> /// Return the id that should be used to key display prefs for this item. /// Default is based on the type for everything except actual generic folders. @@ -1226,6 +1226,25 @@ namespace MediaBrowser.Controller.Entities } /// <summary> + /// Adds the tagline. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="tagline">The tagline.</param> + /// <exception cref="System.ArgumentNullException">tagline</exception> + public void AddTagline(string tagline) + { + if (string.IsNullOrWhiteSpace(tagline)) + { + throw new ArgumentNullException("tagline"); + } + + if (!Taglines.Contains(tagline, StringComparer.OrdinalIgnoreCase)) + { + Taglines.Add(tagline); + } + } + + /// <summary> /// Adds a studio to the item /// </summary> /// <param name="name">The name.</param> diff --git a/MediaBrowser.Controller/Entities/Extensions.cs b/MediaBrowser.Controller/Entities/Extensions.cs index 311e28cbb..d189f4e71 100644 --- a/MediaBrowser.Controller/Entities/Extensions.cs +++ b/MediaBrowser.Controller/Entities/Extensions.cs @@ -4,27 +4,18 @@ using System.Linq; namespace MediaBrowser.Controller.Entities { + /// <summary> + /// Class Extensions + /// </summary> public static class Extensions { /// <summary> - /// Adds the tagline. + /// Adds the trailer URL. /// </summary> /// <param name="item">The item.</param> - /// <param name="tagline">The tagline.</param> - /// <exception cref="System.ArgumentNullException">tagline</exception> - public static void AddTagline(this BaseItem item, string tagline) - { - if (string.IsNullOrWhiteSpace(tagline)) - { - throw new ArgumentNullException("tagline"); - } - - if (!item.Taglines.Contains(tagline, StringComparer.OrdinalIgnoreCase)) - { - item.Taglines.Add(tagline); - } - } - + /// <param name="url">The URL.</param> + /// <param name="isDirectLink">if set to <c>true</c> [is direct link].</param> + /// <exception cref="System.ArgumentNullException">url</exception> public static void AddTrailerUrl(this BaseItem item, string url, bool isDirectLink) { if (string.IsNullOrWhiteSpace(url)) diff --git a/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs b/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs index 6cddcdf2e..1a56005dc 100644 --- a/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs +++ b/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common; +using System.Net.Sockets; +using MediaBrowser.Common; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; @@ -169,6 +170,12 @@ namespace MediaBrowser.Server.Implementations.ServerManager HttpServer.EnableHttpRequestLogging = ConfigurationManager.Configuration.EnableHttpLevelLogging; HttpServer.Start(_applicationHost.HttpServerUrlPrefix); } + catch (SocketException ex) + { + _logger.ErrorException("The http server is unable to start due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system.", ex); + + throw; + } catch (HttpListenerException ex) { _logger.ErrorException("Error starting Http Server", ex); diff --git a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs index 797c4a80c..6649fd197 100644 --- a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs +++ b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs @@ -4,6 +4,7 @@ using MediaBrowser.Common.Net; using MediaBrowser.Model.Logging; using System; using System.Net; +using System.Net.Sockets; namespace MediaBrowser.Server.Implementations.WebSocket { @@ -60,7 +61,16 @@ namespace MediaBrowser.Server.Implementations.WebSocket TimeOut = TimeSpan.FromHours(12) }; - WebSocketServer.Start(); + try + { + WebSocketServer.Start(); + } + catch (SocketException ex) + { + _logger.ErrorException("The web socket server is unable to start on port {0} due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system.", ex, portNumber); + + throw; + } Port = portNumber; diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 322420545..57b39c209 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -1,5 +1,4 @@ -using System.Threading; -using MediaBrowser.Api; +using MediaBrowser.Api; using MediaBrowser.Common; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Constants; @@ -57,6 +56,7 @@ using System.Net; using System.Net.Cache; using System.Net.Http; using System.Reflection; +using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.ServerApplication |
