Bladeren bron

update nuget

Luke Pulverenti 12 jaren geleden
bovenliggende
commit
48265fefa4

+ 8 - 7
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>

+ 6 - 1
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");
             }

+ 22 - 0
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; }
+    }
+}

+ 5 - 0
MediaBrowser.Model/ApiClient/IApiClient.cs

@@ -18,6 +18,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>

+ 1 - 0
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" />

+ 1 - 1
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 };
                 }
             }
 

+ 2 - 2
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" />

+ 1 - 1
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>

+ 2 - 2
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>