diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs index 8eb55c786e..b987abcc04 100644 --- a/MediaBrowser.Api/UserService.cs +++ b/MediaBrowser.Api/UserService.cs @@ -68,7 +68,7 @@ namespace MediaBrowser.Api /// [Route("/Users/{Id}/Authenticate", "POST")] [Api(Description = "Authenticates a user")] - public class AuthenticateUser : IReturn + public class AuthenticateUser : IReturnVoid { /// /// Gets or sets the id. @@ -271,21 +271,22 @@ namespace MediaBrowser.Api /// Posts the specified request. /// /// The request. - public object Post(AuthenticateUser request) + public void Post(AuthenticateUser request) { + // No response needed. Will throw an exception on failure. var result = AuthenticateUser(request).Result; - - return ToOptimizedResult(result); } public object Post(AuthenticateUserByName request) { var user = _userManager.Users.FirstOrDefault(i => string.Equals(request.Name, i.Name, StringComparison.OrdinalIgnoreCase)); - return AuthenticateUser(new AuthenticateUser { Id = user.Id, Password = request.Password }).Result; + var result = AuthenticateUser(new AuthenticateUser { Id = user.Id, Password = request.Password }).Result; + + return ToOptimizedResult(result); } - private async Task AuthenticateUser(AuthenticateUser request) + private async Task AuthenticateUser(AuthenticateUser request) { var user = _userManager.GetUserById(request.Id); @@ -307,7 +308,7 @@ namespace MediaBrowser.Api User = await new UserDtoBuilder(Logger).GetUserDto(user).ConfigureAwait(false) }; - return ToOptimizedResult(result); + return result; } /// diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs index b4ad901689..4e2a475d90 100644 --- a/MediaBrowser.Common/Extensions/BaseExtensions.cs +++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs @@ -62,7 +62,12 @@ namespace MediaBrowser.Common.Extensions /// attrib public static string GetAttributeValue(this string str, string attrib) { - if (attrib == null) + if (string.IsNullOrEmpty(str)) + { + throw new ArgumentNullException("str"); + } + + if (string.IsNullOrEmpty(attrib)) { throw new ArgumentNullException("attrib"); } diff --git a/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs b/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs new file mode 100644 index 0000000000..417db404fa --- /dev/null +++ b/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs @@ -0,0 +1,22 @@ +using System; +using System.Net; + +namespace MediaBrowser.Model.ApiClient +{ + /// + /// Class HttpResponseEventArgs + /// + public class HttpResponseEventArgs : EventArgs + { + /// + /// Gets or sets the URL. + /// + /// The URL. + public string Url { get; set; } + /// + /// Gets or sets the status code. + /// + /// The status code. + public HttpStatusCode StatusCode { get; set; } + } +} diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index fb4e8b406b..4ec7b14e1b 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -18,6 +18,11 @@ namespace MediaBrowser.Model.ApiClient { public interface IApiClient : IDisposable { + /// + /// Occurs when [HTTP response received]. + /// + event EventHandler HttpResponseReceived; + /// /// Marks the notifications read. /// diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 2e7d41f878..da01da4754 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -41,6 +41,7 @@ Properties\SharedVersion.cs + diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs index 180e251b49..c2c3335c31 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs @@ -34,7 +34,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies if (filename.IndexOf("[boxset]", StringComparison.OrdinalIgnoreCase) != -1 || args.ContainsFileSystemEntryByName("collection.xml")) { - return new BoxSet(); + return new BoxSet { Path = args.Path }; } } diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index e36d29e206..67f0be702f 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.140 + 3.0.141 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 29e8607853..96536900b3 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.140 + 3.0.141 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 7f41aed49f..d34febee21 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.140 + 3.0.141 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - +