Skip to content

Commit

Permalink
Merge pull request jellyfin#6176 from nielsvanvelzen/userid-required
Browse files Browse the repository at this point in the history
Require userId in getItems and getTrailers endpoints
  • Loading branch information
Bond-009 authored Jun 13, 2021
2 parents 04daf0f + 226abde commit aaa9cc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Jellyfin.Api/Controllers/ItemsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public ItemsController(
[HttpGet("Items")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetItems(
[FromQuery] Guid? userId,
[FromQuery] Guid userId,
[FromQuery] string? maxOfficialRating,
[FromQuery] bool? hasThemeSong,
[FromQuery] bool? hasThemeVideo,
Expand Down Expand Up @@ -224,8 +224,8 @@ public ActionResult<QueryResult<BaseItemDto>> GetItems(
[FromQuery] bool enableTotalRecordCount = true,
[FromQuery] bool? enableImages = true)
{
var user = userId.HasValue && !userId.Equals(Guid.Empty)
? _userManager.GetUserById(userId.Value)
var user = !userId.Equals(Guid.Empty)
? _userManager.GetUserById(userId)
: null;
var dtoOptions = new DtoOptions { Fields = fields }
.AddClientFields(Request)
Expand Down
2 changes: 1 addition & 1 deletion Jellyfin.Api/Controllers/TrailersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public TrailersController(ItemsController itemsController)
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetTrailers(
[FromQuery] Guid? userId,
[FromQuery] Guid userId,
[FromQuery] string? maxOfficialRating,
[FromQuery] bool? hasThemeSong,
[FromQuery] bool? hasThemeVideo,
Expand Down

0 comments on commit aaa9cc6

Please sign in to comment.