|
|
@ -33,16 +33,16 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Completes the startup wizard.
|
|
|
|
/// Completes the startup wizard.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <response code="200">Startup wizard completed.</response>
|
|
|
|
/// <response code="204">Startup wizard completed.</response>
|
|
|
|
/// <returns>An <see cref="OkResult"/> indicating success.</returns>
|
|
|
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
|
|
|
[HttpPost("Complete")]
|
|
|
|
[HttpPost("Complete")]
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
public ActionResult CompleteWizard()
|
|
|
|
public ActionResult CompleteWizard()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_config.Configuration.IsStartupWizardCompleted = true;
|
|
|
|
_config.Configuration.IsStartupWizardCompleted = true;
|
|
|
|
_config.SetOptimalValues();
|
|
|
|
_config.SetOptimalValues();
|
|
|
|
_config.SaveConfiguration();
|
|
|
|
_config.SaveConfiguration();
|
|
|
|
return Ok();
|
|
|
|
return NoContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -70,10 +70,10 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
/// <param name="uiCulture">The UI language culture.</param>
|
|
|
|
/// <param name="uiCulture">The UI language culture.</param>
|
|
|
|
/// <param name="metadataCountryCode">The metadata country code.</param>
|
|
|
|
/// <param name="metadataCountryCode">The metadata country code.</param>
|
|
|
|
/// <param name="preferredMetadataLanguage">The preferred language for metadata.</param>
|
|
|
|
/// <param name="preferredMetadataLanguage">The preferred language for metadata.</param>
|
|
|
|
/// <response code="200">Configuration saved.</response>
|
|
|
|
/// <response code="204">Configuration saved.</response>
|
|
|
|
/// <returns>An <see cref="OkResult"/> indicating success.</returns>
|
|
|
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
|
|
|
[HttpPost("Configuration")]
|
|
|
|
[HttpPost("Configuration")]
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
public ActionResult UpdateInitialConfiguration(
|
|
|
|
public ActionResult UpdateInitialConfiguration(
|
|
|
|
[FromForm] string uiCulture,
|
|
|
|
[FromForm] string uiCulture,
|
|
|
|
[FromForm] string metadataCountryCode,
|
|
|
|
[FromForm] string metadataCountryCode,
|
|
|
@ -83,7 +83,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
_config.Configuration.MetadataCountryCode = metadataCountryCode;
|
|
|
|
_config.Configuration.MetadataCountryCode = metadataCountryCode;
|
|
|
|
_config.Configuration.PreferredMetadataLanguage = preferredMetadataLanguage;
|
|
|
|
_config.Configuration.PreferredMetadataLanguage = preferredMetadataLanguage;
|
|
|
|
_config.SaveConfiguration();
|
|
|
|
_config.SaveConfiguration();
|
|
|
|
return Ok();
|
|
|
|
return NoContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -91,16 +91,16 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="enableRemoteAccess">Enable remote access.</param>
|
|
|
|
/// <param name="enableRemoteAccess">Enable remote access.</param>
|
|
|
|
/// <param name="enableAutomaticPortMapping">Enable UPnP.</param>
|
|
|
|
/// <param name="enableAutomaticPortMapping">Enable UPnP.</param>
|
|
|
|
/// <response code="200">Configuration saved.</response>
|
|
|
|
/// <response code="204">Configuration saved.</response>
|
|
|
|
/// <returns>An <see cref="OkResult"/> indicating success.</returns>
|
|
|
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
|
|
|
[HttpPost("RemoteAccess")]
|
|
|
|
[HttpPost("RemoteAccess")]
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
public ActionResult SetRemoteAccess([FromForm] bool enableRemoteAccess, [FromForm] bool enableAutomaticPortMapping)
|
|
|
|
public ActionResult SetRemoteAccess([FromForm] bool enableRemoteAccess, [FromForm] bool enableAutomaticPortMapping)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_config.Configuration.EnableRemoteAccess = enableRemoteAccess;
|
|
|
|
_config.Configuration.EnableRemoteAccess = enableRemoteAccess;
|
|
|
|
_config.Configuration.EnableUPnP = enableAutomaticPortMapping;
|
|
|
|
_config.Configuration.EnableUPnP = enableAutomaticPortMapping;
|
|
|
|
_config.SaveConfiguration();
|
|
|
|
_config.SaveConfiguration();
|
|
|
|
return Ok();
|
|
|
|
return NoContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -121,13 +121,13 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
/// Sets the user name and password.
|
|
|
|
/// Sets the user name and password.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="startupUserDto">The DTO containing username and password.</param>
|
|
|
|
/// <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>
|
|
|
|
/// <returns>
|
|
|
|
/// A <see cref="Task" /> that represents the asynchronous update operation.
|
|
|
|
/// 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>
|
|
|
|
/// </returns>
|
|
|
|
[HttpPost("User")]
|
|
|
|
[HttpPost("User")]
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
public async Task<ActionResult> UpdateUser([FromForm] StartupUserDto startupUserDto)
|
|
|
|
public async Task<ActionResult> UpdateUser([FromForm] StartupUserDto startupUserDto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var user = _userManager.Users.First();
|
|
|
|
var user = _userManager.Users.First();
|
|
|
@ -141,7 +141,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
await _userManager.ChangePassword(user, startupUserDto.Password).ConfigureAwait(false);
|
|
|
|
await _userManager.ChangePassword(user, startupUserDto.Password).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Ok();
|
|
|
|
return NoContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|