aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/UserService.cs15
-rw-r--r--MediaBrowser.Common/Extensions/BaseExtensions.cs7
-rw-r--r--MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs22
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs5
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj1
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs2
-rw-r--r--Nuget/MediaBrowser.Common.Internal.nuspec4
-rw-r--r--Nuget/MediaBrowser.Common.nuspec2
-rw-r--r--Nuget/MediaBrowser.Server.Core.nuspec4
9 files changed, 48 insertions, 14 deletions
diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs
index 8eb55c786..b987abcc0 100644
--- a/MediaBrowser.Api/UserService.cs
+++ b/MediaBrowser.Api/UserService.cs
@@ -68,7 +68,7 @@ namespace MediaBrowser.Api
/// </summary>
[Route("/Users/{Id}/Authenticate", "POST")]
[Api(Description = "Authenticates a user")]
- public class AuthenticateUser : IReturn<AuthenticationResult>
+ public class AuthenticateUser : IReturnVoid
{
/// <summary>
/// Gets or sets the id.
@@ -271,21 +271,22 @@ namespace MediaBrowser.Api
/// Posts the specified request.
/// </summary>
/// <param name="request">The request.</param>
- 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<object> AuthenticateUser(AuthenticateUser request)
+ private async Task<AuthenticationResult> 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;
}
/// <summary>
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs
index b4ad90168..4e2a475d9 100644
--- a/MediaBrowser.Common/Extensions/BaseExtensions.cs
+++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs
@@ -62,7 +62,12 @@ namespace MediaBrowser.Common.Extensions
/// <exception cref="System.ArgumentNullException">attrib</exception>
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 000000000..417db404f
--- /dev/null
+++ b/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Net;
+
+namespace MediaBrowser.Model.ApiClient
+{
+ /// <summary>
+ /// Class HttpResponseEventArgs
+ /// </summary>
+ public class HttpResponseEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Gets or sets the URL.
+ /// </summary>
+ /// <value>The URL.</value>
+ public string Url { get; set; }
+ /// <summary>
+ /// Gets or sets the status code.
+ /// </summary>
+ /// <value>The status code.</value>
+ public HttpStatusCode StatusCode { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index fb4e8b406..4ec7b14e1 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -19,6 +19,11 @@ namespace MediaBrowser.Model.ApiClient
public interface IApiClient : IDisposable
{
/// <summary>
+ /// Occurs when [HTTP response received].
+ /// </summary>
+ event EventHandler<HttpResponseEventArgs> HttpResponseReceived;
+
+ /// <summary>
/// Marks the notifications read.
/// </summary>
/// <param name="userId">The user id.</param>
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 2e7d41f87..da01da475 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -41,6 +41,7 @@
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
+ <Compile Include="ApiClient\HttpResponseEventArgs.cs" />
<Compile Include="ApiClient\IApiClient.cs" />
<Compile Include="Configuration\BaseApplicationConfiguration.cs" />
<Compile Include="Configuration\ManualLoginCategory.cs" />
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs
index 180e251b4..c2c3335c3 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 e36d29e20..67f0be702 100644
--- a/Nuget/MediaBrowser.Common.Internal.nuspec
+++ b/Nuget/MediaBrowser.Common.Internal.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
- <version>3.0.140</version>
+ <version>3.0.141</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
- <dependency id="MediaBrowser.Common" version="3.0.140" />
+ <dependency id="MediaBrowser.Common" version="3.0.141" />
<dependency id="NLog" version="2.0.1.2" />
<dependency id="ServiceStack.Text" version="3.9.45" />
<dependency id="SimpleInjector" version="2.2.3" />
diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec
index 29e860785..96536900b 100644
--- a/Nuget/MediaBrowser.Common.nuspec
+++ b/Nuget/MediaBrowser.Common.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
- <version>3.0.140</version>
+ <version>3.0.141</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec
index 7f41aed49..d34febee2 100644
--- a/Nuget/MediaBrowser.Server.Core.nuspec
+++ b/Nuget/MediaBrowser.Server.Core.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
- <version>3.0.140</version>
+ <version>3.0.141</version>
<title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
- <dependency id="MediaBrowser.Common" version="3.0.140" />
+ <dependency id="MediaBrowser.Common" version="3.0.141" />
</dependencies>
</metadata>
<files>