The Free Software Media System - Server Backend & API
Revert "Merge pull request #13604 from Jxiced/master"
Bond_009c7c7b30d287c
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 9849de0573..d2895cabed 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -197,7 +197,6 @@- [Kenneth Cochran](https://github.com/kennethcochran)- [benedikt257](https://github.com/benedikt257)- [revam](https://github.com/revam)- - [Jxiced](https://github.com/Jxiced)- [allesmi](https://github.com/allesmi)- [ThunderClapLP](https://github.com/ThunderClapLP)- [Shoham Peller](https://github.com/spellr)diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.csindex 3bb68553de..09f20558fe 100644--- a/Jellyfin.Api/Controllers/StartupController.cs+++ b/Jellyfin.Api/Controllers/StartupController.cs@@ -1,4 +1,3 @@-using System;using System.ComponentModel.DataAnnotations;using System.Linq;using System.Threading.Tasks;@@ -132,16 +131,16 @@ public class StartupController : BaseJellyfinApiController[ProducesResponseType(StatusCodes.Status204NoContent)]public async Task<ActionResult> UpdateStartupUser([FromBody] StartupUserDto startupUserDto){- ArgumentNullException.ThrowIfNull(startupUserDto.Name);- _userManager.ThrowIfInvalidUsername(startupUserDto.Name);-var user = _userManager.Users.First();if (string.IsNullOrWhiteSpace(startupUserDto.Password)){return BadRequest("Password must not be empty");}- user.Username = startupUserDto.Name;+ if (startupUserDto.Name is not null)+ {+ user.Username = startupUserDto.Name;+ }await _userManager.UpdateUserAsync(user).ConfigureAwait(false);diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.csindex 4f944c87df..3dfb14d716 100644--- a/Jellyfin.Server.Implementations/Users/UserManager.cs+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs@@ -744,8 +744,7 @@ namespace Jellyfin.Server.Implementations.Users_users[user.Id] = user;}- /// <inheritdoc/>- public void ThrowIfInvalidUsername(string name)+ internal static void ThrowIfInvalidUsername(string name){if (!string.IsNullOrWhiteSpace(name) && ValidUsernameRegex().IsMatch(name)){diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.csindex 7f06a318ab..0109cf4b7d 100644--- a/MediaBrowser.Controller/Library/IUserManager.cs+++ b/MediaBrowser.Controller/Library/IUserManager.cs@@ -33,12 +33,6 @@ namespace MediaBrowser.Controller.Library/// <value>The users ids.</value>IEnumerable<Guid> UsersIds { get; }- /// <summary>- /// Checks if the user's username is valid.- /// </summary>- /// <param name="name">The user's username.</param>- void ThrowIfInvalidUsername(string name);-/// <summary>/// Initializes the user manager and ensures that a user exists./// </summary>