Skip to content

Commit

Permalink
Search: Populate search bar with ChannelId (iv-org#3805)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamantazFox committed May 23, 2023
2 parents 8d434ac + 8bd2e60 commit e238c08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/invidious/routes/channels.cr
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ module Invidious::Routes::Channels
return error_template(500, ex)
end

env.set "search", "channel:#{ucid} "
return {locale, user, subscriptions, continuation, ucid, channel}
end
end
6 changes: 5 additions & 1 deletion src/invidious/routes/search.cr
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ module Invidious::Routes::Search

redirect_url = Invidious::Frontend::Misc.redirect_url(env)

env.set "search", query.text
if query.type == Invidious::Search::Query::Type::Channel
env.set "search", "channel:#{query.channel} #{query.text}"
else
env.set "search", query.text
end
templated "search"
end
end
Expand Down

0 comments on commit e238c08

Please sign in to comment.