aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels van Velzen <nielsvanvelzen@users.noreply.github.com>2025-08-07 21:49:59 +0200
committerGitHub <noreply@github.com>2025-08-07 21:49:59 +0200
commit376220661bc1c982e7aba5c0ea2360b71c8c6a25 (patch)
tree175d6df6c355d5bd24ab6e3854e43ff46c09a574
parent9e88121647d9afe91ff2a6286ef25a10bdbf1c37 (diff)
parentc7c7b30d287cdc4fda2d6d7e633e0659a676b4bd (diff)
Merge pull request #14593 from Bond-009/revert
Revert "Merge pull request #13604 from Jxiced/master"
-rw-r--r--CONTRIBUTORS.md1
-rw-r--r--Jellyfin.Api/Controllers/StartupController.cs9
-rw-r--r--Jellyfin.Server.Implementations/Users/UserManager.cs3
-rw-r--r--MediaBrowser.Controller/Library/IUserManager.cs6
4 files changed, 5 insertions, 14 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 9849de057..d2895cabe 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.cs
index 3bb68553d..09f20558f 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.cs
index 4f944c87d..3dfb14d71 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.cs
index 7f06a318a..0109cf4b7 100644
--- a/MediaBrowser.Controller/Library/IUserManager.cs
+++ b/MediaBrowser.Controller/Library/IUserManager.cs
@@ -34,12 +34,6 @@ namespace MediaBrowser.Controller.Library
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>
/// <returns>Awaitable task.</returns>