Use helper function to compare guid (#10825)

This commit is contained in:
Cody Robibero
2024-01-17 08:51:39 -07:00
committed by GitHub
parent 484ccf7f28
commit e7b8d45bbb
58 changed files with 249 additions and 184 deletions

View File

@@ -3,6 +3,7 @@ using System.Linq;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Data.Enums;
using Jellyfin.Extensions;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@@ -53,7 +54,7 @@ public class FilterController : BaseJellyfinApiController
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] MediaType[] mediaTypes)
{
userId = RequestHelpers.GetUserId(User, userId);
var user = userId.Value.Equals(default)
var user = userId.IsNullOrEmpty()
? null
: _userManager.GetUserById(userId.Value);
@@ -146,7 +147,7 @@ public class FilterController : BaseJellyfinApiController
[FromQuery] bool? recursive)
{
userId = RequestHelpers.GetUserId(User, userId);
var user = userId.Value.Equals(default)
var user = userId.IsNullOrEmpty()
? null
: _userManager.GetUserById(userId.Value);