The Free Software Media System - Server Backend & API
fixes for new user settings
Luke Pulverentib70ecab40a4d
diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.csindex b63bafbc0d..8eb55c786e 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 disablingif (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.csindex 6df8f1aed6..d1a0465cd3 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 inheritanceif (!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.csindex 5ecb87b5a4..fb4e8b406b 100644--- a/MediaBrowser.Model/ApiClient/IApiClient.cs+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs@@ -640,6 +640,14 @@ namespace MediaBrowser.Model.ApiClient/// <exception cref="ArgumentNullException">item</exception>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>diff --git a/MediaBrowser.Model/Configuration/ManualLoginCategory.cs b/MediaBrowser.Model/Configuration/ManualLoginCategory.csindex 20e873437c..37b6d6c82f 100644--- a/MediaBrowser.Model/Configuration/ManualLoginCategory.cs+++ b/MediaBrowser.Model/Configuration/ManualLoginCategory.cs@@ -4,7 +4,6 @@ namespace MediaBrowser.Model.Configurationpublic enum ManualLoginCategory{Mobile,- MediaBrowserTheater,- Roku+ MediaBrowserTheater}}diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.csindex 1494795dab..dca2cef87f 100644--- a/MediaBrowser.Model/Dto/BaseItemDto.cs+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs@@ -416,6 +416,18 @@ namespace MediaBrowser.Model.Dto/// <value>The parent logo image tag.</value>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>diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.csindex 2f78f0d8f6..9b18826e3d 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