mirror of https://github.com/jellyfin/jellyfin.git
Bind @userid only when it's in the statement
This commit fixes a case where SqliteItemRepository attempts to bind @userid even when such parameter may not appear in the query; fixes https://github.com/jellyfin/jellyfin/issues/8141
This commit is contained in:
parent
2b46917dcf
commit
ca5979cd77
|
@ -4934,6 +4934,7 @@ SELECT key FROM UserDatas WHERE isFavorite=@IsFavorite AND userId=@UserId)
|
||||||
AND Type = @InternalPersonType)");
|
AND Type = @InternalPersonType)");
|
||||||
statement?.TryBind("@IsFavorite", query.IsFavorite.Value);
|
statement?.TryBind("@IsFavorite", query.IsFavorite.Value);
|
||||||
statement?.TryBind("@InternalPersonType", typeof(Person).FullName);
|
statement?.TryBind("@InternalPersonType", typeof(Person).FullName);
|
||||||
|
statement?.TryBind("@UserId", query.User.InternalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!query.ItemId.Equals(default))
|
if (!query.ItemId.Equals(default))
|
||||||
|
@ -4988,11 +4989,6 @@ AND Type = @InternalPersonType)");
|
||||||
statement?.TryBind("@NameContains", "%" + query.NameContains + "%");
|
statement?.TryBind("@NameContains", "%" + query.NameContains + "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.User != null)
|
|
||||||
{
|
|
||||||
statement?.TryBind("@UserId", query.User.InternalId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return whereClauses;
|
return whereClauses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue