fix ipad login issue

This commit is contained in:
Luke Pulverenti 2014-07-14 21:25:58 -04:00
parent 9c252f3e50
commit 98012480f7
5 changed files with 45 additions and 3 deletions

View File

@ -125,7 +125,7 @@ namespace MediaBrowser.Api
return ResultFactory.GetStaticFileResult(Request, path);
}
private readonly char[] _dashReplaceChars = new[] { '?', '/' };
private readonly char[] _dashReplaceChars = { '?', '/' };
private const char SlugChar = '-';
protected MusicArtist GetArtist(string name, ILibraryManager libraryManager)
@ -168,6 +168,11 @@ namespace MediaBrowser.Api
{
var user = userManager.GetUserById(userId.Value);
if (user == null)
{
throw new ArgumentException("User not found");
}
return folder.GetRecursiveChildren(user);
}
@ -177,6 +182,11 @@ namespace MediaBrowser.Api
{
var user = userManager.GetUserById(userId.Value);
if (user == null)
{
throw new ArgumentException("User not found");
}
return userManager.GetUserById(userId.Value).RootFolder.GetRecursiveChildren(user);
}

View File

@ -357,6 +357,23 @@ namespace MediaBrowser.Api
{
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
if (string.IsNullOrWhiteSpace(auth.Client))
{
auth.Client = "Unknown app";
}
if (string.IsNullOrWhiteSpace(auth.Device))
{
auth.Device = "Unknown device";
}
if (string.IsNullOrWhiteSpace(auth.Version))
{
auth.Version = "Unknown version";
}
if (string.IsNullOrWhiteSpace(auth.DeviceId))
{
auth.DeviceId = "Unknown device id";
}
var result = _sessionMananger.AuthenticateNewSession(request.Username, request.Password, auth.Client, auth.Version,
auth.DeviceId, auth.Device, Request.RemoteIp, Request.IsLocal).Result;

View File

@ -21,12 +21,13 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Folder
/// </summary>
public class Folder : BaseItem, IHasThemeMedia
public class Folder : BaseItem, IHasThemeMedia, IHasTags
{
public static IUserManager UserManager { get; set; }
public List<Guid> ThemeSongIds { get; set; }
public List<Guid> ThemeVideoIds { get; set; }
public List<string> Tags { get; set; }
public Folder()
{
@ -34,6 +35,7 @@ namespace MediaBrowser.Controller.Entities
ThemeSongIds = new List<Guid>();
ThemeVideoIds = new List<Guid>();
Tags = new List<string>();
}
/// <summary>

View File

@ -7,8 +7,15 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Studio
/// </summary>
public class Studio : BaseItem, IItemByName
public class Studio : BaseItem, IItemByName, IHasTags
{
public List<string> Tags { get; set; }
public Studio()
{
Tags = new List<string>();
}
/// <summary>
/// Gets the user data key.
/// </summary>

View File

@ -66,6 +66,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
? null
: UserManager.GetUserById(new Guid(auth.UserId));
if (user == null & !string.IsNullOrWhiteSpace(auth.UserId))
{
// TODO: Re-enable
//throw new ArgumentException("User with Id " + auth.UserId + " not found");
}
if (user != null && user.Configuration.IsDisabled)
{
throw new UnauthorizedAccessException("User account has been disabled.");