aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/BaseApiService.cs12
-rw-r--r--MediaBrowser.Api/UserService.cs17
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs4
-rw-r--r--MediaBrowser.Controller/Entities/Studio.cs9
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs6
5 files changed, 45 insertions, 3 deletions
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 09eb1ea41..727ee6fbc 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -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);
}
diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs
index df4bc06ba..b7a43c237 100644
--- a/MediaBrowser.Api/UserService.cs
+++ b/MediaBrowser.Api/UserService.cs
@@ -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;
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index b886cef19..12afe26b6 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -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>
diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs
index 8271a3df2..0d934ad0a 100644
--- a/MediaBrowser.Controller/Entities/Studio.cs
+++ b/MediaBrowser.Controller/Entities/Studio.cs
@@ -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>
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
index 2d7c798ad..1933cc716 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
@@ -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.");