From 25eade589f28e41de03111fadc6140cade7af725 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 8 May 2025 03:12:00 -0400 Subject: [PATCH] fix: pass user to `query.process` if present. Fixes https://github.com/iv-org/invidious/issues/5097 --- src/invidious/routes/search.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/search.cr b/src/invidious/routes/search.cr index 44970922..b195c7b3 100644 --- a/src/invidious/routes/search.cr +++ b/src/invidious/routes/search.cr @@ -58,7 +58,11 @@ module Invidious::Routes::Search end begin - items = query.process + if user + items = query.process(user.as(User)) + else + items = query.process + end rescue ex : ChannelSearchException return error_template(404, "Unable to find channel with id of '#{HTML.escape(ex.channel)}'. Are you sure that's an actual channel id? It should look like 'UC4QobU6STFB0P71PMvOGN5A'.") rescue ex