aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/UserService.cs11
-rw-r--r--MediaBrowser.Controller/Dto/DtoBuilder.cs20
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs8
-rw-r--r--MediaBrowser.Model/Configuration/ManualLoginCategory.cs3
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs12
-rw-r--r--MediaBrowser.ServerApplication/ApplicationHost.cs4
6 files changed, 49 insertions, 9 deletions
diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs
index b63bafbc0..8eb55c786 100644
--- a/MediaBrowser.Api/UserService.cs
+++ b/MediaBrowser.Api/UserService.cs
@@ -197,7 +197,8 @@ namespace MediaBrowser.Api
{
return Get(new GetUsers
{
- IsHidden = false
+ IsHidden = false,
+ IsDisabled = false
});
}
@@ -367,7 +368,13 @@ namespace MediaBrowser.Api
}
}
- // If removing admin access
+ // If disabling
+ if (dtoUser.Configuration.IsDisabled && user.Configuration.IsAdministrator)
+ {
+ throw new ArgumentException("Administrators cannot be disabled.");
+ }
+
+ // If disabling
if (dtoUser.Configuration.IsDisabled && !user.Configuration.IsDisabled)
{
if (_userManager.Users.Count(i => !i.Configuration.IsDisabled) == 1)
diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs
index 6df8f1aed..d1a0465cd 100644
--- a/MediaBrowser.Controller/Dto/DtoBuilder.cs
+++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs
@@ -364,7 +364,7 @@ namespace MediaBrowser.Controller.Dto
// If there is no logo, indicate what parent has one in case the Ui wants to allow inheritance
if (!dto.HasLogo)
{
- var parentWithLogo = GetParentLogoItem(item);
+ var parentWithLogo = GetParentImageItem(item, ImageType.Logo);
if (parentWithLogo != null)
{
@@ -374,6 +374,19 @@ namespace MediaBrowser.Controller.Dto
}
}
+ // If there is no art, indicate what parent has one in case the Ui wants to allow inheritance
+ if (!dto.HasArtImage)
+ {
+ var parentWithImage = GetParentImageItem(item, ImageType.Art);
+
+ if (parentWithImage != null)
+ {
+ dto.ParentLogoItemId = GetClientItemId(parentWithImage);
+
+ dto.ParentLogoImageTag = GetImageCacheTag(parentWithImage, ImageType.Art, parentWithImage.GetImage(ImageType.Art));
+ }
+ }
+
if (fields.Contains(ItemFields.Path))
{
dto.Path = item.Path;
@@ -751,14 +764,15 @@ namespace MediaBrowser.Controller.Dto
/// If an item does not have a logo, this can be used to find the first parent that does have one
/// </summary>
/// <param name="item">The item.</param>
+ /// <param name="type">The type.</param>
/// <returns>BaseItem.</returns>
- private BaseItem GetParentLogoItem(BaseItem item)
+ private BaseItem GetParentImageItem(BaseItem item, ImageType type)
{
var parent = item.Parent;
while (parent != null)
{
- if (parent.HasImage(ImageType.Logo))
+ if (parent.HasImage(type))
{
return parent;
}
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index 5ecb87b5a..fb4e8b406 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -641,6 +641,14 @@ namespace MediaBrowser.Model.ApiClient
string GetLogoImageUrl(BaseItemDto item, ImageOptions options);
/// <summary>
+ /// Gets the art image URL.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="options">The options.</param>
+ /// <returns>System.String.</returns>
+ string GetArtImageUrl(BaseItemDto item, ImageOptions options);
+
+ /// <summary>
/// Gets the url needed to stream an audio file
/// </summary>
/// <param name="options">The options.</param>
diff --git a/MediaBrowser.Model/Configuration/ManualLoginCategory.cs b/MediaBrowser.Model/Configuration/ManualLoginCategory.cs
index 20e873437..37b6d6c82 100644
--- a/MediaBrowser.Model/Configuration/ManualLoginCategory.cs
+++ b/MediaBrowser.Model/Configuration/ManualLoginCategory.cs
@@ -4,7 +4,6 @@ namespace MediaBrowser.Model.Configuration
public enum ManualLoginCategory
{
Mobile,
- MediaBrowserTheater,
- Roku
+ MediaBrowserTheater
}
}
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 1494795da..dca2cef87 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -417,6 +417,18 @@ namespace MediaBrowser.Model.Dto
public Guid? ParentLogoImageTag { get; set; }
/// <summary>
+ /// If the item does not have a art, this will hold the Id of the Parent that has one.
+ /// </summary>
+ /// <value>The parent art item id.</value>
+ public string ParentArtItemId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the parent art image tag.
+ /// </summary>
+ /// <value>The parent art image tag.</value>
+ public Guid? ParentArtImageTag { get; set; }
+
+ /// <summary>
/// Gets or sets the chapters.
/// </summary>
/// <value>The chapters.</value>
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs
index 2f78f0d8f..9b18826e3 100644
--- a/MediaBrowser.ServerApplication/ApplicationHost.cs
+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs
@@ -1,5 +1,4 @@
-using System.Threading;
-using MediaBrowser.Api;
+using MediaBrowser.Api;
using MediaBrowser.Common;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Constants;
@@ -53,6 +52,7 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
+using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.ServerApplication