Change userId to required in operations that would otherwise throw exceptions
This commit is contained in:
parent
93dbbfea03
commit
226abde3f7
|
@ -143,7 +143,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[HttpGet("Items")]
|
[HttpGet("Items")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetItems(
|
public ActionResult<QueryResult<BaseItemDto>> GetItems(
|
||||||
[FromQuery] Guid? userId,
|
[FromQuery] Guid userId,
|
||||||
[FromQuery] string? maxOfficialRating,
|
[FromQuery] string? maxOfficialRating,
|
||||||
[FromQuery] bool? hasThemeSong,
|
[FromQuery] bool? hasThemeSong,
|
||||||
[FromQuery] bool? hasThemeVideo,
|
[FromQuery] bool? hasThemeVideo,
|
||||||
|
@ -224,8 +224,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
[FromQuery] bool enableTotalRecordCount = true,
|
[FromQuery] bool enableTotalRecordCount = true,
|
||||||
[FromQuery] bool? enableImages = true)
|
[FromQuery] bool? enableImages = true)
|
||||||
{
|
{
|
||||||
var user = userId.HasValue && !userId.Equals(Guid.Empty)
|
var user = !userId.Equals(Guid.Empty)
|
||||||
? _userManager.GetUserById(userId.Value)
|
? _userManager.GetUserById(userId)
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetTrailers(
|
public ActionResult<QueryResult<BaseItemDto>> GetTrailers(
|
||||||
[FromQuery] Guid? userId,
|
[FromQuery] Guid userId,
|
||||||
[FromQuery] string? maxOfficialRating,
|
[FromQuery] string? maxOfficialRating,
|
||||||
[FromQuery] bool? hasThemeSong,
|
[FromQuery] bool? hasThemeSong,
|
||||||
[FromQuery] bool? hasThemeVideo,
|
[FromQuery] bool? hasThemeVideo,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user