mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
Use Http status code 204 instead of 200
This commit is contained in:
@@ -33,16 +33,16 @@ namespace Jellyfin.Api.Controllers
|
||||
/// <summary>
|
||||
/// Completes the startup wizard.
|
||||
/// </summary>
|
||||
/// <response code="200">Startup wizard completed.</response>
|
||||
/// <returns>An <see cref="OkResult"/> indicating success.</returns>
|
||||
/// <response code="204">Startup wizard completed.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||
[HttpPost("Complete")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public ActionResult CompleteWizard()
|
||||
{
|
||||
_config.Configuration.IsStartupWizardCompleted = true;
|
||||
_config.SetOptimalValues();
|
||||
_config.SaveConfiguration();
|
||||
return Ok();
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,10 +70,10 @@ namespace Jellyfin.Api.Controllers
|
||||
/// <param name="uiCulture">The UI language culture.</param>
|
||||
/// <param name="metadataCountryCode">The metadata country code.</param>
|
||||
/// <param name="preferredMetadataLanguage">The preferred language for metadata.</param>
|
||||
/// <response code="200">Configuration saved.</response>
|
||||
/// <returns>An <see cref="OkResult"/> indicating success.</returns>
|
||||
/// <response code="204">Configuration saved.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||
[HttpPost("Configuration")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public ActionResult UpdateInitialConfiguration(
|
||||
[FromForm] string uiCulture,
|
||||
[FromForm] string metadataCountryCode,
|
||||
@@ -83,7 +83,7 @@ namespace Jellyfin.Api.Controllers
|
||||
_config.Configuration.MetadataCountryCode = metadataCountryCode;
|
||||
_config.Configuration.PreferredMetadataLanguage = preferredMetadataLanguage;
|
||||
_config.SaveConfiguration();
|
||||
return Ok();
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,16 +91,16 @@ namespace Jellyfin.Api.Controllers
|
||||
/// </summary>
|
||||
/// <param name="enableRemoteAccess">Enable remote access.</param>
|
||||
/// <param name="enableAutomaticPortMapping">Enable UPnP.</param>
|
||||
/// <response code="200">Configuration saved.</response>
|
||||
/// <returns>An <see cref="OkResult"/> indicating success.</returns>
|
||||
/// <response code="204">Configuration saved.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||
[HttpPost("RemoteAccess")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public ActionResult SetRemoteAccess([FromForm] bool enableRemoteAccess, [FromForm] bool enableAutomaticPortMapping)
|
||||
{
|
||||
_config.Configuration.EnableRemoteAccess = enableRemoteAccess;
|
||||
_config.Configuration.EnableUPnP = enableAutomaticPortMapping;
|
||||
_config.SaveConfiguration();
|
||||
return Ok();
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -121,13 +121,13 @@ namespace Jellyfin.Api.Controllers
|
||||
/// Sets the user name and password.
|
||||
/// </summary>
|
||||
/// <param name="startupUserDto">The DTO containing username and password.</param>
|
||||
/// <response code="200">Updated user name and password.</response>
|
||||
/// <response code="204">Updated user name and password.</response>
|
||||
/// <returns>
|
||||
/// A <see cref="Task" /> that represents the asynchronous update operation.
|
||||
/// The task result contains an <see cref="OkResult"/> indicating success.
|
||||
/// The task result contains a <see cref="NoContentResult"/> indicating success.
|
||||
/// </returns>
|
||||
[HttpPost("User")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<ActionResult> UpdateUser([FromForm] StartupUserDto startupUserDto)
|
||||
{
|
||||
var user = _userManager.Users.First();
|
||||
@@ -141,7 +141,7 @@ namespace Jellyfin.Api.Controllers
|
||||
await _userManager.ChangePassword(user, startupUserDto.Password).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user