mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Always make userId query parameter optional
This commit is contained in:
@@ -174,7 +174,7 @@ public class PlaylistsController : BaseJellyfinApiController
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public ActionResult<QueryResult<BaseItemDto>> GetPlaylistItems(
|
||||
[FromRoute, Required] Guid playlistId,
|
||||
[FromQuery, Required] Guid userId,
|
||||
[FromQuery] Guid? userId,
|
||||
[FromQuery] int? startIndex,
|
||||
[FromQuery] int? limit,
|
||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields,
|
||||
@@ -183,15 +183,16 @@ public class PlaylistsController : BaseJellyfinApiController
|
||||
[FromQuery] int? imageTypeLimit,
|
||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes)
|
||||
{
|
||||
userId = RequestHelpers.GetUserId(User, userId);
|
||||
var playlist = (Playlist)_libraryManager.GetItemById(playlistId);
|
||||
if (playlist is null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var user = userId.IsEmpty()
|
||||
var user = userId.IsNullOrEmpty()
|
||||
? null
|
||||
: _userManager.GetUserById(userId);
|
||||
: _userManager.GetUserById(userId.Value);
|
||||
|
||||
var items = playlist.GetManageableItems().ToArray();
|
||||
var count = items.Length;
|
||||
|
||||
Reference in New Issue
Block a user